BookmarkSubscribeRSS Feed
pradev
Calcite | Level 5

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

2 REPLIES 2
Cynthia_sas
Diamond | Level 26

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;

pradev
Calcite | Level 5

Thank you Cynthia. This is exactly what I need.

Regards

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1293 views
  • 0 likes
  • 2 in conversation