Announcement

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

  • Sample size calculation for difference in correlation coefficients

    I am comparing correlations using two different versions of a DV in the same subjects (testing the effect of the DV corrected for volume differences versus the raw DV in a PET neuroimaging analysis). The confidence intervals for the correlations do not overlap and the z-tests are not significant but I'm wondering if they would be in a larger sample. How do I use STATA to run a sample size calculation for a difference in correlation coefficients in the same sample? I found partial info for running it in XLSTAT but I already have STATA and I'd rather not be running analyses in Excel if I can help it. Many thanks!

  • #2
    Welcome to the Stata Forum / Statalist.

    I wonder whether the aptly named - power twocorrelations - command is what you wish.

    Below, and example with 2 correlations, or the difference between one and the other, with identical results.

    Code:
    . power twocorrelations 0.67 0.80
    
    Performing iteration ...
    
    Estimated sample sizes for a two-sample correlations test
    Fisher's z test
    Ho: r2 = r1  versus  Ha: r2 != r1
    
    Study parameters:
    
            alpha =    0.0500
            power =    0.8000
            delta =    0.1300
               r1 =    0.6700
               r2 =    0.8000
    
    Estimated sample sizes:
    
                N =       386
      N per group =       193
    
    . power twocorrelations 0.67, diff(0.13)
    
    Performing iteration ...
    
    Estimated sample sizes for a two-sample correlations test
    Fisher's z test
    Ho: r2 = r1  versus  Ha: r2 != r1
    
    Study parameters:
    
            alpha =    0.0500
            power =    0.8000
            delta =    0.1300
               r1 =    0.6700
               r2 =    0.8000
             diff =    0.1300
    
    Estimated sample sizes:
    
                N =       386
      N per group =       193
    Hopefully that helps.
    Best regards,

    Marcos

    Comment


    • #3
      Thanks. I did know about that one but it doesn't apply to my situation. I'm not running an independent samples test. My IV is age (in the same subjects) and I have two versions of a single DV (dopamine binding potential) that is calculated different ways.

      Comment


      • #4
        You could use simulation with whatever test you used above to compare them. Or you could standardize the three variables to mean zero and SD 1, and then use mvreg. Then lincom of the difference in the regression coefficients will give you a Wald test statistic (in the form of a Student's t), and you could use its standard error of the difference in a power analysis.
        Code:
        foreach var of varlist y1 y2 age {
            quietly summarize `var'
            generate double s`var' = (`var' - r(mean)) / r(sd)
        }
        mvreg sy1 sy2 = c.sage
        lincom _b[sy1:sage] - _b[sy2:sage]

        Comment

        Working...
        X