## calculating effect sizes

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

DML

### calculating effect sizes

Hello, I am using a much larger dataset (n=10,000) than I am used to, and am having trouble determining if SPSS can calculate effect sizes for the various analyses I am running. Where in SPSS can I compute effect sizes, or do I need to calculate these by hand? I need it for such analyses as ANOVA, correlations, linear regressions. Thanks. ANy help is greatly appreciated!
statman
Posts: 2760
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA
Not directly available in SPSS but can be done via syntax, below might be more than you want/need but here it is. Also check Developer Central at

Code: Select all

``http://www.spss.com/devcentral/``
*(Q) I have ran a series of t tests on groups with unequal ns and would like to
compute Cohen's d. I see that SPSS doesn't have option available. How do I
compute the ds from the given SPSS output? Is there a macro available?

*(A) Posted by Marta to SPSSX-L list on 2002/06/05; improved on 2004/10/08.

* I have updated a code I posted to the list 2 years ago. It
* calculates Glass, Hedges & Cohen standardised effect sizes, with their
* standard errors. These values are then added to the dataset.
* Marta 2004/10/08 mailto:biostatistics@terra.es

Cohen's d is simply=(mean1-mean2)/Sp.

Where Sp is the pooled standard deviation:

Sp=sqrt((n1-1)*var1+(n2-1)*var2)/(n1+n2-2)).

- var1=variance of sample 1 (Sd1^2)
- var2=variance of sample 2 (Sd2^2)

If the sample sizes in your study are small, then it's better to use an
unbiased estimator called Hedges' g:

hedges g=cohen&*(1-(3/(4*(n1+n2)-9)))

If variances are unequal, sometimes another standardized mean difference
is used, called

Glass' d=(mean1-mean2)/Sd2

(Sd2= standard deviation from control group).

You can get all the required information from the statistics table in
the output.

* Improved code *.

* Example dataset (replace by your own but keep variable names) *.
* Data for treatment group go first place, and control group 2nd.
DATA LIST LIST /test(A7) meantr sdtr(2F8.2) ntr(F8.0)
meanco sdco(2F8.2) nco(F8.0).
BEGIN DATA
1 35 9 17 24 8 18
2 43 10 15 37 7 16
3 40 2.3 18 32 2.54 19
END DATA.

* Analysis *.
MATRIX.
GET test /VAR=test.
GET mean1 /VAR=meantr.
GET sd1 /VAR=sdtr.
GET n1 /VAR=ntr.
GET mean2 /VAR=meanco.
GET sd2 /VAR=sdco.
GET n2 /VAR=nco.
PRINT {mean1,sd1,n1,mean2,sd2,n2}
/FORMAT='F8.1'
/TITLE='Original data'
/RNAMES=test
/CLABELS='Mean1','SD1','N1','Mean2','SD2','N2'.
COMPUTE n=n1+n2.
COMPUTE poolvar=((n1-1)&*(sd1&**2)+(n2-1)&*(sd2&**2))/(n-2) .
COMPUTE glass=(mean1-mean2)/sd2.
COMPUTE se_glass=SQRT((n/(n1&*n2))+((glass&**2)/(2&*(n2-1)))).
COMPUTE cohen=(mean1-mean2)/SQRT(poolvar).
COMPUTE se_cohen=SQRT((n/(n1&*n2))+((cohen&**2)/(2&*(n-2)))).
COMPUTE hedges=cohen&*(1-(3/(4&*(n)-9))).
COMPUTE se_hedge=SQRT((n/(n1&*n2))+((hedges&**2)/(2&*(n-3.94)))).
PRINT {glass,se_glass,cohen,se_cohen,hedges,se_hedge}
/FORMAT='F8.3'
/RNAMES=test
/CLABELS='Glass','SE(D)','Cohen','SE(d)','Hedges','SE(g)'
/TITLE='Standardized effects sizes'.
COMPUTE data={glass,se_glass,cohen,se_cohen,hedges,se_hedge}.
COMPUTE namevec={'glass','seglass','cohen','secohen','hedges','sehedges'}.
SAVE data /OUTFILE='c:\temp\data.sav' /NAMES=namevec.
END MATRIX.

MATCH FILES /FILE=*
/FILE='c:\temp\data.sav'.
EXECUTE.
[/u]
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
DML
Posts: 1
Joined: Tue Jun 19, 2007 5:50 pm
thanks for the help. That will be useful for the ANOVAs, but is there syntax for the correlations/regressions (i.e. when you are only using one population and not comparing multiple?). Thanks again
statman
Posts: 2760
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
jakekoi
Posts: 7
Joined: Thu Jul 24, 2008 8:09 am

Thanks a lot

### Who is online

Users browsing this forum: No registered users and 1 guest