全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
606 3
2022-04-03
悬赏 20 个论坛币 已解决
复制代码
如何在标红的观测后面加空行,谢谢!

最佳答案

乐天天12300 查看完整内容

/*空行是字符型缺失,所以你的x值要转为字符型*/ data bbb; set aaa nobs=last; x_new=strip(x); if (x_new^=lag(x_new) and _n_ ^=1) then do; temp=x_new; call missing(x_new); output; x_new=temp; end; output; if _n_=last then do; call missing(x_new); output; end; ...
二维码

扫码加我 拉你入群

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

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

全部回复
2022-4-3 14:26:28
/*空行是字符型缺失,所以你的x值要转为字符型*/
data bbb;
    set aaa nobs=last;
    x_new=strip(x);
    if (x_new^=lag(x_new) and _n_ ^=1) then
        do;
            temp=x_new;
            call missing(x_new);
            output;
            x_new=temp;
        end;
    output;
    if _n_=last then
        do;
            call missing(x_new);
            output;
        end;
    rename x_new=x;
    drop temp x;
run;
二维码

扫码加我 拉你入群

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

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

2022-4-3 22:28:32
哪些观测是标红的?
二维码

扫码加我 拉你入群

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

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

2022-4-4 15:49:02
whymath 发表于 2022-4-3 22:28
哪些观测是标红的?
.
.
.
1
1
2
2
2
.
.
3
3
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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