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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: