Diff for "FAQ/power/rmPow" - CBU statistics Wiki
location: Diff for "FAQ/power/rmPow"
Differences between revisions 11 and 55 (spanning 44 versions)
Revision 11 as of 2006-12-06 13:11:33
Size: 1618
Editor: PeterWatson
Comment:
Revision 55 as of 2009-01-28 10:32:51
Size: 3568
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
 * alpha is likelihood of making a type I error (usually = 0.05) __Spreadsheet and SPSS macro inputs__
Line 3: Line 3:
 * etasq is partial eta-squared/100 so, for example, 5.9% = 0.059  * alpha is the likelihood of making a type I error (usually = 0.05)
Line 5: Line 5:
 * num(erator) is product over factors comprising term of interest of (numer of levels of factor -1)  * etasq is partial $$\eta^text{2}$$/100 so, for example, 5.9% = 0.059
Line 7: Line 7:
 * d1 is sum over the factors of (number of levels of '''between''' subject factor - 1) Partial $$\eta^text{2}$$ =
$$ \frac{\mbox{SS(effect)}}{\mbox{SS(effect) + SS(its error)}}$$
where SS represents the sum of squares associated with a particular term in the anova.
Line 9: Line 11:
 * d2 is product over the factors of (number of levels of '''within''' subject factor - 1) In other words, partial $$\eta^text{2}$$ represents the proportion of variance in outcome predicted by the effect after adjusting for other terms in the anova.
Click [attachment:etasqrp.pdf here] for further details on partial $$\eta^text{2}$$ and [attachment:etasq.pdf here.]
Line 11: Line 14:
 * ntot is the total sample size If the Sums of Squares are not available you can[:FAQ/power/rsqform: construct eta-squared].
Line 13: Line 16:
Power can also be computed using a [attachment:ao.xls spreadsheet.]  * num(erator) = df of term of interest = the product of the (number of levels of each factor -1) in term of interest
Line 15: Line 18:
[ COPY AND PASTE THE BOXED BELOW SYNTAX BELOW INTO A SPSS SYNTAX WINDOW AND RUN; ADJUST INPUT DATA AS REQUIRED]  * sum (B-1) = sum of dfs involving '''only''' between subject factors in the anova or zero otherwise. df = Product of number of levels minus 1 of each between subject factor in term of interest. e.g. For a three way interaction involving three between subject factors, abc, we sum the dfs of the six lower order combinations: ab, ac and bc, a, b and c to that of abc

 * Prod (W-1) = df of within subject effect if in term of interest or 1 otherwise. df = Product of number of levels minus 1 of each within subject factor in term of interest


 * Prod W = The product of all the ithin subject levels in term of interest
 
 * corr is the average correlation between levels of the repeated measures (=0 if no within subjects factors)

 * Total sample size

[:FAQ/power/powexampleN: Example input]

Power can be computed using an EXCEL [attachment:aovp.xls spreadsheet] or the SPSS syntax below. Power analysis software using Winer (1991, pp 136-138) for balanced anovas may be downloaded from [http://www.soton.ac.uk/~cpd/anovas/datasets/ here] with details of how to compute inputs [:FAQ/Doncaster: here.]

[ COPY AND PASTE THE SYNTAX IN THE BOX BELOW INTO A SPSS SYNTAX WINDOW AND RUN; ADJUST INPUT DATA AS REQUIRED]
Line 19: Line 37:
/alpha etasq num d1 d2 ntot.
BEGIN DATA.
.05 0.02 2 3 2 58

.05 0.12 2 3 2 58
/alpha num bsum wdf corr ntot rsq.
BEGIN DATA.
.05 2 1 2 0.0 60 0.0588
.05
2 1 2 0.3 67 0.0588
Line 26: Line 44:
get m /variables=alpha etasq num d1 d2 ntot /missing=omit. get m /variables=alpha num bsum wdf corr ntot rsq /missing=omit.
Line 28: Line 46:
compute etasq=make(1,1,0).
Line 30: Line 47:
compute d1=make(1,1,0).
compute d2=make(1,1,0).
compute bsum=make(1,1,0).
compute wdf=make(1,1,0).
compute corr=make(1,1,0).
Line 33: Line 51:
compute rsq=make(1,1,0).
Line 34: Line 53:
compute etasq=m(:,2).
compute num=m(:,3).
compute d1=m(:,4).
compute d2=m(:,5).
compute num=m(:,2).
compute bsum=m(:,3).
compute wdf=m(:,4).
compute corr=m(:,5).
Line 39: Line 58:
compute rsq=(m:,7).
Line 40: Line 60:
compute denom=(ntot-d1-1)*d2.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,denom*etasq/(1-etasq)).
compute denom = (ntot-1-bsum)*wdf.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,((NTOT-1-bsum)*wdf*RSQ/(1-RSQ))/(1-corr)).
Line 43: Line 63:
formats alpha (f5.2) num (f5.2) denom (f5.2) etasq (f5.2) power (f5.2).
variable labels ntot 'Total Sample' /alpha 'Alpha' /num 'Numerator F' /denom 'Denominator F' /etasq 'Partial Eta-Sq' /power 'Power'.
formats ntot (f7.0) alpha (f5.2) num (f5.2) denom (f5.2) corr
 (f5.2)r
