Hi there,
I'd like to run a two part model as follows but can't seem to get the weights to work. The use of poisson distribution for the GLM model was based on the modified park's test.
Any advice much appreciated.
twopm tothealthcarecost i.ace_cat_b i.GENDER i.age_cat i.educ i.K1 i.F2 i.region i.ETHNICITY if sample == 1 & missing_ace == 0 [aweight=weighttrim], firstpart(logit) secondpart(glm, family(poisson) link(log)) vce(robust)
Many thanks
Karen
I'd like to run a two part model as follows but can't seem to get the weights to work. The use of poisson distribution for the GLM model was based on the modified park's test.
Any advice much appreciated.
twopm tothealthcarecost i.ace_cat_b i.GENDER i.age_cat i.educ i.K1 i.F2 i.region i.ETHNICITY if sample == 1 & missing_ace == 0 [aweight=weighttrim], firstpart(logit) secondpart(glm, family(poisson) link(log)) vce(robust)
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(tothealthcarecost ace_cat_b) byte GENDER float(age_cat educ) byte(K1 F2) float region byte ETHNICITY float(sample missing_ace weighttrim)
0 0 2 4 0 3 6 0 3 1 0 5.377788
1900000 0 2 1 1 5 4 1 2 1 0 .02180295
0 0 1 1 1 1 4 1 1 1 0 .011189446
2374000 0 1 3 1 4 4 1 1 1 0 .021811957
450000 0 1 1 0 5 2 1 1 1 0 .7457822
0 0 2 4 1 1 7 1 2 1 0 .0649344
0 0 1 3 0 1 4 1 1 1 0 1.4537774
2950000 0 2 1 1 5 5 1 1 1 0 .02180295
0 0 2 2 0 1 7 0 5 1 0 5.775696
0 0 1 4 1 1 7 1 4 1 0 .033324864
1450000 0 2 1 1 5 4 0 5 1 0 .05074032
0 0 1 3 1 1 7 1 1 1 0 .021811957
1600000 0 1 3 0 1 4 1 1 1 0 1.4537774
0 0 1 1 0 1 6 1 1 1 0 .7457822
0 0 1 4 1 1 5 1 1 1 0 .033324864
0 0 2 1 1 5 2 0 3 0 0 .
0 0 2 1 0 5 6 0 2 1 0 3.381867
1900000 0 2 4 1 4 4 1 1 1 0 .0649344
0 0 2 3 0 1 5 1 1 1 0 2.832725
0 0 2 2 1 1 7 1 2 1 0 .05413437
0 0 2 4 1 4 5 1 5 1 0 .0649344
0 0 1 2 0 1 4 1 2 1 0 1.8516984
450000 0 1 3 1 1 7 0 3 1 0 .05076127
474000 0 2 2 1 1 6 1 1 1 0 .05413437
0 0 2 4 1 1 1 1 4 1 0 .0649344
750000 0 1 1 1 5 4 0 4 1 0 .02604031
1450000 0 1 1 0 5 1 0 1 1 0 1.735601
308000 0 1 1 1 1 1 1 2 1 0 .011189446
150000 0 2 1 1 5 4 1 1 1 0 .02180295
450000 0 2 2 1 1 1 1 1 1 0 .05413437
0 0 2 3 1 1 7 0 4 1 0 .09890965
0 0 2 3 1 1 4 1 2 1 0 .04250114
0 0 2 2 1 1 7 1 1 1 0 .05413437
2074000 0 2 2 1 1 7 1 1 1 0 .05413437
0 0 1 3 0 1 4 1 1 1 0 1.4537774
0 0 2 3 1 1 7 0 4 1 0 .09890965
0 0 1 3 1 5 5 0 5 1 0 .05076127
0 0 1 1 1 5 2 1 1 1 0 .011189446
0 0 1 3 1 1 7 1 5 1 0 .021811957
150000 0 2 2 1 5 7 1 5 1 0 .05413437
0 0 1 2 1 1 6 1 1 1 0 .02778219
0 0 1 2 0 1 3 1 1 0 0 .
0 0 2 2 1 1 7 1 1 1 0 .05413437
0 0 2 4 1 4 7 1 5 1 0 .0649344
0 0 1 4 1 1 5 1 1 1 0 .033324864
0 0 1 2 0 1 6 1 1 1 0 1.8516984
1450000 0 1 1 1 1 6 1 1 1 0 .011189446
0 0 1 1 1 1 7 1 1 1 0 .011189446
0 0 1 2 1 1 7 1 5 1 0 .02778219
0 0 2 3 0 1 1 1 5 1 0 2.832725
0 0 1 4 1 1 7 1 5 1 0 .033324864
0 0 1 1 1 5 5 0 5 1 0 .02604031
0 0 2 3 0 1 4 1 5 1 0 2.832725
0 0 2 4 1 3 7 1 2 1 0 .0649344
1450000 0 1 1 0 5 4 1 2 0 0 .
0 0 1 1 0 5 2 1 1 1 0 .7457822
0 0 2 2 1 1 1 1 1 1 0 .05413437
158000 0 2 2 1 5 7 1 5 1 0 .05413437
0 0 1 1 0 1 4 1 1 1 0 .7457822
450000 0 2 1 1 5 7 1 1 1 0 .02180295
0 0 1 2 1 1 7 1 1 1 0 .02778219
3950000 0 2 1 1 5 3 0 5 1 0 .05074032
0 0 2 3 0 1 4 0 4 1 0 5.564115
150000 0 1 1 1 5 3 0 1 1 0 .02604031
0 0 1 1 1 5 4 1 2 1 0 .011189446
0 0 2 2 0 1 7 1 1 1 0 3.608084
1450000 0 2 3 0 1 5 1 1 1 0 2.832725
3350000 0 2 1 0 1 6 1 1 1 0 1.453177
0 0 1 3 0 1 4 1 1 1 0 1.4537774
0 0 1 3 1 1 7 1 1 1 0 .021811957
0 0 2 2 0 1 5 1 1 1 0 3.608084
0 0 1 1 0 1 2 0 3 1 0 1.735601
1900000 0 2 1 1 5 2 1 1 1 0 .02180295
150000 0 2 2 1 1 7 1 1 1 0 .05413437
3950000 0 1 4 0 1 5 0 4 1 0 5.169037
0 0 1 2 0 3 3 1 1 1 0 1.8516984
4124000 0 2 2 1 1 7 1 2 1 0 .05413437
0 0 2 1 0 1 5 1 2 1 0 1.453177
0 0 1 2 1 5 3 0 5 1 0 .06465532
0 0 1 2 0 1 6 1 1 1 0 1.8516984
0 0 1 1 0 5 4 1 1 1 0 .7457822
316000 0 1 1 1 1 6 1 2 1 0 .011189446
0 0 1 2 0 1 4 0 5 1 0 4.309315
0 0 1 2 0 1 6 1 2 1 0 1.8516984
0 0 2 3 1 1 7 0 4 1 0 .09890965
900000 0 2 1 1 1 6 1 2 1 0 .02180295
0 0 1 3 1 1 7 1 2 1 0 .021811957
450000 0 2 2 1 1 7 1 1 1 0 .05413437
0 0 1 4 1 3 7 1 1 1 0 .033324864
0 0 2 1 1 1 2 0 5 1 0 .05074032
450000 0 1 2 0 5 1 1 1 1 0 1.8516984
0 0 1 1 1 1 7 1 2 1 0 .011189446
0 0 2 5 1 5 5 1 5 1 0 5.353928
0 0 2 3 0 1 4 1 2 1 0 2.832725
0 0 1 2 0 1 4 1 1 1 0 1.8516984
0 0 1 1 1 1 1 0 3 1 0 .02604031
158000 0 2 2 1 1 7 1 1 1 0 .05413437
0 0 1 3 1 1 5 1 1 1 0 .021811957
2240000 0 2 3 1 1 1 1 1 1 0 .04250114
450000 0 1 1 0 1 4 1 1 1 0 .7457822
end
Many thanks
Karen

Comment