1. 数据集的属性里,encoding和label的值分别是什么。
proc contents data = cert.input01;.google и
run;
易知答案为wlatin1 Western (Windows)和Student Data。
这个真的很简单。
2. sort data 根据postalcode和递减的income。 在每个postalcode中,挑出含有最高income的观测。要用到first.
proc sort data = cert.input02 out = data02;
by postalcode descending income;
run;
data results.output02; . ----set data02;
by postalcode descending income;
if first.postalcode ;
run;. 1point3acres.com
. 1point 3acres 3. Merge two datasets with common variable . One dataset contains variables Product and Qty, another contains variables Product and Price. 要求在输出的output dataset中新建一个variable名叫total, total = Qty * Price
在merge data1 data2; by XXX;之前,首先分别sort它们.1point3acres
4. 根据age输出三个数据,results.output04young results.output04mid results.output04notasyoung 并计算 mean sum ..
. 1point 3acres
data results.output04Young results.output04Mid results.output04notasyoung; .google и
set cert.input04;
if age LE 40 then output results.output04Young;
else if age LE 60 then output results.output04Mid;
else if <这里加上了另一个条件> then output results.output04notasyoung;
run;
Data cert.input05;. Χ
Input name $ city $ 3-10 major $ 12-27 class $ test1 test2 test3 test4;
Datalines;. From 1point 3acres bbs
A Beijing math senior 5 4 3 4
B Beijing math senior 2 1 1 5. ----
C Tianjin history senior 5 5 5 5
D Shanghai history and ball junior 4 4 4 4
E Hebei ball and reading junior 1 1 2 3
F Beijing run junior 2 2 1 2
G Beijing run and ball senior 5 4 5 1
;
Run;. 1point3acres
data results.output05 (drop = n);
set cert.input05;
n = find(major,'and','i');
if n ^= 0 then do;
second_major = substr(major,n+4);
major = substr(major,1,n-1); . From 1point 3acres bbsend;
run;
proc freq data = results.output05;
tables major second_major;. 1point3acres.com
run;
. check 1point3acres for more. 6. 还有个lab记不清了
lab7 & 8 改错。读log根据提示改错,一般是data名字拼错误 young 变成younger,大小设定不精准 <= 和 < 之类的。。