GET

  FILE='C:\Users\HP\Desktop\niips\spss_prc\meta\ttest\Example.sav'.

DATASET NAME DataSet1 WINDOW=FRONT.

* Encoding: UTF-8.

************************************************************************

*** T Test: Measures of Effect Size and Nonoverlap, and Observed Power

*** Valentim R. Alferes (University of Coimbra, Portugal)

*** valferes@fpce.uc.pt

**

** This syntax does a T Test for two independent groups and calculates

** measures of effect size, measures of nonoverlap, and observed power.

**

** The output is divided into four parts:

**

** PART I - SPSS T Test standard output:

** - Descriptive statistics;

** - Levene's Test for Equality of Variances

** - T-Test for Equality of Means (Equal variances assumed

**   and not assumed);

** - Confidence Interval of the Difference.

**

** PART II - Measures of effect size:

** - Cohen's d (D);

** - Hedges Correction (D_H);

** - r point biserial (R);

** - Squared r point biserial (R2);

** - Binomial Effect Size Display (BESD_LO and BESD_UP).

**

** PART III - Measures of nonoverlap (Cohen, 1988, pp. 21-23):

** - U1 (percent of nonoverlap between the two distributions);

** - U2 (the highest percent in Group 1 that exceds the same lowest

**   percent in Group 2);

** - U3 (percentile standing = percentile of the Group 2 distribution

**   corresponding to the 50th percentile of Group 1 distribution).

**

** PART IV - Observed power (for algorithm, see Borenstein et al., 2001):

** - N1, N2, Harmonic N (N_HARM);

** - Alfa (ALFA) and observed power (OPOWER).

**

** The user has two methods: Analysing raw data or reproducing the SPSS

** T Test standard output from summary statistics in published articles.

 

************************************************************************

 

** METHOD 1: Analysing raw data.

 

** The data have to be in a SPSS active file with the following

** two numeric variables:

** IV – Independent variable (1 = Group 1; 2 = Group 2):

** DV – Dependent variable.

 

* Enter confidence level for confidence interval of difference

* (by default, confidence level = .95).

T-TEST GROUPS=IV(1 2)/VARIABLES=DV/CRITERIA=CIN(.95).

 

 

T-Test

 

 

 

 

 

Group Statistics

 

IV Independent Variable

N

Mean

Std. Deviation

Std. Error Mean

DV Dependent Variable

1 Group 1

10

12.60

2.797

.884

2 Group 2

10

10.40

3.718

1.176

 

 

Independent Samples Test

 

Levene's Test for Equality of Variances

t-test for Equality of Means

F

Sig.

t

df

Sig. (2-tailed)

Mean Difference

Std. Error Difference

95% Confidence Interval of the Difference

Lower

Upper

DV Dependent Variable

Equal variances assumed

1.714

.207

1.495

18

.152

2.200

1.471

-.891

5.291

Equal variances not assumed

 

 

1.495

16.716

.153

2.200

1.471

-.908

5.308

 

 

 

 

 

 

AGGREGATE/OUTFILE=*/BREAK=iv/m2=MEAN(dv)/dp2=SD(dv)/n2=N.

COMPUTE N1=LAG(N2,1).

COMPUTE M1=LAG(M2,1).

COMPUTE DP1=LAG(DP2,1).

EXECUTE.

SELECT IF(IV=2).

EXECUTE.

 

* Enter alfa for calculating observed power (by default, ALFA = 0.05).

COMPUTE ALFA = 0.05.

COMPUTE SP2=(((N1-1)*(DP1**2))+((N2-1)*(DP2**2)))/(N1+N2-2).

COMPUTE T=(M1-M2)/SQR(SP2*((1/N1)+(1/N2))).

COMPUTE GL=N1+N2-2.

COMPUTE R=T/SQR((T**2)+GL).

COMPUTE R2=R**2.

COMPUTE D=T*SQR((1/N1)+(1/N2)).

COMPUTE D_H=D*(1-(3/(4*(N1+N2)-9))).

COMPUTE BESD_LO=.50-(R/2).

COMPUTE BESD_UP=.50+(R/2).

COMPUTE U3=CDF.NORMAL(D,0,1)*100.

COMPUTE U2=CDF.NORMAL((D/2),0,1)*100.

COMPUTE U2X=CDF.NORMAL((ABS(D)/2),0,1).

COMPUTE U1=(2*U2X-1)/U2X*100.

COMPUTE N_HARM=(2*N1*N2)/(N1+N2).

COMPUTE NCP=ABS((D*SQR(N_HARM))/SQR(2)).

COMPUTE T_ALPHA=IDF.T(1-ALFA/2,GL).

COMPUTE POWER1=1-NCDF.T(T_ALPHA,GL,NCP).

COMPUTE POWER2=1-NCDF.T(T_ALPHA,GL,-NCP).

COMPUTE OPOWER=POWER1+POWER2.

FORMATS ALL(F8.4) N1 N2(F8.0) U1 U2 U3(F8.1).

SUMMARIZE/TABLES=D D_H R R2 BESD_LO BESD_UP/FORMAT=NOLIST TOTAL

 /TITLE='PART II - Measures of Effect Size'/CELLS=FIRST.

 

 

 

PART II - Measures of Effect Size

First 

D

D_H

R

R2

BESD_LO

BESD_UP

.6688

.6405

.3324

.1105

.3338

.6662

 

 

PART III - Measures of Nonoverlap

First 

U1

U2

U3

41.5

63.1

74.8

 

 

PART IV - Observed Power

First 

N1

n2

N_HARM

ALFA

OPOWER

10

10

10.0000

.0500

.2936

 

 

 

************************************************************************.

************************************************************************

** Borenstein, M., Rothstein, H., & Cohen, J. (2001). SamplePower 2.0

**    [Computer Manual]. Chicago: SPSS Inc.

** Cohen, J. (1988). Statistical power analysis for the behavioral

**    sciences (2nd ed.). Hillsdale, NJ: Lawrence Erbaum.

************************************************************************.