SAS : Random Sampling with PROC SQL

This tutorial explains how to get random sample with PROC SQL.

The RANUNI Function performs random sampling and OUTOBS restricts row processing.
proc sql outobs = 10;
create table tt as
select * from sashelp.class
order by ranuni(1234);
quit;
In this case, we are selecting 10 random samples. 
Related Posts
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and Human Resource.

1 Response to "SAS : Random Sampling with PROC SQL"
  1. Didnt got the logic behind the Random sampling, Can anyone please explain me?

    ReplyDelete

Next → ← Prev
Love this Post? Spread the Word!
Share