测试两个比值比的差异

时间:2015-01-26 23:50:02

标签: model stata

我为年轻人和另一个具有相同的老年人预后因素的后勤模型运行逻辑模型。我想比较两组老年人和年轻人之间每个预后因素的两个OR。我需要测试两个优势比是否显着不同,并获得两组之间差异的p值。你能告诉我Stata的命令吗?

1 个答案:

答案 0 :(得分:1)

// data preparation
sysuse auto, clear
gen byte good = (rep78 > 3) if !missing(rep78)
replace price = price / 1000
label var price "price in 1000s dollars"

// ============================= method 1
// estimate the models separately
logit good price mpg if foreign == 0
est store dom

logit good price mpg if foreign == 1
est store for

// combine the models
suest dom for

// test
test [dom_good]mpg = [for_good]mpg

// see the chi^2 value in more detail:
di r(chi2)

// ============================= method 2
// do it all in one model without any 
// post-estimation commands

logit good i.foreign##(c.price c.mpg), vce(robust)
// look at the p-value next to the coefficient of
// the interaction term between foreign and mpg

// ============================= bonus
// Show that the two methods are exactly the same

// method 2 reportes the test as a z-statistic, but
// the p-value is the same. we can transform the
// z-statistic and see that method 2 results in
// the exact same chi^2 value:
di (_b[1.foreign#c.mpg]/_se[1.foreign#c.mpg])^2

我个人更喜欢方法2.但是,目前的技术水平是你无法比较这些比值比(我不同意,但我是少数)看,例如,

Allison,P。D.(1999)。比较各组的logit和probit系数。 社会学方法&研究 28(2),186-208。 http://dx.doi.org/10.1177/0049124199028002003

Breen,R.,Holm,A。和Karlson,K。B.(2014)。相关性与非线性概率模型。 社会学方法&研究 43(4),571-605。 http://dx.doi.org/10.1177/0049124114544224

Mood,C。(2010)。逻辑回归:为什么我们不能做我们认为可以做的事情,以及我们可以做些什么。 欧洲社会学评论,26(1),67-82。 http://dx.doi.org/10.1093/esr/jcp006

Neuhaus,J。M.和N. P. Jewell(1993)。在广义线性模型中评估由于省略的协变量引起的偏差的几何方法。 Biometrika 80(4),807-815。 http://dx.doi.org/10.1093/biomet/80.4.807

Williams,R。(2009)。使用异质选择模型比较各组的logit和probit系数。 社会学方法&研究 37(4),531-559。 http://dx.doi.org/10.1177/0049124109335735