楼主: lqiantobe
5191 11

[SAS] [讨论]请教高手SAS EXAM 2题 [推广有奖]

11楼
qt600 发表于 2007-3-12 13:25:00
<P>1.A raw data file is listed below:<BR>----|----10---|----20---|----30<BR>John McCloskey 35 71<BR>June Rosesette 10 43<BR>TinekeJones 9 37<BR>The following SAS program is submitted using the raw data file as input:<BR>data work.homework;<BR>infile 'file-specification';<BR>input name $ age height;<BR>if age LE 10;<BR>run;<BR>How many observations will the WORK.HOMEWORK data set contain?</P>
<P>A. 0<BR>B. 2<BR>C. 3<BR>D. No data set is created as the program fails to execute due to errors.<BR></P>
<P>根据偶对二楼解释的理解:</P>
<P>根据IF语句,要满足age less equal 10;如果不符合条件的话,就被认为是missing value.在name,age, height三个值中,除了age,其他两个仍然存在.</P>
<P>1.John McCloskey   missing   71<BR>2.June Rosesette    10    43<BR>3.TinekeJones      9    37</P>
<P>最后的结果还是3个obs.</P>
<P>PS:不肯定一定对,还望高手指正.</P>

12楼
Vulpecula 发表于 2007-3-12 14:24:00
<P><FONT size=2>Obs    name        age    height</FONT></P>
<P><FONT size=2> 1     John         .       35<BR> 2     June         .       10<BR> 3     TinekeJo     9       37<BR></FONT><FONT size=2></FONT></P>
<P><FONT size=2>我觉得是由于第1、2个观测的姓和名分开,其实只有John和June被作为name读入,所以其age都应该是缺失。</FONT></P>
<P><FONT size=2>而如果将这两条观测姓与名之间的空格删去,结果就会是楼主所说的,有2个符合age&lt;=10的观测。</FONT></P>
<P><FONT size=2>Obs      name      age    height</FONT></P>
<P><FONT size=2> 1     JuneRose     10      43<BR> 2     TinekeJo      9      37<BR></P></FONT>

您需要登录后才可以回帖 登录 | 我要注册

客服
GMT+8, 2026-12-1 13:59