SAS BASE Q25. define[수정] ??
QUESTION NO: 25
Given the SAS data set SASUSER.HOUSES:
Obs style bedrooms baths price sqteet street
1 CONDO 2 1.5 80050 1200 MAIN
2 CONDO 3 2.5 79350 1300 ELM
3 CONDO 4 2.5 127150 1400 OAK
4 CONDO 2 2.0 110700 1100 FIFTH
5 TWOSTORY 4 3.0 107250 2100 SECOND
6 TWOSTORY 2 1.0 55650 1600 WEST
7 TWOSTORY 2 1.0 69250 1450 NORTH
6 TWOSTORY 4 2.5 102950 2000 SOUTH
The following SAS program is submitted:
proc report data = sasuser.houses nowd headline;
column style price;
where price lt 100000;
<insert DEFINE statement here>
define price / mean width = 9 format = dollar12.;
title;
run;
The following output is desired:
style price
CONDO $79,700
TWOSTORY $62550
Which DEFINE statement completes the program and produces the desired output?
A. define style / width = 9;
B. define style / order width = 9;
C. define style / group width = 9;
D. define style / display width = 9;
Answer: C
# 문제 풀이
- column 변수 : 변수에 대해서 리포트를 하겠다. (proc report 단계에서)
- define문 : define 변수 / 옵션 꼴
- define 변수 / order : 변수에 대해 오름차순 정렬을 하고 각 변수별로 관측치 나열. 이 때 각 변수의 그룹에서 순서변수로 지정된 변수는 한 번 씩만 출력.
- define 변수 / group : 변수의 각 그룹별로 묶어서 출력.
- define 변수 / display : 변수를 있는 그대로 출력.
> 1번 결과
> 2번 결과
> 3번 결과
> 4번 결과