楼主: fcy23
1277 0

[回归分析求助] problem with zero-inflated negative binomial [推广有奖]

  • 0关注
  • 0粉丝

初中生

9%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
59 点
帖子
9
精华
0
在线时间
8 小时
注册时间
2010-10-25
最后登录
2015-2-13

楼主
fcy23 发表于 2015-2-6 22:43:07 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
各位大牛,
我在其他论坛上问了一下问题,暂时没有人回复,只好把问题搬到这里再问问,希望遇到牛人。在线急等,谢谢各位。

I'm hoping there was someone that could help me out of this problem when running the zero-inflated negative binomial model with stata. In this model, I'm trying to 1) predict the probability of time on care-giving > 0,  and 2) the total amount of time on care-giving if greater than zero (hours/week). It went well when there was only one independent variable added. But it took forever when I started to add more variables there. Below is my code for the survey data that I'm using. Please see results in the attachment.

*unadjusted model

program trysimple
args ylist subset

svyset w1varunit [pweight=w1anfinwgt0], strata(w1varstrat) singleunit(centered)

svy, subpop(`subset' if `subset' < 2): zinb `ylist' ib0.aaWhite, inflate (ib0.aaWhite)
margins, subpop(`subset' if `subset' < 2) at(aaWhite=(0 1)) vce(unconditional) post
test 1._==2._

end program

trysimple time raceEthStrokeSubset
trysimple TOTnumhrswk1 raceEthStrokeSubset


* adjusted for soicaldemographic, comorbidity and physical capacity
program tryadjusted
args ylist subset
svyset w1varunit [pweight=w1anfinwgt0], strata(w1varstrat) singleunit(centered)

svy, subpop(`subset' if `subset' < 2): zinb `ylist' ib0.aaWhite i.ageCat i.gender i.educ3 i.married i.meanIncome5 ///
mi2 cad2 htn2 dm2 cancer2 dementia2 osteoporosis2 athritis2  i.phq2Positive i.gad2Positive c.capacityIndex , ///
inflate (ib0.aaWhite i.ageCat i.gender i.educ3 i.married i.meanIncome5 ///
mi2 cad2 htn2 dm2 cancer2 dementia2 osteoporosis2 athritis2 i.phq2Positive i.gad2Positive c.capacityIndex)

margins, subpop(`subset' if `subset' < 2) at(aaWhite=(0 1)) vce(unconditional) post
test 1._==2._

end program

tryadjusted time raceEthStrokeSubset
tryadjusted TOTnumhrswk1 raceEthStrokeSubset


Here, I use two different outcome variables with the model: TOTnumhrswk and time ( int(TOTnumhrswk)) since it is a count model, i guess it would only fit for count? The first unadjusted model worked while the adjusted one didn't. Stata kept running for a while without giving any result. My questions are:
1. The maximum of variable 'time' is over 500. Is that the reason for stata taking so long to get the result? Do i need to consider some other model? What the alternatives would be?
2. If not, do i need to have different variable list for the inflate part? Let's say, at least one different x variable there?
3. Variables like mi2, cad2, cancer2 are indicator of disease but with some missing data. They are supposed to be binary. Would that be a potential problem for running the estimate?

zero inflated results.png



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:inflated negative Binomial problem nomial forever everyone problem running someone

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 12:15