Hi,
Can you please help me with generating the randomization lists based on the below study design?
Phase 1: 766 subjects randomized into 2 groups (high dose vs. low dose) (n= 383 per group)
Then we randomly select 268 subjects out of the 383 subjects in low dose group and randomly select 268 subjects out of the 383 subjects in high dose group
Phase 2: we randomize the 268 subjects into 2 groups (no intervention vs intervention) (n=134 per group) among low dose groups and randomize the 268 subjects into 2 groups (no intervention vs intervention) (n=134 per group) among high dose groups
The randomization permuted blocks in phase 1 and phase 2 will also need to be stratified by 4 study sites and gender so I will have 8 lists.
Thank you!
@Denali wrote:Hi,
Can you please help me with generating the randomization lists based on the below study design?
Phase 1: 766 subjects randomized into 2 groups (high dose vs. low dose) (n= 383 per group)
Then we randomly select 268 subjects out of the 383 subjects in low dose group and randomly select 268 subjects out of the 383 subjects in high dose group
Phase 2: we randomize the 268 subjects into 2 groups (no intervention vs intervention) (n=134 per group) among low dose groups and randomize the 268 subjects into 2 groups (no intervention vs intervention) (n=134 per group) among high dose groups
The randomization permuted blocks in phase 1 and phase 2 will also need to be stratified by 4 study sites and gender so I will have 8 lists.
Thank you!
You have 4 treatment combinations: High, no internvention/ High, intervention/ Low, no intervention / Low, intervention and you want 134 in each group. You have a total of 766 subjects. 766-134*4=766-536=230.
For a single stratum you can do this.
Proc surveyselect data=mydata groups=(134,134,134,134,230) seed=yourseed out=myassignments;
run;
The output data set will contain all records in your input data set and a variable named GroupID that has values 1-5 (in this example.)
That will randomly assign records to 5 groups, numbered 1,2,3,45. You can discard the 5th group. I'd apriori assign group values 1-4 to your 4 treatment options so you avoid assigning groups to treatments based on some biased assessment.
If you have the same number of observations in each stratum, you can do this:
Proc surveyselect data=mydata groups=(134,134,134,134,230) seed=yourseed out=myassignments;
strata mystrata;
run;
Caveat: I don't know exactly how SAS is doing the random assignment. It could be doing a random sort and then a sequential assignment to groups or something else. If you aren't comfortable with this you can do a sequence of without replacement sampling steps:
/* Phase 1 */
/* For a single stratum */
proc survey select data=mydata method=SRS sampsize=383 seed=myseed out=myresults;
run;
All observations sampled and placed into myresults should be assigned to either High or Low (make that decision prior to selecting the sample). All observations not inclued in myresults get assigned to the other group.
One you have created an indicator of the assignment to High and Low, do the following:
proc survey select data=mydata method=SRS sampsize=268 seed=myseed out=myresults2;
strata HighLow ; /* This variable classifies the 766 subjects into High and Low groups */
run;
The myresults2 data set will contain 268*2=536 records.
/* Phase 2 */
proc survey select data=myresults2 method=SRS sampsize=134 seed=myseed out=myresultsInt;
strata HighLow ;
run;
All records placed into myresultsInt are assigned to Intervention. Those that are not are assigned to non-intervention.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.