Date: Mon, 3 May 2004 13:19:43 +0200
Reply-To: Spousta Jan <JSpousta@CSAS.CZ>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Spousta Jan <JSpousta@CSAS.CZ>
Subject: Re: syntax to compute a common standard deviation - is there a pr
oblem with the syntax I have been using
Content-Type: text/plain; charset="iso-8859-2"
Hi Bob,
I suspect, that the calculator gives not a 'pure' standard deviation, but sd times a quantile of a Student's distribution - 0,63 * 1,96 is very close to the calculator's result.
One more advice: It is better to write formulae in one row, if they are not too complicated:
compute s = sqrt(((n1-1)*s1**2 + (n2-1)*s2**2)/(n1+n2-2)).
But your method also leads to correct results, I think, although it is not so easy to check it.
HTH
Jan
-----Original Message-----
From: Bob Green [mailto:bgreen@dyson.brisnet.org.au]
Sent: Monday, May 03, 2004 1:02 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: syntax to compute a common standard deviation - is there a
problem with the syntax I have been using
I am wanting to compute a common standard deviation to perform a power
analysis of a t-test. I found the following formula:
s = sqrt[((n1-1)s1^2 + (n2-1)s2^2)/(n1+n2-2)]
I wrote the no-doubt inefficient syntax (below) to perform this
operation. Sample values are:
n1 =45
s1 =.6451059
(mean = 1.644444)
n2 =47
s2 = .6135986
(mean 2 =1.595745)
When I used the syntax below I arrived at a value of .63 , whereas when I
entered this data into a power calculator the value was 1.2408 ( the
correct mean difference was reported .0487)
Any advice is appreciated,
Bob
COMPUTE n1minus = n1-1.
EXECUTE .
COMPUTE n2minus = n2-1.
EXECUTE .
compute sd1sq = s1*s1.
EXECUTE .
compute sd2sq = s2*s2.
EXECUTE .
compute nom = n1minus*sd1sq + n2minus*sd2sq .
EXECUTE.
compute denom = (n1 +n2) -2.
EXECUTE.
COMPUTE nomdenom = nom/denom.
EXECUTE.
COMPUTE comstd = SQRT (nomdenom).
EXECUTE.