|
|
|
|
|
|
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;
|
|
|
|
|
|
|