Diff for "FAQ/power/rmPow" - CBU statistics Wiki
location: Diff for "FAQ/power/rmPow"
Differences between revisions 32 and 34 (spanning 2 versions)
Revision 32 as of 2008-09-24 16:08:48
Size: 2818
Editor: PeterWatson
Comment:
Revision 34 as of 2008-09-24 16:14:33
Size: 2759
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
 * d1 = $$\sum_{i}^{B} (b_{i} - 1) + \prod_{\mbox{combinations}} (b_{i} - 1)$$ if B > 0 in anova  * bsum = sum of dfs of between subject factors = $$\sum_{i}^{B} (b_{i} - 1) + \prod_{\mbox{combinations}} (b_{i} - 1)$$ if B > 0 in anova
Line 22: Line 22:
 * d2 = $$ \prod_{j}^{W} (w_{j} - 1) $$ if W > 0 in term of interest  * wdf = df of the within subject factor term (if any) in term of interest = $$ \prod_{j}^{W} (w_{j} - 1) $$ if W > 0 in term of interest
Line 24: Line 24:

 * prod = number of combinations of levels of within subject factors in term of interest (= 1 if no within subjects factors in term of interest)
Line 31: Line 29:
Power can be computed using an EXCEL [attachment:aovp.xls spreadsheet] or the SPSS syntax below. Power can be computed using an EXCEL [attachment:aov.xls spreadsheet] or the SPSS syntax below.
Line 37: Line 35:
/alpha num d1 d2 prod ntot rsq. /alpha num bsum wdf ntot rsq.
Line 39: Line 37:
.05 2 1 2 3 60 0.0588
.05 2 1 2 3 67 0.0588
.05 2 1 2 60 0.0588
.05 2 1 2 67 0.0588
Line 44: Line 42:
get m /variables=alpha num d1 d2 prod ntot rsq /missing=omit. get m /variables=alpha num bsum wdf ntot rsq /missing=omit.
Line 47: Line 45:
compute d1=make(1,1,0).
compute d2=make(1,1,0).
compute prod=make(1,1,0).
compute bsum=make(1,1,0).
compute wdf=make(1,1,0).
Line 60: Line 57:
compute denom = (ntot-1-d1)*d2.
COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,NTOT*prod*RSQ/(1-RSQ)).
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)).
  • alpha is 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)}}$$

or, in other words, the proportion of variance in outcome predicted by the effect after adjusting for other terms in the anova. [attachment:etasqrp.pdf Click 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].

For B between subject factors in term of interest with levels $$b_{i}$$, i=1, ..., B and W with subject factors in term of interest with levels $$w_{j}$$, j=1, ..., W

  • num(erator) = $$ \prod_{\mbox{factors}} $$ (number of levels of factor -1) in term of interest
  • bsum = sum of dfs of between subject factors = $$\sum_{i}^{B} (b_{i} - 1) + \prod_{\mbox{combinations}} (b_{i} - 1)$$ if B > 0 in anova

    • = 0 otherwise

where combinations means all lower order combinations of at least two between subject factors making up the factor of interest. e.g. abc has lower order combinations combinations ab, ac and bc.

  • wdf = df of the within subject factor term (if any) in term of interest = $$ \prod_{j}^{W} (w_{j} - 1) $$ if W > 0 in term of interest

    • = 1 otherwise
  • ntot is the total sample size

[:FAQ/power/powexampleN: Example input]

Power can be computed using an EXCEL [attachment:aov.xls spreadsheet] or the SPSS syntax below.

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

DATA LIST free
/alpha num bsum wdf ntot rsq. 
BEGIN DATA. 
.05 2 1 2 60  0.0588
.05 2 1 2 67  0.0588
END DATA.
set errors=none. 
matrix.
get m /variables=alpha num bsum wdf 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 ntot=make(1,1,0).
compute rsq=make(1,1,0).
compute alpha=m(:,1).
compute num=m(:,2).
compute d1=m(:,3).
compute d2=m(:,4).
compute prod=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)).
EXE.
formats ntot (f7.0) alpha (f5.2) num (f5.2) denom (f5.2) rsq (f5.2) power (f5.2).
variable labels ntot 'Total Sample Size' /alpha 'Alpha' /num 'Numerator F' /denom 'Denominator F' /rsq 'R-squared' /power 'Power'.
report format=list automatic align(center)
  /variables=ntot alpha num denom rsq power 
  /title "ANOVA power, between subjects factor possibly in a mixed design for given total sample size" .

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