Diff for "FAQ/power/pairn" - CBU statistics Wiki
location: Diff for "FAQ/power/pairn"
Differences between revisions 9 and 10
Revision 9 as of 2006-08-30 12:43:34
Size: 1566
Editor: PeterWatson
Comment:
Revision 10 as of 2006-08-30 12:46:48
Size: 1567
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Alpha is the (two-tailed) type I error, mdiff is the difference in group means, sd is the average group standard deviation with (common group)sample size inputted as n. The program then outputs the power. Alpha is the (two-tailed) type I error, mdiff is the difference in group means, sd is the average group standard deviation with (common group) sample size inputted as n. The program then outputs the power.

This program uses Cohen's d as the effect size as recommended by Dunlop, W. P., Cortina, J. M., Vaslow, J. B., & Burke, M. J. (1996) for a paired t-test.

Alpha is the (two-tailed) type I error, mdiff is the difference in group means, sd is the average group standard deviation with (common group) sample size inputted as n. The program then outputs the power.

Reference:

Dunlop, W. P., Cortina, J. M., Vaslow, J. B., & Burke, M. J. (1996). Meta-analysis of experiments with matched groups or repeated measures designs. Psychological Methods, 1, 170-177.

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

DATA LIST free
/alpha mdiff sd n rho. 
BEGIN DATA. 
.05 2.0 4.0 40  0.0
.05 2.0 4.0 40  0.3
END DATA. 

matrix.
get m /variables=alpha mdiff sd n rho  /missing=omit.
compute alpha=make(1,1,0).
compute mdiff=make(1,1,0).
compute sd=make(1,1,0).
compute n=make(1,1,0).
compute rho=make(1,1,0).
compute alpha=m(:,1).
compute mdiff=m(:,2).
compute sd=m(:,3).
compute n=m(:,4).  
compute rho=m(:,5).
end matrix.
COMPUTE power = 1 - NCDF.T(IDF.T(1-alpha/2,n+n-2),n+n-2,(mdiff)/SQRT((2*sd*sd/n)*(1-rho))).
exe.
formats n (f7.0) rho (f7.2) alpha (f5.2) mdiff (f5.2) sd (f5.2) power (f5.2).
variable labels n 'Sample Size 1' /rho 'Correlation' /alpha 'Alpha' /mdiff 'Mean Difference' /sd 'SD' /power 'Power'.
report format=list automatic align(center)
  /variables=n rho alpha mdiff sd power 
  /title "Paired t-test power for given sample size" .

None: FAQ/power/pairn (last edited 2013-03-08 10:17:36 by localhost)