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
What function CATX syntax does?
Differentiate input and infile.
What is the purpose of _character_ and _numeric_?
What is the role of administrative users? : sas-grid-administration
What is connection profile? : sas-grid-administration
what type of graphs we will create(for 2+years candidates)?
What is the use of %include statement?
Explain proc univariate?
What is the difference between match merge and one to one merge?
explain about sas business intelligence? : Sas-bi
What is the command used to find missing values?
Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.
What are the new features included in the new version of SAS Programming Language?
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?