全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2075 1
2008-08-12
 The SAS data set BANKS is listed below:
BANKS
name rate
FirstCapital 0.0718
DirectBank 0.0721
VirtualDirect 0.0728
The following SAS program is submitted:
data newbank;
do year = 1 to 3;
set banks;
capital + 5000;
end;
run;
Which one of the following represents how many observations and variables
will exist in the SAS data set NEWBANK?
A. 0 observations and 0 variables
B. 1 observations and 4 variables
C. 3 observations and 3 variables
D. 9 observations and 2 variables
Answer: B

如果把 set banks 放到do year=1 to 3前面的话就是3 observations and 4
variables

为什莫呢?谢谢
二维码

扫码加我 拉你入群

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

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

全部回复
2008-8-12 09:57:00
I have verified the answer.

- When 'set banks' is put after the do-loop, the loop repeats for each observation of newbank. B/C newbank is new one, therefore, there would be only one observation;
- When 'set banks' is put before the do-loop, the loop repeats for each observation of banks. B/C banks has three observations, therefore, there would be 3 observations;

In both cases, the extra variable is 'Year'.

Hope it helps

二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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