sq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /num 'Numerator F' /denom 'Denominator F' /corr 'Correlation' /rsq 'R-squared' /power 'Power'.
Line 46: Line 67:
  /variables=ntot alpha num denom etasq power
  /title "ANOVA power (any anova)" .
  /variables=ntot alpha num denom corr rsq power
  /title "ANOVA power, between subjects factor possibly in a mixed design for given total sample size" .
Line 49: Line 70:

__Reference__

Doncaster CP and Davey AJH (2007) Analysis of covariance. How to choose and construct models for the life sciences. CUP:Cambridge.

Winer BJ, Brown DR and Michels KM (1991) Statistical principles in experimental design, 3rd edition. McGraw-Hill:New York.

Spreadsheet and SPSS macro inputs

  • alpha is the likelihood of making a type I error (usually = 0.05)
  • etasq is partial $$\eta^text{2}$$/100 so, for example, 5.9% = 0.059

Partial $$\eta^text{2}$$ = $$ \frac{\mbox{SS(effect)}}{\mbox{SS(effect) + SS(its error)}}$$ where SS represents the sum of squares associated with a particular term in the anova.

In other words, partial $$\eta^text{2}$$ represents the proportion of variance in outcome predicted by the effect after adjusting for other terms in the anova. Click [attachment:etasqrp.pdf here] for further details on partial $$\eta^text{2}$$ and [attachment:etasq.pdf here.]

If the Sums of Squares are not available you can[:FAQ/power/rsqform: construct eta-squared].

  • num(erator) = df of term of interest = the product of the (number of levels of each factor -1) in term of interest
  • sum (B-1) = sum of dfs involving only between subject factors in the anova or zero otherwise. df = Product of number of levels minus 1 of each between subject factor in term of interest. e.g. For a three way interaction involving three between subject factors, abc, we sum the dfs of the six lower order combinations: ab, ac and bc, a, b and c to that of abc

  • Prod (W-1) = df of within subject effect if in term of interest or 1 otherwise. df = Product of number of levels minus 1 of each within subject factor in term of interest
  • Prod W = The product of all the ithin subject levels in term of interest
  • corr is the average correlation between levels of the repeated measures (=0 if no within subjects factors)
  • Total sample size

[:FAQ/power/powexampleN: Example input]

Power can be computed using an EXCEL [attachment:aovp.xls spreadsheet] or the SPSS syntax below. Power analysis software using Winer (1991, pp 136-138) for balanced anovas may be downloaded from [http://www.soton.ac.uk/~cpd/anovas/datasets/ here] with details of how to compute inputs [:FAQ/Doncaster: here.]

[ COPY AND PASTE THE SYNTAX IN THE BOX BELOW INTO A SPSS SYNTAX WINDOW AND RUN; ADJUST INPUT DATA AS REQUIRED]

DATA LIST free
/alpha num bsum wdf corr ntot rsq. 
BEGIN DATA. 
.05 2 1 2 0.0 60 0.0588
.05 2 1 2 0.3 67 0.0588
END DATA.
set errors=none. 
matrix.
get m /variables=alpha num bsum wdf corr ntot rsq  /missing=omit.
compute alpha=make(1,1,0).
compute num=make(1,1,0).
compute bsum=make(1,1,0).
compute wdf=make(1,1,0).
compute corr=make(1,1,0).
compute ntot=make(1,1,0).
compute rsq=make(1,1,0).
compute alpha=m(:,1).
compute num=m(:,2).
compute bsum=m(:,3).
compute wdf=m(:,4).
compute corr=m(:,5).
compute ntot=m(:,6).
compute rsq=(m:,7).  
end matrix.
compute denom = (ntot-1-bsum)*wdf.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,((NTOT-1-bsum)*wdf*RSQ/(1-RSQ))/(1-corr)).
EXE.
formats ntot (f7.0) alpha (f5.2) num (f5.2) denom (f5.2) corr
 (f5.2)rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /num 'Numerator F' /denom 'Denominator F' /corr 'Correlation' /rsq 'R-squared' /power 'Power'.
report format=list automatic align(center)
  /variables=ntot alpha num denom corr rsq power 
  /title "ANOVA power, between subjects factor possibly in a mixed design for given total sample size" .

Reference

Doncaster CP and Davey AJH (2007) Analysis of covariance. How to choose and construct models for the life sciences. CUP:Cambridge.

Winer BJ, Brown DR and Michels KM (1991) Statistical principles in experimental design, 3rd edition. McGraw-Hill:New York.

None: FAQ/power/rmPow (last edited 2013-03-08 10:18:01 by localhost)