BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hyunjeehale
Calcite | Level 5

I am needing to develop a randomization table using stratified block randomization with proportional allocation for an outside group to use. We know the general population proportions among the sample we are screening participants from for the two strata variables we want to use.

 

Treatment groups: 3

Strata 1: 2 levels (proportions of each level: 50%, 50%)

Strata 2: 3 levels (proportion of each level: 17%, 36%, 47%)

 

Total participants: 30,000

 

I have been using PROC PLAN to develop my randomization table, but could not find a solution that allowed me to account for the proportional breakdown of each strata. I found some references for PROC SURVEYSELECT and proportional allocation, however I could not find a way to incorporate blocks.

 

Using PROC PLAN, I am able to generate a randomization table of most of what I need, but the treatment groups are distributed evenly across the unique strata combination

What I get:

Treatment 1 (same for treatments 2 and 3)

                  Strata 2

                   Level 1       Level 2         Level 3

Strata 1

Level 1        1680         1680              1680

Level 2        1680         1680               1680

 

What I Need

Treatment 1 (same for treatments 2 and 3)

                  Strata 2

                   Level 1       Level 2         Level 3

Strata 1

Level 1        571        1210              1579

Level 2        571         1210               1579

 

 

Thank you for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

See if this come close to what you want:

data want;
   set have;
   strata1 = rand('table',.5,.5);
   strata2 = rand('table',.17,.36,.47);
run;

The rand('table') function uses a list of proportions to randomly assign values of 1 , 2, 3 etc depending upon how many parameters are used. Since it is random you may not get exactly the number of records per cell though with large data set and not really small percentages you should get close. If not close enough re-run until they are .

 

View solution in original post

1 REPLY 1
ballardw
Super User

See if this come close to what you want:

data want;
   set have;
   strata1 = rand('table',.5,.5);
   strata2 = rand('table',.17,.36,.47);
run;

The rand('table') function uses a list of proportions to randomly assign values of 1 , 2, 3 etc depending upon how many parameters are used. Since it is random you may not get exactly the number of records per cell though with large data set and not really small percentages you should get close. If not close enough re-run until they are .

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1209 views
  • 0 likes
  • 2 in conversation