Hi everybody:

I just came back from my classes and had a funny time witnessing all the

fuss about that code I wrote years ago. Some comments on it:

1) First of all, it was written as a simple exercise of programming, the

challenge of being able to mimic SPSS T test output with summary data. I

enjoyed it. Period.

2) Of course a hand calculator, Excel, or a cute little freeware program

called Simcalc (I recommend it to my sutdents) can be used for the task,

but this code was designed as a very simple tool for some people at the

Universitary Clinic of Navarra, who, while working as reviewers of

scientific papers, wanted sometimes to check the result of t test,

WITHOUT having to use a calculator (they are simply not in the mood of

playing with numbers by hand).

3) Although computing the t statistic is fairly easy (agreed),

remembering to compute also a homogeneity of variances (HOV) test, and

adjusting the degrees of freedom by Brown&Forsythe formula if HOV

condition is NOT as easy (I don't remember the formula by heart, for

instance).

4) I always tell my students that 95%CI are as important, or even MORE,

than simple p-values. If people is a bit lazy, the 95%CI will not be

computed by hand.

5) The code can be very easily modified to work with several rows of

data (see below). Perhaps my mistake when I first posted the code was

assuming that such a simple task was no challenge for any syntax writer,

even with no MACRO programming knowledge.

Modified code:

- First, save everything from MATRIX to END MATRIX to disc (I have used

'C:/Temp/MATRIX T Test.sps' as destination). Just before the last line,

I have added this line:

PRINT /TITLE='-------------------------------------'.

It has cosmetic purposes (separating one analysis from the next).

- Second, modify slightly the dataset (add a new variable called

'TestNr', and split the file by it):

data list list /TestNr(F8) mean1(f8.3) sd1(F8.3) n1(F8.0) mean2(f8.3)

sd2(F8.3) n2(F8.0).

begin data

1 187.643 38.098 14 235.929 54.286 14

2 187.643 38.098 20 235.929 54.286 20

3 187.643 38.098 10 235.929 54.286 10

4 187.643 38.098 45 235.929 54.286 45

end data.

SPLIT FILE SEPARATE BY TestNr.

- Now, include C:/Temp/MATRIX T Test.sps

INCLUDE FILE='C:/Temp/Matrix T Test.sps'.

- Finally, the last portion of the code (the report) is run, after

un-splitting the file:

* Computation of exact (non asymptotic) 95%CI for diff *.

SPLIT FILE OFF.

COMPUTE low1 = diff -eedif1* IDF.T(0.975,df1) .

COMPUTE upp1 = diff +eedif1* IDF.T(0.975,df1) .

COMPUTE low2 = diff -eedif2* IDF.T(0.975,df2) .

COMPUTE upp2 = diff +eedif2* IDF.T(0.975,df2) .

FORMAT TestNr(F8).

REPORT FORMAT=LIST AUTOMATIC ALIGN(CENTER)

/VARIABLES=TestNr low1 upp1

/TITLE "95%CI for diff assuming equal variances".

REPORT FORMAT=LIST AUTOMATIC ALIGN(CENTER)

/VARIABLES=TestNr low2 upp2

/TITLE "95%CI for diff not assuming equal variances".

Now the code can be used for as many rows of data as you want.

HTH,

Marta GG

--

For miscellaneous SPSS related statistical stuff, visit:

http://gjyp.nl/marta/=====================

To manage your subscription to SPSSX-L, send a message to

[hidden email] (not to SPSSX-L), with no body text except the

command. To leave the list, send the command

SIGNOFF SPSSX-L

For a list of commands to manage subscriptions, send the command

INFO REFCARD