我为年轻人建立了一个逻辑模型,另一个对老年人具有相同预后因素的逻辑模型。我想比较两组老年人和年轻人的两种预后因素。我需要检验两种优势比是否有显着性差异,并得到两组间差异的p值。你能给我施塔塔命令吗?
发布于 2015-01-27 09:02:36
// 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
https://stackoverflow.com/questions/28161173
复制相似问题