Hi. My dataset includes doctor names and the number of consults per week. I am using this data to randomize the doctors into different treatment arms for a RCT, while stratifying by two variables - campus and strata_consult - using the power twomeans command.
I have a few questions:
1. How do I include the two variables as strata variables in the power twomeans command. I know the general power command, but not for power twomeans
2. Below is the split of observations for the two strata variables. Is it problematic to include two variables with different distributions and how does one solve for that?
I have a few questions:
1. How do I include the two variables as strata variables in the power twomeans command. I know the general power command, but not for power twomeans
2. Below is the split of observations for the two strata variables. Is it problematic to include two variables with different distributions and how does one solve for that?
Code:
input str37 ConsultantName float strata_consult str13 Campus "Aditya Kapoor" 3 "Austin" "Aditya Kapoor" 3 "Austin" "Aditya Kapoor" 3 "Austin" "Aditya Kapoor" 3 "Austin" "Matthew Belenje" 4 "Alpine" "Matthew Belenje" 4 "Alpine" "Matthew Belenje" 4 "Alpine" "Matthew Belenje" 4 "Alpine" "Matthew Belenje" 4 "Alpine" "Rachael Weiss" 3 "Charlotte" "Rachael Weiss" 3 "Charlotte" "Rachael Weiss" 3 "Charlotte" "Rachael Weiss" 3 "Charlotte" "Rachael Weiss" 3 "Charlotte" ------------------------------------------------------------------------------------------------- strata_consult (unlabeled) ------------------------------------------------------------------------------------------------- tabulation: Freq. Value 317 1 523 2 549 3 560 4 ------------------------------------------------------------------------------------------------- reg_campus (firstnm) Campus ------------------------------------------------------------------------------------------------- tabulation: Freq. Numeric Label 340 1 Texas 1,100 2 Michigan 214 3 Alpine 241 4 Charlotte ////Sampling code////// local power = 0.8 local nratio = 1 local alpha = 0.05 local N = 100 quietly sum OCbyWeek if !missing(OCbyWeek) local sd = `r(sd)' local baseline = `r(mean)' power twomeans `baseline', n(`N') power(`power') sd(`sd') nratio(`nratio') table local mde= round(`r(delta)',0.0001) di as error "The MDE is `mde' given a sample size of `N', ratio of units in treatment and control of `nratio', and power `power'"
Comment