Announcement

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

  • Power Calculations for 3 arm clustered randomised trial

    Hi everyone, I need to do power calculations for a 3 arm trial (to determine minimum detectable effect size, given the alpha, power, sample size etc). I found the command clustersampsi, but it only seems to consider experiments with two groups. I want to identify the minimum detectable effect size of treatment vs reference and placebo vs reference, and check whether my sample size is sufficient to detect a significant difference between the two (i.e. treatment vs reference being significantly greater than placebo vs reference). Is there any way to do this on Stata? Would be very grateful for any insight! Thank you

  • #2
    Originally posted by Smriti Ganapathi View Post
    to detect a significant difference between the two (i.e. treatment vs reference being significantly greater than placebo vs reference).
    Isn't that the same thing as testing the difference between two arms, i.e., whether the experimental treatment group's outcome is greater than the placebo treatment group's outcome?

    .ÿ
    .ÿversionÿ16.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿsetÿseedÿ`=strreverse("1510596")'

    .ÿ
    .ÿ//ÿClusters
    .ÿquietlyÿsetÿobsÿ21

    .ÿgenerateÿbyteÿcidÿ=ÿ_n

    .ÿgenerateÿdoubleÿcid_uÿ=ÿrnormal()

    .ÿ
    .ÿ//ÿCluster-randomizedÿtreatmentÿgroupÿassignments
    .ÿgenerateÿbyteÿtrtÿ=ÿmod(_n,ÿ3)

    .ÿlabelÿdefineÿGroupsÿ0ÿReferenceÿ1ÿPlaceboÿ2ÿExperimental

    .ÿlabelÿvaluesÿtrtÿGroups

    .ÿ
    .ÿ//ÿIndividualsÿwithinÿclusters
    .ÿquietlyÿexpandÿ30

    .ÿ
    .ÿgenerateÿdoubleÿoutÿ=ÿrnormal(cid_u,ÿ1)

    .ÿ
    .ÿ//ÿWorkup
    .ÿquietlyÿmixedÿoutÿi.trtÿ||ÿcid:ÿ,ÿremlÿdfmethod(satterthwaite)ÿnolrtestÿnolog

    .ÿ
    .ÿ//ÿExperimentalÿ-ÿReferenceÿversusÿPlaceboÿ-ÿReferenceÿ
    .ÿtestÿ2.trtÿ-ÿ0.trtÿ=ÿ1.trtÿ-ÿ0.trt,ÿsmall

    ÿ(ÿ1)ÿÿ-ÿ[out]1.trtÿ+ÿ[out]2.trtÿ=ÿ0

    ÿÿÿÿÿÿÿF(ÿÿ1,ÿ18.00)ÿ=ÿÿÿÿ0.13
    ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.7190

    .ÿ
    .ÿ//ÿExperimentalÿ-ÿPlacebo
    .ÿtestÿ2.trtÿ=ÿ1.trt,ÿsmall

    ÿ(ÿ1)ÿÿ-ÿ[out]1.trtÿ+ÿ[out]2.trtÿ=ÿ0

    ÿÿÿÿÿÿÿF(ÿÿ1,ÿ18.00)ÿ=ÿÿÿÿ0.13
    ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.7190

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    Anyway, to answer your question: you could use -simulate- calling a program that does just what is shown above each iteration. You'd set the parameters (sample size, standard deviations, mean group differences) as desired.

    Comment


    • #3
      Hi Joseph, thanks so much for this! Will try it out.

      Comment

      Working...
      X