In this code how do I change the sample size of data from 10 to 1000?:
data samples;
do samp = 1 to 10;
do t = 1 to 100;
u = rannor(1996)*5;
x = 100 + 3*rannor(6991);
y = 10 + 0.5*x + u;
output;
end;
end;
run;
Do I just change the number 10 to 1000? I just tried that in SAS and now SAS has been loading for awhile. I'm worried I got it jammed and now it's messed up.
"Do I just change the number 10 to 1000?"
That's correct
"I just tried that in SAS and now SAS has been loading for awhile."
That's not likely. Maybe you need to close and restart
201 data work.samples;
202 do samp = 1 to 1000;
203 do t = 1 to 100;
204 u = rannor(1996)*5;
205 x = 100 + 3*rannor(6991);
206 y = 10 + 0.5*x + u;
207 output;
208 end;
209 end;
210 run;
NOTE: The data set WORK.SAMPLES has 100000 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.12 seconds
cpu time 0.01 seconds
0.12 seconds to create a data set of 100000 records with samp=1000. And mine isn't a particularly fast computer.
If you increased the value of T as well that might lead to more time. Show the code you actually submitted when testing SAMP= 1 to 1000
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.