Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stratification with power twomeans command

    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?





    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'"

  • #2
    Hi, Scott.

    It is unclear whether the intervention is aimed at physicians (e.g., whether a physician is the unit of analysis). I am assuming you are not randomizing physicians to evaluate outcomes in patients, a design that would require sample size calculations for cluster randomized trials.

    It is also unclear whether you assume that the treatment effect is the same across strata. If a fixed-effect model can be assumed, there is no need to account for stratification.

    If treatment effects are assumed to be different across strata, one approach is to use Monte Carlo simulation to compute power via meta-analysis methods - using a random-effects model.







    Comment


    • #3
      Hi Tiago Pereira. Thank you for your response. The details:

      1. The intervention is aimed at physicians to evaluate the outcomes at the physician level itself - if it leads to an increase in teleconsults.
      2. No, I do not assume that the treatment effect is the same across strata, so a fixed effect model does not work here.
      3. Do you have any sources that you could point me to on Monte Carlo simulation to compute power via meta-analysis methods - using a random-effects model?
      4. I tried the code below based on the Burlig et al. paper, but haven't been able to figure out to add strata in it. Do you have any suggestions on this as well?

      Code:
      *power=0.8; 1 SD=0.45
      pc_simulate OCbyWeek, model(ANCOVA) mde(0.45) i(Consultantid) t(week_gen) n(95) ///
      bootstrap p(0.5) pre(5) post(12) alpha(0.05) nsim(1000) vce(robust) outfile(powercalcs.csv) replace

      Comment


      • #4
        I think a very nice starting point is the approach discussed here.

        https://onlinelibrary.wiley.com/doi/...1002/jrsm.1240

        Since you are working with continuous outcomes, I would say the main ingredients are: -drawnorm-, -regress- and -metan-

        Let me know if you need anything more specific.

        Last edited by Tiago Pereira; 02 Jun 2023, 11:27.

        Comment

        Working...
        X