Size: 1619
Comment:
|
Size: 1934
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
* num(erator) is product over factors comprising term of interest of (numer of levels of factor -1) | For B between subject factors with levels $$b_{i}$$, i=1, ..., B and W with subject factors with levels $$w_{i}$$, j=1, ..., W |
Line 7: | Line 7: |
* d1 is sum over the factors of (number of levels of '''between''' subject factor - 1) | * num(erator) = $$ \prod_{\mbox{factors}} $$ (number of levels of factor -1) in term of interest |
Line 9: | Line 9: |
* d2 is product over the factors of (number of levels of '''within''' subject factor - 1) | * d1 = $$\sum_{i}^{B} (b_{i} - 1) $$ if B > 0 in anova = 0 otherwise |
Line 11: | Line 13: |
* d2 = $$ \prod_{j} (w_{j} - 1) $$ if W > 0 in term of interest = 1 otherwise * prod = number of combinations of within subject factors |
|
Line 13: | Line 20: |
Power can also be computed using a [attachment:aov.xls spreadsheet.] | Power can also be computed using a [attachment:ao.xls spreadsheet.] |
Line 19: | Line 26: |
/alpha etasq num d1 d2 ntot. BEGIN DATA. .05 0.02 2 3 2 58 .05 0.12 2 3 2 58 |
/alpha num d1 d2 prod ntot rsq. BEGIN DATA. .05 2 1 2 3 60 0.0588 .05 2 1 2 3 67 0.0588 |
Line 26: | Line 33: |
get m /variables=alpha etasq num d1 d2 ntot /missing=omit. | get m /variables=alpha num d1 d2 prod ntot rsq /missing=omit. |
Line 28: | Line 35: |
compute etasq=make(1,1,0). | |
Line 32: | Line 38: |
compute prod=make(1,1,0). | |
Line 33: | Line 40: |
compute rsq=make(1,1,0). | |
Line 34: | Line 42: |
compute etasq=m(:,2). compute num=m(:,3). compute d1=m(:,4). compute d2=m(:,5). |
compute num=m(:,2). compute d1=m(:,3). compute d2=m(:,4). compute prod=m(:,5). |
Line 39: | Line 47: |
compute rsq=(m:,7). | |
Line 40: | Line 49: |
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-d1)*d2. COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,NTOT*prod*RSQ/(1-RSQ)). |
Line 43: | Line 52: |
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) 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'. |
Line 46: | Line 55: |
/variables=ntot alpha num denom etasq power /title "ANOVA power (any anova)" . |
/variables=ntot alpha num denom 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-squared/100 so, for example, 5.9% = 0.059
For B between subject factors with levels $$b_{i}$$, i=1, ..., B and W with subject factors with levels $$w_{i}$$, j=1, ..., W
- num(erator) = $$ \prod_{\mbox{factors}} $$ (number of levels of factor -1) in term of interest
d1 = $$\sum_{i}^{B} (b_{i} - 1) $$ if B > 0 in anova
- = 0 otherwise
d2 = $$ \prod_{j} (w_{j} - 1) $$ if W > 0 in term of interest
- = 1 otherwise
- prod = number of combinations of within subject factors
- ntot is the total sample size
Power can also be computed using a [attachment:ao.xls spreadsheet.]
[ 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 d1 d2 prod ntot rsq. BEGIN DATA. .05 2 1 2 3 60 0.0588 .05 2 1 2 3 67 0.0588 END DATA. set errors=none. matrix. get m /variables=alpha num d1 d2 prod ntot rsq /missing=omit. compute alpha=make(1,1,0). compute num=make(1,1,0). compute d1=make(1,1,0). compute d2=make(1,1,0). compute prod=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-d1)*d2. COMPUTE power = 1 - NCDF.F(IDF.F(1-ALPHA,num,denom),num,denom,NTOT*prod*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" .