Diff for "FAQ/power/owanova" - CBU statistics Wiki
location: Diff for "FAQ/power/owanova"
Differences between revisions 6 and 7
Revision 6 as of 2006-10-18 14:17:04
Size: 1604
Editor: PeterWatson
Comment:
Revision 7 as of 2006-10-19 09:23:02
Size: 1618
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
Alpha is the type I error, g is the number of groups in a (between subjects) one-way anova or, alternatively, the number of predictor variables in a multiple regression, ntot is the total sample size and rsq is the multiple correlation. The program then outputs the power. Alpha is the type I error, g is the number of groups in a (between subjects) one-way anova or, alternatively, one more than the number of predictor variables in a multiple regression, ntot is the total sample size and rsq is the multiple correlation. The program then outputs the power.

[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) as an effect size in regressions including one-way anovas as a special case.

From Cohen(1977, 1992) it follows R-squareds of 0.01, 0.0588 and 0.138 are suggested conventions for small, medium and large effect size.

Alpha is the type I error, g is the number of groups in a (between subjects) one-way anova or, alternatively, one more than the number of predictor variables in a multiple regression, ntot is the total sample size and rsq is the multiple correlation. The program then outputs the power.

DATA LIST free
/alpha g ntot rsq. 
BEGIN DATA. 
.05 3 40  0.3
END DATA. 
matrix.
get m /variables=alpha g ntot rsq  /missing=omit.
compute alpha=make(1,1,0).
compute g=make(1,1,0).
compute ntot=make(1,1,0).
compute rsq=make(1,1,0).
compute alpha=m(:,1).
compute g=m(:,2).
compute ntot=m(:,3).
compute rsq=m(:,4).  
end matrix.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,G-1,NTOT-G),G-1,NTOT-G,NTOT*RSQ/(1-RSQ)).
EXE.
formats ntot (f7.0) alpha (f5.2) g (f5.2) rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /g 'Number of Groups' /rsq 'R-squared' /power 'Power'.
report format=list automatic align(center)
  /variables=ntot alpha g rsq power 
  /title "One way ANOVA power for given total sample size" .

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