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
This entry was posted in General. Bookmark the permalink. Post a comment or leave
What is the difference between match merge and one to one merge?
What commands are used in the case of including or excluding any specific variables in the data set?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
Which are the statements whose placement in the data step is critical?
what is hash files in sas and why we are using this one in sas?
How substr function works in sas?
How would you identify a macro variable? : sas-macro
Enlist the syntax rules followed in sas statements.
Describe 5 ways to do a “table lookup” in SAS?
How do you test for missing values?
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
Enlist the functions performed by sas.
What is data _null_?
explain about data integrator metadata reports? : Sas-di