Hi everyone,
I have a question on how to get the overall margins for both equations after using zip(zero-inflated poisson).
My codes are as follows:
svyset w1varunit [pweight=w1anfinwgt0], strata(w1varstrat) singleunit(certainty)
program trypossion
args ylist subset
svy, subpop(`subset'): zip `ylist' ib0.miYes ib0.cadYes ib0.htnYes ib0.dmYes ib0.cancerYes ib0.dementiaYes ib0.osteoporosisYes ib0.arthritisYes ib0.lungDiseaseYes ///
ib2.compareTwo i.ageCat i.gender i.educ3 i.married c.meanIncome5 ///
i.phq2Positive i.gad2Positive c.capacityIndex ///
i.livingYes1, ///
inflate (ib2.compareTwo i.ageCat i.gender i.educ3 i.married c.meanIncome5 ///
i.phq2Positive i.gad2Positive ///
ib0.miYes ib0.cadYes ib0.htnYes ib0.dmYes ib0.cancerYes ib0.dementiaYes ib0.osteoporosisYes ib0.arthritisYes ib0.lungDiseaseYes ///
c.capacityIndex i.livingYes1 )
margins, subpop(`subset') at(compareTwo=(2 1)) vce(unconditional) post
test 1._==2._
end program
Apparently, I could get margin for the second Poisson regression using the code above. But I’m also interested in getting margin at categorical variable compareTwo at 1 and 2, while hold others at means for the first equation (inflate part).
Thank you for sharing your valuable thoughts in advance.
I have a question on how to get the overall margins for both equations after using zip(zero-inflated poisson).
My codes are as follows:
svyset w1varunit [pweight=w1anfinwgt0], strata(w1varstrat) singleunit(certainty)
program trypossion
args ylist subset
svy, subpop(`subset'): zip `ylist' ib0.miYes ib0.cadYes ib0.htnYes ib0.dmYes ib0.cancerYes ib0.dementiaYes ib0.osteoporosisYes ib0.arthritisYes ib0.lungDiseaseYes ///
ib2.compareTwo i.ageCat i.gender i.educ3 i.married c.meanIncome5 ///
i.phq2Positive i.gad2Positive c.capacityIndex ///
i.livingYes1, ///
inflate (ib2.compareTwo i.ageCat i.gender i.educ3 i.married c.meanIncome5 ///
i.phq2Positive i.gad2Positive ///
ib0.miYes ib0.cadYes ib0.htnYes ib0.dmYes ib0.cancerYes ib0.dementiaYes ib0.osteoporosisYes ib0.arthritisYes ib0.lungDiseaseYes ///
c.capacityIndex i.livingYes1 )
margins, subpop(`subset') at(compareTwo=(2 1)) vce(unconditional) post
test 1._==2._
end program
Apparently, I could get margin for the second Poisson regression using the code above. But I’m also interested in getting margin at categorical variable compareTwo at 1 and 2, while hold others at means for the first equation (inflate part).
Thank you for sharing your valuable thoughts in advance.