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


Please Help Members By Posting Answers For Below Questions

What are the applications primarily used by business analyst? : Sas-bi

554


How do you delete duplicate observations in sas?

581


what other sas products have you used and consider yourself proficient in using? : Sas programming

688


What do you understand by the term Normal Distribution?

570


Explain input and put function?

647






what are _numeric_ and _character_ and what do they do? : Sas programming

678


how do you debug and test your sas programs? : Sas programming

563


what are the benefits of data integration? : Sas-di

540


What was the last computer book you purchased? Why?

1916


How can you create a macro variable with in data step? : sas-macro

578


What is PROC in SAS?

608


Which function is used to count the number of intervals between two sas dates?

572


Explain translate function?

636


what is the difference between unique key and primary key? : Sas-di

600


I need level 2 to 5 sas using companies in india

1932