Announcement

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

  • sample size calculation when there are three groups



    Hi,
    We are planning to conduct an RCT comparing nitroglycerine patches to decrease the failure rates of radial arterial cannulation. Based on our audit, we expect a 30% failure rate in the placebo arm. We hypothesize that the NTG patch applied for 30 or 45 minutes could reduce the incidence of failure rate by 30%, which corresponds to a 9% absolute risk difference. We want to assume a type I error of 5% and aim for a power of 80%. How much sample size is needed per group?
    Since there are three independent groups (placebo, NTG for 30 minutes, NTG for 45 minutes), I am unable to calculate it on Stata.

  • #2
    You can use simulation in order to get an estimate of sample size based upon your assumptions. See below for output and power analysis graphs for an example of the technique.

    In the example, risk difference (a reduction of the thirty-percent placebo failure rate by nine percentage points in the "high group") is modeled using a so-called linear probability model. You can also try using a risk-ratio regression model (using glm) or a logistic regression model (using, for example, logit), but I expect that they will give similar estimates of sample size.

    One assumption that's important, and that you haven't specified, is where the "middle group" (half-hour exposure to nitroglycerin patch) lies between the placebo-treatment (which I guess is a sham patch applied for three-quarters of an hour) and the "high group" (longest exposure to the nitroglycerin patch). In the final section of the output, I show how the location of your middle treatment group's assumed response relative to that of the "high group" affects the overall power of the risk-difference regression model. (The sample size estimate in the first section of the output assumes the worst-case location for the efficacy of the "middle group".)

    You'll need to explore where the worst case of the assumed effect for the "middle group" lies if you use a different likelihood for your regression model, that is, the worst-case location for the risk-difference likelihood is halfway between the placebo and "high group", which is the same as for other linear models such as ANOVA, but its relative locatioin might be different for a risk-ratio or logistic regression model.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿ//ÿseedem
    .ÿsetÿseedÿ11514432

    .ÿ
    .ÿprogramÿdefineÿsimEm,ÿrclass
    ÿÿ1.ÿÿÿÿÿversionÿ17.0
    ÿÿ2.ÿÿÿÿÿsyntaxÿ,ÿ[n(intÿ1200)ÿDelta(intÿ9)ÿMid(intÿ50)]
    ÿÿ3.ÿ
    .ÿ
    .ÿÿÿÿÿdropÿ_all
    ÿÿ4.ÿÿÿÿÿsetÿobsÿ`n'
    ÿÿ5.ÿÿÿÿÿ
    .ÿÿÿÿÿgenerateÿbyteÿtrtÿ=ÿmod(_n,ÿ3)
    ÿÿ6.ÿÿÿÿÿgenerateÿdoubleÿprbÿ=ÿ30
    ÿÿ7.ÿÿÿÿÿreplaceÿprbÿ=ÿ30ÿ-ÿ`delta'ÿ*ÿ`mid'ÿ/ÿ100ÿifÿtrtÿ==ÿ1
    ÿÿ8.ÿÿÿÿÿreplaceÿprbÿ=ÿ30ÿ-ÿ`delta'ÿifÿtrtÿ==ÿ2
    ÿÿ9.ÿ
    .ÿÿÿÿÿgenerateÿbyteÿfaiÿ=ÿrbinomial(1,ÿprbÿ/ÿ100)
    ÿ10.ÿ
    .ÿÿÿÿÿregressÿfaiÿi.trt,ÿvce(hc3)
    ÿ11.ÿÿÿÿÿtestparmÿi.trt
    ÿ12.ÿÿÿÿÿreturnÿscalarÿpÿ=ÿr(p)
    ÿ13.ÿend

    .ÿ
    .ÿ//ÿPower
    .ÿframeÿcreateÿPowerÿintÿNÿdoubleÿpow

    .ÿ
    .ÿforvaluesÿNÿ=ÿ1200(42)1448ÿ{
    ÿÿ2.ÿÿÿÿÿlocalÿNÿ=ÿ`N'ÿ+ÿ3ÿ-ÿmod(`N',ÿ3)
    ÿÿ3.ÿÿÿÿÿquietlyÿsimulateÿpÿ=ÿr(p),ÿreps(3000)ÿnodots:ÿsimEmÿ,ÿn(`N')
    ÿÿ4.ÿÿÿÿÿassertÿ!mi(p)
    ÿÿ5.ÿÿÿÿÿgenerateÿbyteÿposÿ=ÿpÿ<ÿ0.05
    ÿÿ6.ÿÿÿÿÿsummarizeÿpos,ÿmeanonly
    ÿÿ7.ÿÿÿÿÿframeÿpostÿPowerÿ(`N')ÿ(r(mean))
    ÿÿ8.ÿ}

    .ÿ
    .ÿcwfÿPower

    .ÿgraphÿtwowayÿlineÿpowÿN,ÿsortÿlcolor(black)ÿ///
    >ÿÿÿÿÿyline(0.80,ÿlcolor(black)ÿlpattern(dash))ÿ///
    >ÿÿÿÿÿytitle(Power)ÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
    >ÿÿÿÿÿÿÿÿÿxtitle(TotalÿN)

    .ÿquietlyÿgraphÿexportÿPower.png,ÿreplace

    .ÿ
    .ÿquietlyÿregressÿpowÿc.N

    .ÿlocalÿNÿ=ÿ(0.8ÿ-ÿ_b[_cons])ÿ/ÿ_b[N]

    .ÿlocalÿNÿ=ÿ`N'ÿ+ÿ3ÿÿ-ÿmod(`N',ÿ3)

    .ÿdisplayÿinÿsmclÿasÿtextÿ"Sampleÿsizeÿestimateÿ(total)ÿ=ÿ"ÿasÿresultÿ`N'
    Sampleÿsizeÿestimateÿ(total)ÿ=ÿ1353

    .ÿdisplayÿinÿsmclÿasÿtextÿ"Sampleÿsizeÿestimateÿ(perÿgroup)ÿ=ÿ"ÿasÿresultÿ`N'ÿ/ÿ3
    Sampleÿsizeÿestimateÿ(perÿgroup)ÿ=ÿ451

    .ÿ
    .ÿ//ÿTestÿsize
    .ÿcwfÿdefault

    .ÿquietlyÿsimulateÿpÿ=ÿr(p),ÿreps(1000)ÿnodots:ÿsimEmÿ,ÿn(`N')ÿd(0)

    .ÿassertÿ!mi(p)

    .ÿgenerateÿbyteÿposÿ=ÿpÿ<ÿ0.05

    .ÿsummarizeÿpos,ÿmeanonly

    .ÿdisplayÿinÿsmclÿasÿtextÿ"Testÿsizeÿ=ÿ"ÿasÿresultÿ%04.2fÿr(mean)
    Testÿsizeÿ=ÿ0.05

    .ÿ
    .ÿ//ÿMiddleÿgroup'sÿlocation
    .ÿframeÿcreateÿMiddleÿintÿpctÿdoubleÿpow

    .ÿ
    .ÿforvaluesÿmidÿ=ÿ0(25)100ÿ{
    ÿÿ2.ÿÿÿÿÿquietlyÿsimulateÿpÿ=ÿr(p),ÿreps(3000)ÿnodots:ÿsimEmÿ,ÿn(`N')ÿmid(`mid')
    ÿÿ3.ÿÿÿÿÿassertÿ!mi(p)
    ÿÿ4.ÿÿÿÿÿgenerateÿbyteÿposÿ=ÿpÿ<ÿ0.05
    ÿÿ5.ÿÿÿÿÿsummarizeÿpos,ÿmeanonly
    ÿÿ6.ÿÿÿÿÿframeÿpostÿMiddleÿ(`mid')ÿ(r(mean))
    ÿÿ7.ÿ}

    .ÿ
    .ÿcwfÿMiddle

    .ÿquietlyÿreplaceÿpctÿ=ÿ100ÿ-ÿpct

    .ÿgraphÿtwowayÿlineÿpowÿpct,ÿsortÿlcolor(black)ÿ///
    >ÿÿÿÿÿytitle(Power)ÿylabel(ÿ,ÿformat(%04.2f)ÿangle(horizontal)ÿnogrid)ÿ///
    >ÿÿÿÿÿxtitle(MiddleÿGroup'sÿEfficacyÿRelativeÿtoÿHighÿGroup'sÿ(%))ÿxlabel(0(25)100)

    .ÿquietlyÿgraphÿexportÿMiddle.png,ÿreplace

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Click image for larger version

Name:	Power.png
Views:	1
Size:	23.9 KB
ID:	1688306


    Click image for larger version

Name:	Middle.png
Views:	1
Size:	27.5 KB
ID:	1688307

    Comment


    • #3
      Thanks Joseph, that's fantastic. Our assumption is that the middle group (NTG for 30 minutes) will result in a reduction in failure rates by 15%. I have Stata 16 and use drop-down menus on Stata to do my analyses. Is it possible to get these results by clicking the drop-down menu boxes? Regards

      Comment


      • #4
        Joseph has given you excellent advice and simulation code (as always).

        Out of curiosity, won't you have a problem with bias since it appears like one of your treatment groups will know to which group they have been assigned? For example, if your control group receives a sham patch for 45 minutes, then the middle group will know they have been given the low dosage.

        It seems to me that you have not clarified what it is precisely you want to test. In #1, I understood you have made an assumption that any nitroglycerin patch should yield an absolute risk reduction of 9 percentage points. This is still a 3 group design, but suggests that the primary inference is made by pooling both nitro groups together versus the control group. If a difference is found, then you could proceed to test individual nitro groups versus the control. But in #3, you seem to assume a lesser effect based on a lower dosage.

        Another possibility to consider is to reduce the problem again to a two independent group comparison. A common strategy is the power and design the study for the dosage of maximal effect -- high dose versus control -- with the logic being that if you can't detect an effect with the highest dose then the lower dose is irrelevant to examine. The primary analysis is based on this comparison only. Using a gatekeeping strategy will control type 1 error rates, in which you specify that you will only look at the contrast of the lower dose versus control if the primary analysis shows a statistical difference. The planned sample size for the middle dose commonly takes the same size as the high dose. The advantage is that it requires a smaller trial compared to the design proposed by Joseph, but the downside is that the lower dose arm will very likely be underpowered should there really be an effect at that dose.

        I'm not saying that one design is better or worse than the other, they each have their own trade-offs, and it is a matter of what exactly you want to focus on and to be able to test with your study.

        Comment


        • #5
          Originally posted by Shripada Rao View Post
          Is it possible to get these results by clicking the drop-down menu boxes?
          Not that I am aware of, no.

          Comment


          • #6
            Thank you Joseph and Leonardo. I apologize, there will be a sham patch at 30 minutes and 45 minutes.
            We are going by #1, i.e. any NTG patch should yield an absolute risk reduction of 9 points...
            We thought about the option of 2 independent groups, but it is not clear if a longer duration will lead to more success or if the effect of NTG will wear off by then. Hence, we need the 30-minute as well as the 45-minute group.

            Comment


            • #7
              Would you propose up examine differences between 30 and 45 minutes treatments? In that case, wouldn't you need to randomized to 2 sham and 2 nitroglycerin patch arms (one for 30 min and one for 45 min)?

              Comment


              • #8
                Yes, four groups: 30-min NTG, 30-min Sham, 45-min NTG, 45-min Sham

                Comment

                Working...
                X