【问题标题】:How to delete some rows within a group in SAS如何在 SAS 中删除组中的某些行
【发布时间】:2021-01-22 15:37:27
【问题描述】:

我想识别不同组的行之间的任何重复项并删除一些观察结果。

我的例子:

data temp;
input siren $ imput $;
cards;
x one
x one
x two
y two
y two
z three
z three
z four
;
run;

我想要的输出:

siren imput
x one
x one
y two
y two
z three
z three

提前非常感谢!

【问题讨论】:

    标签: sas


    【解决方案1】:

    您可以为此使用 PROC SORT。

    data temp;
    input siren $ imput $;
    cards;
    x one
    x one
    x two
    y two
    y two
    z three
    z three
    z four
    ;
    proc print;
       run;
    proc sort data=temp out=dups nouniquekey;
       by siren imput;
       run;
    proc print;
       run;
    

    【讨论】:

      猜你喜欢
      • 2020-09-23
      • 1970-01-01
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多