I was trying to calculate odds ration in an example for myself, and first I had no problem with it. Here is an example:
Code:
clear * data and preparation for the example use http://www.stata-press.com/data/r15/sysdsn1.dta keep if site < 3 drop if insure == 3 * calculation logit ppd2 i.insure, or // OR = 28.44898 margins insure, expression(exp(xb())) matrix list r(table) mat m = r(table) display m[1,2] / m[1,1] // OR = 28.44898
Code:
logit ppd2 i.insure i.site, or // insure OR = 29.51753, site OR = 0.6142358 margins insure site, expression(exp(xb())) matrix list r(table) mat m = r(table) * insure OR display m[1,2] / m[1,1] // OR = 29.517533 * site OR display m[1,4] / m[1,3] // OR = 0.61423582
Code:
logit ppd2 i.insure##i.site, or // insure OR = 30.28333, site OR = 0.6234737 margins insure site, expression(exp(xb())) matrix list r(table) mat m = r(table) * insure OR display m[1,2] / m[1,1] // OR = 29.674937 * site OR display m[1,4] / m[1,3] // OR = 0.6018451
-Nick
0 Response to multiple logit odds ratio
Post a Comment