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

describe how to adjust the performance of data integrator? : Sas-di

782


what are informats in sas? : Sas-administrator

800


how would you create multiple observations from a single observation? : Sas programming

787


What are the statements that are executed only?

917


What is PROC in SAS?

832


How are numeric and character missing values represented internally?

1400


Do you know the features of sas?

821


explain about data integrator metadata reports? : Sas-di

831


Difference between nodup and nodupkey options?

886


What is Linear Regression?

905


Explain input and put function?

890


If you were told to create many records from one record, show how you would do this using array and with proc transpose?

1182


What is the difference between the proc sql and data step?

898


What is the difference between one to one merge and match merge? Give an example.

827


is data integration and etl programming is same? : Sas-di

818