BookmarkSubscribeRSS Feed
knargis160
Calcite | Level 5

Can someone help with coding for randomization of the sample where the outcome is binary and age is stratified

2 REPLIES 2
Ksharp
Super User

Plz post the output you want. and Better give an example .

 

proc plan seed=123;
factors age=10 binary=2;
output out=want;
quit;
acordes
Rhodochrosite | Level 12

I suppose you run SAS Viya, therefore take a look at the specific action.

 

copied from the sas documentation:

 

proc cas;
   loadactionset "sampling";
   action stratified result=r/table={name="hmeq",groupby={"bad"}}
      samppct=10 samppct2=20 partind="TRUE" seed=10
      output={casout={name="out",replace="TRUE"},
              copyvars={"job","reason","loan","value","delinq","derog"}};
   run;
   print r.STRAFreq; run;
quit;

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1252 views
  • 0 likes
  • 3 in conversation