Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Mcnemar using mcc command
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Mcnemar using mcc command
Date
Mon, 5 Nov 2012 11:54:44 +0100
On Mon, Nov 5, 2012 at 11:21 AM, rasool.bux wrote:
> I want to run Mcnemar test in stata. The mcc command is not giving correct results.
You seem to have coded your variables as 1,2 instead of 0,1:
*----------- begin example -------------
webuse mccxmpl, clear
// code unexposed /exposed as 1, 2
// instead of 0, 1
gen case_wrong = case + 1
gen control_wrong = control + 1
// add some labels
label define lab 1 "no" 2 "yes"
label val case_wrong control_wrong lab
// see the crosstab
tab case_wrong control_wrong [fw=pop]
// -mcc- looks all wrong
mcc case_wrong control_wrong [fw=pop]
// if you use the 0,1 coding
// everything looks fine again
mcc case control [fw=pop]
*------------ end example --------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
Hope this helps,
Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/