Diff for "FAQ/power/owanova" - CBU statistics Wiki
location: Diff for "FAQ/power/owanova"
Differences between revisions 2 and 38 (spanning 36 versions)
Revision 2 as of 2006-08-31 11:00:10
Size: 1339
Editor: PeterWatson
Comment:
Revision 38 as of 2009-01-27 16:54:31
Size: 2224
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
This program uses R-squared, the multiple correlation, as the effect size, which may also be expressed as Cohen's f= R-sq/(1-R-sq) (see http://en.wikipedia.org/wiki/Effect_size#Cohen.27s_d) as an effect size in regressions including one-way anovas as a special case. This program uses R-squared, the multiple correlation, as the effect size, which may also be expressed as Cohen's f= R-sq/(1-R-sq) (see [http://en.wikipedia.org/wiki/Effect_size#Cohen.27s_d here]) as an effect size in regressions including one-way anovas as a special case.
Line 5: Line 5:
Alpha is the (two-tailed) type I error, g is the number of groups, ntot is the total sample size and r-sq is the multiple correlation. The program then outputs the power. From Cohen (1988) it follows R-squareds of 0.02, 0.13 and 0.26 are suggested conventions for small, medium and large effect sizes in regressions featuring continuous predictors. R-squareds of 0.01, 0.06 and 0.14 are the small, medium and large effect sizes for a one-way anova.
Line 8: Line 8:
Alpha is the type I error, df of the effect, dfe, is the total number of degrees of freedom for the effect of interest, df of confounders, dfc, is the total number of degrees of freedom of other predictors in the regression, ntot is the total sample size and rsq is the multiple correlation. The program then outputs the power. Power computation may also be done using a [attachment:reg.xls spreadsheet] or [http://www.danielsoper.com/statcalc/#c15 on-line calculator] or [:FAQ/powrsqR:in R.]


df for each predictor equals k -1 for a group predictor with k levels or 1 for each continuous predictor.
Line 10: Line 14:
Line 11: Line 16:
/alpha g ntot rsq. /alpha dfreg dfc ntot rsq.
Line 13: Line 18:
.05 3 40 0.3 .05 2 0 40 0.3
Line 18: Line 23:
compute g=make(1,1,0). compute dfreg=make(1,1,0).
compute dfc=make(1,1,0).
Line 22: Line 28:
compute g=m(:,2).
compute ntot=m(:,3).
compute rsq=m(:,4).
compute dfreg=m(:,2).
compute dfc=m(:,3
).
compute ntot=m(:,4).
compute rsq=m(:,5).
Line 26: Line 33:
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,G-1,NTOT-G),G-1,NTOT-G,NTOT*RSQ/(1-RSQ)). COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,DFREG,NTOT-DFREG-DFC-1),DFREG,NTOT-DFREG-DFC-1,NTOT*RSQ/(1-RSQ)).
Line 28: Line 35:
formats ntot (f7.0) alpha (f5.2) g (f5.2) rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /rsq 'R-squared' /power 'Power'.
formats ntot (f7.0) alpha (f5.2) dfreg (f5.2) dfc (f5.2) rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /dfreg 'Df effect' /dfc 'Df confounders' /rsq 'R-squared' /power 'Power'.
Line 31: Line 38:
  /variables=ntot alpha g rsq power
  /title "One way ANOVA power for given total sample size" .
  /variables=ntot alpha dfreg dfc rsq power
  /title "Power in a multiple regression for given total sample size" .

[ADJUST THE EXAMPLE INPUT AS DESIRED; THE COPY AND PASTE INTO A SPSS SYNTAX WINDOW AND RUN; OUTPUT BOTH TO SPREADSHEET AND OUTPUT WINDOW].

This program uses R-squared, the multiple correlation, as the effect size, which may also be expressed as Cohen's f= R-sq/(1-R-sq) (see [http://en.wikipedia.org/wiki/Effect_size#Cohen.27s_d here]) as an effect size in regressions including one-way anovas as a special case.

From Cohen (1988) it follows R-squareds of 0.02, 0.13 and 0.26 are suggested conventions for small, medium and large effect sizes in regressions featuring continuous predictors. R-squareds of 0.01, 0.06 and 0.14 are the small, medium and large effect sizes for a one-way anova.

Alpha is the type I error, df of the effect, dfe, is the total number of degrees of freedom for the effect of interest, df of confounders, dfc, is the total number of degrees of freedom of other predictors in the regression, ntot is the total sample size and rsq is the multiple correlation. The program then outputs the power. Power computation may also be done using a [attachment:reg.xls spreadsheet] or [http://www.danielsoper.com/statcalc/#c15 on-line calculator] or [:FAQ/powrsqR:in R.]

df for each predictor equals k -1 for a group predictor with k levels or 1 for each continuous predictor.

DATA LIST free
/alpha dfreg dfc ntot rsq. 
BEGIN DATA. 
.05 2 0 40  0.3
END DATA. 
matrix.
get m /variables=alpha g ntot rsq  /missing=omit.
compute alpha=make(1,1,0).
compute dfreg=make(1,1,0).
compute dfc=make(1,1,0).
compute ntot=make(1,1,0).
compute rsq=make(1,1,0).
compute alpha=m(:,1).
compute dfreg=m(:,2).
compute dfc=m(:,3).
compute ntot=m(:,4).
compute rsq=m(:,5).  
end matrix.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,DFREG,NTOT-DFREG-DFC-1),DFREG,NTOT-DFREG-DFC-1,NTOT*RSQ/(1-RSQ)).
EXE.
formats ntot (f7.0) alpha (f5.2) dfreg (f5.2) dfc (f5.2) rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /dfreg 'Df effect' /dfc 'Df confounders' /rsq 'R-squared' /power 'Power'.
report format=list automatic align(center)
  /variables=ntot alpha dfreg dfc rsq power 
  /title "Power in a multiple regression for given total sample size" .

None: FAQ/power/owanova (last edited 2013-05-31 11:02:04 by PeterWatson)