全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2456 2
2016-03-05
retain mon1-mon11 . time 0;
        time+1;
        if mon1=. then do i=1 to 11;
                seasons[i]=0;
        end;

二维码

扫码加我 拉你入群

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

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

全部回复
2016-3-5 17:14:50
zzf159476 发表于 2016-3-5 10:04
数值变量设为缺失
恩 谢谢了 还有个问题也想请你看一下。data work.Air1990_2000;       
        set sashelp.airline1990_2013(where=(month<='31Dec2000'd));
        array seasons{*} mon1-mon11;
        retain mon1-mon11 . time 0;
        time+1;
        if mon1=. then do i=1 to 11;
                seasons=0;
        end;
        if month(month)<12 then do;
                seasons[month(month)]=1;
                output;
                seasons[month(month)]=0;
        end;
        else output;
        drop i;
run;   这一段if语句实在看不懂 尤其是红色两行。 再次谢谢。

二维码

扫码加我 拉你入群

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

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

2016-3-6 12:59:36
一线天56 发表于 2016-3-5 17:14
恩 谢谢了 还有个问题也想请你看一下。data work.Air1990_2000;       
        set sashelp.airline1990_2013(where= ...
month(month)这里是求变量month的月份,例如这里得到的结果是10,那么然后下面的seasons{month(month)}就是seasosons{10}
二维码

扫码加我 拉你入群

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

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

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

分享

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