Hello,
Does Stata have the capability to randomize participants to 1 of 32 conditions in a 2x2x2x2x2 factorial experiment? I have a conditions table (1....32 for 5 factors, each two levels) and want to stratify directly to condition versus combination of factors, as outlined in ralloc. I am using a full factorial design, under guidance from the Multiphase Optimization Strategy: https://publichealth.nyu.edu/w/ioi/o...tions/overview
Guidance on generating the allocation table using R is provided here: https://publichealth.nyu.edu/w/ioi/r...al-redcap-most
And this is the code for R they provide in the example for a full factorial trial with 8 conditions (2x2x2)
library(tidyverse)
DF <- expand.grid(Person = 1:800, scr1_gender = 1:2)
DF <- DF %>% mutate(Block = cut(Person, 100))
set.seed(732212)
DF <- DF %>%
group_by(scr1_gender, Block) %>%
mutate(rand_scond = sample(3:10)) %>%
ungroup()
write.table(DF %>% select(rand_scond, scr1_gender), file = "atab.csv", row.names = FALSE, sep = ",")
Note: I am not stratifying on any variables. So, is there a way to use ralloc to directly randomize to condition or can you provide guidance on using factor with ralloc for a 2x2x2x2x2?
Many thanks,
Heather
Does Stata have the capability to randomize participants to 1 of 32 conditions in a 2x2x2x2x2 factorial experiment? I have a conditions table (1....32 for 5 factors, each two levels) and want to stratify directly to condition versus combination of factors, as outlined in ralloc. I am using a full factorial design, under guidance from the Multiphase Optimization Strategy: https://publichealth.nyu.edu/w/ioi/o...tions/overview
Guidance on generating the allocation table using R is provided here: https://publichealth.nyu.edu/w/ioi/r...al-redcap-most
And this is the code for R they provide in the example for a full factorial trial with 8 conditions (2x2x2)
library(tidyverse)
DF <- expand.grid(Person = 1:800, scr1_gender = 1:2)
DF <- DF %>% mutate(Block = cut(Person, 100))
set.seed(732212)
DF <- DF %>%
group_by(scr1_gender, Block) %>%
mutate(rand_scond = sample(3:10)) %>%
ungroup()
write.table(DF %>% select(rand_scond, scr1_gender), file = "atab.csv", row.names = FALSE, sep = ",")
Note: I am not stratifying on any variables. So, is there a way to use ralloc to directly randomize to condition or can you provide guidance on using factor with ralloc for a 2x2x2x2x2?
Many thanks,
Heather
Comment