BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lopa2016
Fluorite | Level 6
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!!

1 ACCEPTED SOLUTION

Accepted Solutions
Kalind_Patel
Lapis Lazuli | Level 10

Try this code:

data test;
input ID Good_Bad ;
infile datalines;
datalines;
734374  0
4834110 1
;
run;



data final(drop=i); 
  set test; 
  by Good_Bad;
  if Good_bad=0 then output;
  if Good_Bad=1 then
   do i= 1 to 12;
        output; 
    end; 
Run;

View solution in original post

4 REPLIES 4
Kalind_Patel
Lapis Lazuli | Level 10

Try this code:

data test;
input ID Good_Bad ;
infile datalines;
datalines;
734374  0
4834110 1
;
run;



data final(drop=i); 
  set test; 
  by Good_Bad;
  if Good_bad=0 then output;
  if Good_Bad=1 then
   do i= 1 to 12;
        output; 
    end; 
Run;
Lopa2016
Fluorite | Level 6

Thanks for your reply but I have figured it out!!

Reeza
Super User

Use PEVENT on the model statement to apply a prior probability when running a model with low event rates. 

Lopa2016
Fluorite | Level 6

Thanks Reeza!!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1209 views
  • 0 likes
  • 3 in conversation