Date: Mon, 3 Jan 2005 18:36:26 +0100
Reply-To: Marta García-Granero
<biostatistics@terra.es>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Marta García-Granero
<biostatistics@terra.es>
Organization: Asesoría Bioestadística
Subject: Re: McNemar Test: How do I get the McNemar-ChiSquare Value?
In-Reply-To: <BDFE27ED.2C71%sakari.lemola@psy.unibe.ch>
Content-Type: text/plain; charset=ISO-8859-1
Hi again Sakari,
I've had some minutes for myself (no phone...), and I have written
a piece of code for your data:
SL> NPAR TEST
SL> /MCNEMAR=smoke1 WITH smoke2 (PAIRED)
SL> /STATISTICS DESCRIPTIVES
SL> /MISSING ANALYSIS.
SL> But I don¹t get a ChiSquare-Value: I only get the probabilities (exact sig.
SL> 2-tailed). Can somebody tell me how to get the McNemar-ChiSquare value?
Taking smoke1 & smoke2 as the names for the variables:
SORT CASES BY
smoke1 (A) smoke2 (A) .
AGGREGATE
/OUTFILE=*
/BREAK=smoke1 smoke2
/N=N.
MATRIX.
GET obs /VAR=n /MISSING=0.
COMPUTE a=obs(2).
COMPUTE b=obs(3).
COMPUTE chi2=((a-b)&**2)&/(a+b).
COMPUTE chi2sig=1-CHICDF(chi2,1).
PRINT {chi2,chi2sig}
/FORMAT="F8.4"
/CLABELS="Chi^2","Sig."
/TITLE="Uncorrected Chi-square & significance".
COMPUTE chi2cor=(ABS(a-b)-1)&**2&/(a+b).
COMPUTE chi2sigc=1-CHICDF(chi2cor,1).
PRINT {chi2cor,chi2sigc}
/FORMAT="F8.4"
/CLABELS="Chi^2","Sig."
/TITLE="Continuity corrected Chi-square & significance".
END MATRIX.
One afterthought:
I've lost the reference, but Joe Abramson (the creator of WinPepi)
told me that the exact p-value for McNemar test is too conservative,
and sometimes it's better to use the corrected Chi-Square value.
That's a good reason to use this syntax instead of SPSS McNemar test.
Nonetheless, if the number of discordant pairs is lower than 10, the
exact test should be used (asymptotic significances provided by
Chi-Square tests are unreliable for sample sizes that low)
HTH
Marta Garcia-Granero mailto:biostatistics@terra.es