【问题标题】:SAS data miningSAS数据挖掘
【发布时间】:2017-01-25 10:33:52
【问题描述】:

我有一个带有 ID 和好/坏指标变量的数据集:

ID   Good_Bad
734374  0
4834110 1

我想将 1 的 12 次外推为 0,这样对于每个 0,我就有 12 个这样的 1:

ID  Good_Bad
734374  0
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1
4834110 1

& 这必须使用 SAS 来完成。有人可以帮忙吗?

提前致谢!!

【问题讨论】:

    标签: sas extrapolation


    【解决方案1】:
    data want;
    
    set have;
    
    if      good_bad = 0 then output;
    else if good_bad = 1 then do;
      do i = 1 to 12;
        output;
      end;
    end;
    
    drop i;
    run;
    

    【讨论】:

      猜你喜欢
      • 2011-02-07
      • 2019-04-24
      • 2011-07-28
      • 2011-11-28
      • 2015-05-16
      • 2012-09-24
      • 2013-08-01
      • 2012-12-03
      • 1970-01-01
      相关资源
      最近更新 更多