Announcement

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

  • Difference between sampsi, pre() and power repeated

    Dear Statalist,

    I'm wishing to calculate a sample size based on the comparison of means between two groups, adjusting for a baseline measure, i.e. using an ANCOVA

    I used to do this with sampsi, but power is now the recommended alternative. I do not seem to be getting the same answer if I use "sampsi" with the pre() argument or if I use "power repeated". I show some example code below. Any assistance for where I'm going wrong or have misunderstood the power repeated command would be much appreciated.

    Code:
    ** Using Stata 15.1
    
    ** Say I had two groups, with means 0.74 at baseline (in both groups) and SD=0.18 (again in both groups)
    ** At follow-up, we wish to calculate the sample size based on a change in the means to 0.76 and 0.74 for the two groups
    ** The correlation between baseline and follow-up measures is 0.5
    
    ** For 80% power, alpha=0.05, using the pre(1) argument to specify 1 baseline measure
    sampsi 0.76 0.74, sd(0.18) power(0.8) pre(1) r01(0.5) 
    ** This gives the following answers: POST 1,272 per group, CHANGE 1,272 per group, ANCOVA 954 per group
    
    ** If I try and use the power repeated command I get a very different answer that does not correspond with any of the three analyses above.
    matrix M = (0.74, 0.76 \ 0.74, 0.74)
    power repeated M, power(0.8) corr(0.5) varerror(0.0324) factor(between)
    ** 3,816 per group
    
    
    ** Furthermore, if I set the correlation between the baseline and follow-up measures to zero I thought I might get the same sample size using a power twomeans calculation as using ANCOVA
    ** using sampsi
    sampsi 0.76 0.74, sd(0.18) power(0.8) pre(1) r01(0)  
    ** 1272 per group using ANCOVA
    
    ** using power twomeans
    power twomeans 0.76 0.74, sd(0.18) power(0.8) 
    ** 1273 per group -- this agrees with sampsi, pre() above
    
    ** using power repeated
    matrix M = (0.74, 0.76 \ 0.74, 0.74)
    power repeated M, corr(0) varerror(0.0324) factor(between)
    ** 2544 per group



Working...
X