-1

I have a dataset with ID & a Good/Bad indicator variable:

ID   Good_Bad
734374  0
4834110 1

I want to extrapolate the 1's 12 times as 0s so that for every 0 I have 12 1s like this:

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

& this has to be done using SAS. Can anyone help out?

Thanks in advance!!

user6016731
  • 382
  • 5
  • 18

1 Answers1

0
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;
Andrew Haynes
  • 2,612
  • 2
  • 20
  • 35