Hi,
I need help in creating a dummy dataset with days 1-10 and each day with 4 timepoints for each subject. I have to merge this dummy dataset back to the original dataset so that I can get all the missing days and respective timepoints in the original dataset. Can someone help me in creating the dummy dataset with arrays. Dummy dataset should look like below one
subejct day timepoint
10000 1 1
10000 1 2
10000 1 3
10000 1 4
10000 2 1
10000 2 2
10000 2 3
10000 2 4
10000 3 1
10000 3 2
10000 3 3
10000 3 4 and so on
Thanks,
Pradev
Hi:
I'm not sure you need an array. It seems to me a DO loop would be the best way to generate a dummy dataset. Something like what's shown below....it generates one observation for every subject/day/timepoint -- with 4 timepoints and 10 days per subject.
cynthia
data dummydata;
do subject = 10000 to 15000 by 2500;
do day = 1 to 10 by 1;
do timepoint = 1 to 4 by 1;
output;
end;
end;
end;
run;
proc print data=dummydata ;
var subject day timepoint;
run;
Thank you Cynthia. This is exactly what I need.
Regards
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.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.