全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
4792 11
2007-03-07

1.A raw data file is listed below:
----|----10---|----20---|----30
John McCloskey 35 71
June Rosesette 10 43
TinekeJones 9 37
The following SAS program is submitted using the raw data file as input:
data work.homework;
infile 'file-specification';
input name $ age height;
if age LE 10;
run;
How many observations will the WORK.HOMEWORK data set contain?

A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.
Answer: C

Why the answer is not B.2???

2.The following SAS program is submitted:
data work.test;
set work.staff (keep = jansales febsales marsales);
array diff_sales{3} difsales1 - difsales3;

array monthly{3} jansales febsales marsales;
run;
Which one of the following represents the new variables that are created?
A. JANSALES, FEBSALES and MARSALES
B. MONTHLY1, MONTHLY2 and MONTHLY3
C. DIFSALES1, DIFSALES2 and DIFSALES3
D. DIFF_SALES1, DIFF_SALES2 and DIFF_SALES3

Answer: C

I think if use ARRAY to create new var. it does not include elements list.Here two array statement all include elements name,how to get c is correct answer??

3xxxxx guys

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-3-7 17:59:00
A 1:
The condition statment is "age LE 10".
If you run the program, you will find that age value should be:
#1 . (missing)
#2 . (missing)
#3 9

missing valud always less than any number.
That means the the age value in three obs are less than 10.
So the answer is C.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-8 05:28:00

o...... i got it.

then who can help me out for Q2?

Thanks so so much

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-8 09:03:00

work.staff 中只有三个月各自的销量被引入,后来被这三个变量被组成了monthly{3}。而“array diff_sales{3} difsales1 - difsales3;”又创造了一个三维的数组,包含三个新的变量difsales1 - difsales3。现在问谁是命令提交后的新变量,因此应该是C。楼主使用的element在这里的含义可能有些模糊,纵向element是变量Var,横向的element是观测Obs。规则是可以有变量而没有观测(缺失),但不能有观测却不知属于哪个变量。所谓数组,本身就是“若干个变量的集合”,因此它里面的element就是一个一个的变量,在定义的时候也需要指出各变量名。当然,数组的建立不会创造新的Obs,因为它处理的对象并非“最基层”的具体数据。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-8 13:55:00

firstly,thanks for u explanation,但我还是有点模糊.

你是如何知道 work.staff 中三个变量(三个月各自的销量) 是被引入的,而“array diff_sales{3} difsales1 - difsales3;”是创造了一个三维的数组,而不是引入变量

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2007-3-8 14:25:00
Notice the statement below:
set work.staff (keep = jansales febsales marsales);

This means the variables from the dataset work.staff are three (jansales febsales marsales);
So the variables difsales1 - difsales3 should be created at present.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群