Download presentation
Presentation is loading. Please wait.
1
Creating the Example Data
2
The full data set proc contents data=fram.fram40;run;
3
Select a sample of specified size keeping only the variables desired.
/*select a random sample of size 15*/ proc surveyselect data=fram.fram40(keep=spf1-spf5) out=ftmp method=srs sampsize=15 seed=54321 ; run;
4
Assign an id to each observation
/*assign a meaningless id*/ data ftmp; length id 8; set ftmp; id=_n_; run;
5
Examine the data set proc print data=ftmp;run;
6
Changing the descriptor portion PROC DATASETS
/*get rid of labels and formats*/ proc datasets lib=work memtype=data; modify ftmp; attrib _all_ label=' '; attrib _all_ format=; quit;
7
Sort the data in random order
/*do a random sort on data*/ data ftmp; set ftmp; call streaminit( ); ranx=rand("uniform"); id=_n_; run; proc sort data=ftmp;by ranx;run;
8
Create 5 separate files /*create a separate file for each of the exams*/ data sbp1(keep=id spf1 rename=(spf1=sbp)) sbp2 (keep=id spf2 rename=(spf2=sbp)) sbp3 (keep=id spf3 rename=(spf3=sbp)) sbp4 (keep=id spf4 rename=(spf4=sbp)) sbp5 (keep=id spf5 rename=(spf5=sbp)) ; set ftmp; output sbp1; output sbp2; output sbp3; output sbp4; output sbp5; run;
9
Examine Results proc contents data=sbp1;run;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.