Diff for "FAQ/power/rmPow" - CBU statistics Wiki
location: Diff for "FAQ/power/rmPow"
Differences between revisions 1 and 37 (spanning 36 versions)
Revision 1 as of 2006-10-03 11:14:59
Size: 192
Editor: PeterWatson
Comment:
Revision 37 as of 2008-09-25 09:07:55
Size: 3004
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)

 * 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)}}$$
Line 3: Line 9:
 1. [:FAQ/power/rmPow/bpow: Power for anova term involving only between subject factors] 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.]
Line 5: Line 11:
 1. [:FAQ/power/rmPow/wpow: Power for anova term involving at least one within subject factor] 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) = df of term of interest= $$ \prod_{\mbox{factors}} $$ (number of levels of factor -1) in term of interest

 * bsum = sum of dfs involving '''only''' between subject factors in 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.

 * wdf = 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
 
 * corr is the average correlation between levels of the repeated measures (=0 if no within subjects factors)

 * 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 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" .
}}}
  • 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) = df of term of interest= $$ \prod_{\mbox{factors}} $$ (number of levels of factor -1) in term of interest
  • bsum = sum of dfs involving only between subject factors in 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.

  • wdf = 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
  • corr is the average correlation between levels of the repeated measures (=0 if no within subjects factors)
  • 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 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" .

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