Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to select the observations randomly from a SAS dataset

Answers were Sorted based on User's Feedback



How to select the observations randomly from a SAS dataset..

Answer / srinath

Proc surveyselect;
this gives the random selection of observations.

Is This Answer Correct ?    23 Yes 1 No

How to select the observations randomly from a SAS dataset..

Answer / 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

How to select the observations randomly from a SAS dataset..

Answer / srikanth

you can use the RANUNI function to select observations
randomly.

Ex:-

data test;
input number @@;
cards;
2.1 3.1 4 6 2.2 4.9 4 5 3 3.3 4 5 3 4.3 5 7 3 3 9 11
;

data test1;
set test;
random=ranuni(1);
run;

%let k=10;

PROC SORT DATA=TEST1;
BY random;/*SORT OBSERVATIONS*/
run;

DATA TEST2;
SET TEST2 (DROP=RANDOM);
IF _N_ LE &K;
RUN;

PROC PRINT ;
RUN;

Is This Answer Correct ?    8 Yes 6 No

How to select the observations randomly from a SAS dataset..

Answer / neel

By using the point function

Is This Answer Correct ?    1 Yes 1 No

How to select the observations randomly from a SAS dataset..

Answer / chowdary vamsi

using rununni function generate random sample observations

Is This Answer Correct ?    0 Yes 0 No

How to select the observations randomly from a SAS dataset..

Answer / name is no need

I think by using mod operator we can select the random
observations.
syntax:mod(_n_,number);

Is This Answer Correct ?    5 Yes 6 No

How to select the observations randomly from a SAS dataset..

Answer / ram

by using proc sort.

Is This Answer Correct ?    2 Yes 18 No

Post New Answer

More SAS Interview Questions

What is the size of PDV?

2 Answers   L&T,


What type of tables you are using in YOUR reporting..???

2 Answers   GSK GlaxoSmithKline,


i have multiple .csv files in a unix directory. every file is having variable names as header.even for empty file also. suppose take 3 files a.csv b.csv c.csv a.csv contains data as name;age,salary; raja;34;4000; ravi;33;5000; kumar;25;3000; b.csv contains data as name;age,salary; ajay;40;4500; and c.csv contains name;age,salary; (only headers) Now i want to import and append all these files in to a single dataset. i tried infile statement with *.csv to import all at a time. but i m not getting correct data. please help me . its urgent. thank you in advance

2 Answers   Tech Mahindra,


how do you test for missing values? : Sas programming

0 Answers  


how can you get the single data set from the library(which has the number of data sets)?

3 Answers   Accenture, Deloitte,


%STPbegin;%STPEND; ERROR: No logical assign for filename _WEBOUT. WARNING: No body file. HTML output will not be created. unable to fix it.plz help

2 Answers  


What is the difference between %local and %global?

1 Answers  


What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?

1 Answers   Quintiles,


how the sas basic syntax style described? : Sas-administrator

0 Answers  


what are all the default values getting in PROC MEANS...???

2 Answers  


What do you know about sas and what we do? : sas-grid-administration

0 Answers  


explain the proc in sas? : Sas-administrator

0 Answers  


Categories