Posted by
Bruce Weaver on
Jun 08, 2016; 3:59pm
URL: http://spssx-discussion.165.s1.nabble.com/No-chi-square-value-in-McNemar-test-output-tp1080750p5732351.html
Marta has posted a macro you can use. Here is another option you could use if all you want is the Chi-square value and its p-value.
* McNemar's Chi-square is equivalent to a Chi-square
* goodness of fit test (using Pearson's Chi-square)
* on the two discordant cells, which I'll call b and c.
DATA LIST LIST /b c (2F5.0).
BEGIN DATA
12 4
END DATA.
* For both cells, the expected frequency under the null hypothesis
* is the mean of the two observed counts.
COMPUTE E = MEAN(b,c).
COMPUTE Xsq1 = (b-E)**2/E + (c-E)**2/E.
COMPUTE Xsq2 = (ABS(b-E)-.5)**2/E + (ABS(c-E)-.5)**2/E.
COMPUTE df = 1.
COMPUTE p1 = 1 - CDF.CHISQ(Xsq1,df).
COMPUTE p2 = 1 - CDF.CHISQ(Xsq2,df).
FORMATS Xsq1 Xsq2 p1 p2 (F8.3) / df (F5.0).
LIST.
List
b c E Xsq1 Xsq2 df p1 p2
12 4 8.00 4.000 3.063 1 .046 .080
Number of cases read: 1 Number of cases listed: 1
* Xsq1 and Xsq2 are the uncorrected and continuity-corrected
* versions respectively of McNemar's Chi-square test.
Results from Marta's macro:
MyMcNemar 10 12 4 20.
MCNEMAR CHI-SQUARE TESTS AND RELATED STATISTICS
CHI-SQUARE TESTS (ASYMPTOTIC)
Stat. Sig.
Uncorr. 4.000 .046
Corr. 3.063 .080
MCNEMAR'S ODDS-RATIO & 95CI (ASYMPTOTIC)
OR Lower Upper
.33 .11 1.03
HTH.
Sytske wrote
Dear all,
Iâm using the nonparametric 2 related samples McNemar test in SPSS 15 (NPAR
TEST), but the output doesnât give me a value for the McNemar chi-square.
The output gives the crosstab plus a table containing âNâ and âExact Sig.
(2-tailed)â. Why is SPSS not giving the chi-square and how can I get the
chi-square?
Thank you very much for your help!
Sytske
=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).