How to select the observations randomly from a SAS dataset
Answer Posted / learner
By using ranuni function. for example you want select 30
percent of data randamly from a data set.
data x;
set y;
if ranuni(100)<.3 ;
run;
here 100 is the seed. the number generated depends on this
seed .
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
Can you explain the process of calendar?
If a variable contains only numbers, can it be a character data type?
Mention the category in which sas informats are placed?
What is the differnce between SDTM 3.1.2 to 3.1.1 version
Can you execute a macro within a macro? Describe. : sas-macro
Are you sensitive to code walk-throughs peer review or QC review?
What is the SAS data set?
what is SAS OPTIMIZATION?
what is PhaseIII, ODS, TLG, Macro and Proc in SAS
What is the sas data set? : sas-grid-administration
What is the basic syntax of a sas program?
what does the run statement do? : Sas programming
what are input dataset and output dataset options? : Sas programming
why is a stop statement needed for the point=option on a set statement? : Sas programming
What is the difference between reading data from an external file and reading data from an existing data set?