由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请教一个sas123问题
相关主题
SAS base questionSAS123题之64和50题之37居然题目相同,答案不同!
已解决[合集] Ask two base test questions?
请教, base 123 , if then else[合集] SAS里如何实现LOCF(LAST OBS CARRIED FORWARD)?
SAS题求教do loop 的一道题
问个sas base的题目菜鸟请教SAS初级编程题目。
求助关于SAS base123如何用SAS对ID(OBS)求SUM或者用SAS消去ID(没有ID)。
请教sas123题中第59题。SAS base 87% pass today
[求助]Base SAS123 几道题39,72,73,75,76,79,93关于SAS里TRUNCOVER一问
相关话题的讨论汇总
话题: expertise话题: medium话题: level话题: sas话题: high
进入Statistics版参与讨论
1 (共1页)
s****4
发帖数: 8
1
A SAS Print procedure output the work.levels data set is listed below:
Obs Name Level
1 Frank 1
2 Joan 2
3 Jose 3
4 Burt 4
5 Kelly .
6 Juan 1
The following SAS program is submitted:
Data work.expertise;
Set work.levels;
If level = . then expertise = ‘Unknown’;
else if level =1 then expertise = ‘Low’;
else if level = 2 or 3 then expertise = ‘Medium’;
else expertise = ‘High’;
Run;
Which of the following values does the variable expertise contain?
A. Low, Medium, and High only
B.
g**r
发帖数: 425
2
hehe, This is a good one.
Note that there is a "mistake" in the code:
if level = 2 or 3 then expertise = ‘Medium’;
This is the same as saying: if (level=2) or 3 then expertise="Medium".
Note that in SAS, numbers>0 is considered as "TRUE", so 3 is always "TRUE".
So, everything is set to "Medium" after this step.
s****4
发帖数: 8
3
It makes sense. Thanks a lot!

【在 s****4 的大作中提到】
: A SAS Print procedure output the work.levels data set is listed below:
: Obs Name Level
: 1 Frank 1
: 2 Joan 2
: 3 Jose 3
: 4 Burt 4
: 5 Kelly .
: 6 Juan 1
: The following SAS program is submitted:
: Data work.expertise;

1 (共1页)
进入Statistics版参与讨论
相关主题
关于SAS里TRUNCOVER一问问个sas base的题目
SAS basic question求助关于SAS base123
SAS求助,out of memory请教sas123题中第59题。
SAS -proc transpose 急问![求助]Base SAS123 几道题39,72,73,75,76,79,93
SAS base questionSAS123题之64和50题之37居然题目相同,答案不同!
已解决[合集] Ask two base test questions?
请教, base 123 , if then else[合集] SAS里如何实现LOCF(LAST OBS CARRIED FORWARD)?
SAS题求教do loop 的一道题
相关话题的讨论汇总
话题: expertise话题: medium话题: level话题: sas话题: high