Sign In
New User? Register
Statisticians_group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
You can search the group for older messages.

Messages

  Messages Help
Advanced
McNemar test in SAS   Message List  
Reply | Forward Message #1726 of 4077 |
Re: [Statisticians_group] McNemar test in SAS


Dear Robert,

Thanks a lot for your kind response. It is quiet informative for me.

Thanks and Regards,
MADAN

-----Original Message-----
From: Robert Newcombe [mailto:newcombe@...]
Sent: 11 September 2006 20:29
To: Madan Gopal Kundu
Subject: Re: [Statisticians_group] McNemar test in SAS

Dear Madan,

I'm not familiar with what SAS does here. But it's very easy to compute
a McNemar test manually, simply calculate (b-c)^2 / (b+c) where b and c
are the two doscordant cell counts, this has asymptotically a chi-square
dist. with 1 df. For your data, chi-sq = 88, with p << 0.001. Or you
could use an exact binomial p-value which is 2 ^ -88 one-sided, or
preferably 2 ^ -87 two-sided. All of these are of course astronomically
statistically significant (2 ^ -87 is approx 10 ^ -26).

Given the 'overkill' statistical significance, a confidence interval
may be of greater interest. If an odds ratio is of interest, for example
in retrospective casr-control study, this is simply estimated as b/c
i.e. 0/88 or 0. Then use your preferred method to get a CI for the
binomial proportion b/(b+c), then get the corresponding CI for b/c. If
the confidence limits for b/(b+c) are L and U, the CLs for b/c are
L/(1-L) and U/(1-U). The first block of the attached Excel file (which
is freely available either from my website or the statisticians' group
website) calculates a CI for the single proportion using the Wilson
score method. For b/(b+c) = 0/88, the 95% CI is 0 to 0.0418. So the
95% CI for the odds ratio b/c is from 0 to 0.0418/0.9582 i.e. 0 to
0.0437.

On the other hand, if the data come from a crossover or longitudinal
study, the difference of proportions is of greater interest. Let a, b, c
and d be the four cells, with a+b+c+d=n. For your data, a=256, b=0,
c=88, d=0, n=344. Then the difference is (a+b)/n - (a+c)/n = (b-c)/n
which is -88/256 = -0.2558. The 3rd block of the Excel spreadsheet
calculates a CI for this using a good method, this is -0.3044 to -0.2112
here. I'm attaching a pdf of the paper that presents this method.

There is the usual correspondence (approximately at least) between CI
and p-value. Here, the p-value is extreme, the CI for the odds ratio is
well clear of the null hypothesis value of 1, and the CI for the paired
difference is well clear of the null hypothesis value of 0.

Hope this helps.


Robert G. Newcombe PhD CStat FFPH
Professor of Medical Statistics
Department of Epidemiology, Statistics and Public Health
Centre for Health Sciences Research
Cardiff University
4th floor, Neuadd Meirionnydd
Heath Park, Cardiff CF14 4YS
Tel: 029 2068 7247
Fax: 029 2068 7236

Home page
http://www.cardiff.ac.uk/medicine/epidemiology_statistics/research/stati
stics/newcombe
For location see
http://www.cardiff.ac.uk/locations/maps/heathpark/index.html


>>> "Madan Gopal Kundu" <Madan.Kundu@...> 11/09/06 05:39 >>>

I want to compute McNemar test with the following data:

data abc;
input x $ y $ count;
cards;
Absent Absent 256
Absent Present 0
Present Absent 88
Present Present 0
;
run;
proc freq data=abc;
table x*y/agree;
weight count;
run;

But log shows that:

NOTE: No statistics are computed for x * y since y has less than 2
nonmissing levels.

However, with the formula given in book it can be computed manually.
So
I am wonder why SAS does not produce the McNemar test statistic. Is
this
a software limitation???? ..... or anything else...



(i) The information contained in this e-mail message is intended only for the
confidential use of the recipient(s) named above. This message is privileged and
confidential. If the reader of this message is not the intended recipient or an
agent responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any review,
dissemination, distribution, or copying of this message is strictly prohibited.
If you have received this communication in error, please notify us immediately
by e-mail, and delete the original message.


(ii) The sender confirms that Ranbaxy shall not be responsible if this email
message is used for any indecent, unsolicited or illegal purposes, which are in
violation of any existing laws and the same shall solely be the responsibility
of the sender and that Ranbaxy shall at all times be indemnified of any civil
and/ or criminal liabilities or consequences there.

Tue Sep 12, 2006 11:43 am

madan4331
Offline Offline
Send Email Send Email

Attachment
1998 paper3.pdf
Type:
application/pdf
Attachment
CIPROPORTION.xls
Type:
application/vnd.ms-excel
Forward
Message #1726 of 4077 |
Expand Messages Author Sort by Date

Hi, I want to compute McNemar test with the following data: data abc; input x $ y $ count; cards; Absent Absent 256 Absent Present 0 Present Absent 88...
Madan Gopal Kundu
madan4331
Offline Send Email
Sep 11, 2006
5:02 am

Dear Robert, Thanks a lot for your kind response. It is quiet informative for me. Thanks and Regards, MADAN -----Original Message----- From: Robert Newcombe...
Madan Gopal Kundu
madan4331
Offline Send Email
Sep 12, 2006
1:49 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help