I have run a zero inflated poisson model using the ZIP command as follows:
global depvar er_visits
global preg i.emfqhc
global covariates i.mm_agedec male i.mm_race2 urban mh sub ///
tob charl arv hmo i(2 3 4)b2.maxvol_08_4 imp_zip ///
hgrad cgrad
zip $depvar $preg $covariates, inflate($preg $covariates) irr nolog vce(robust)
I subsequently want to run margins to estimate the number of ER visits according to the three levels of my primary regressor ($preg)
margins, dydx($preg)
This returns the error message that the results are "not estimable".
I think the problem has to do with collinearity. Two of my variables, i.emfqhc ($preg) and maxvol_08_04 are categorical variables with three levels, and the first level of each is perfectly collinear because they both represent the people who had no primary care visits in the last year. Both variables represent different things: the type of clinic one receives care in, and the outpatient experience of the provider, but in both cases a separate category had to be made for those who had no primary care visits because they otherwise would be unclassifiable in each of those variables. In order to get around this collinearity, in my code above, I omitted level 1 from the maxvol_08_4 variable (i(2 3 4)b2.maxvol_08_4) so that there would not be perfect collinearity with level 1 of the emfqhc variable. I think this might be the reason for the "not estimable" error message.
I also tried looking at the matrix, as I saw in other posts:
matrix H = get(H)
matrix list H
All of the values are -1, 0, 1.
I have tried using the noestimcheck option:
margins, dydx($preg) noestimcheck
This works and does output results, but I am wondering if it is the appropriate use of this option.
Thank you all for your help!
global depvar er_visits
global preg i.emfqhc
global covariates i.mm_agedec male i.mm_race2 urban mh sub ///
tob charl arv hmo i(2 3 4)b2.maxvol_08_4 imp_zip ///
hgrad cgrad
zip $depvar $preg $covariates, inflate($preg $covariates) irr nolog vce(robust)
I subsequently want to run margins to estimate the number of ER visits according to the three levels of my primary regressor ($preg)
margins, dydx($preg)
This returns the error message that the results are "not estimable".
I think the problem has to do with collinearity. Two of my variables, i.emfqhc ($preg) and maxvol_08_04 are categorical variables with three levels, and the first level of each is perfectly collinear because they both represent the people who had no primary care visits in the last year. Both variables represent different things: the type of clinic one receives care in, and the outpatient experience of the provider, but in both cases a separate category had to be made for those who had no primary care visits because they otherwise would be unclassifiable in each of those variables. In order to get around this collinearity, in my code above, I omitted level 1 from the maxvol_08_4 variable (i(2 3 4)b2.maxvol_08_4) so that there would not be perfect collinearity with level 1 of the emfqhc variable. I think this might be the reason for the "not estimable" error message.
I also tried looking at the matrix, as I saw in other posts:
matrix H = get(H)
matrix list H
All of the values are -1, 0, 1.
I have tried using the noestimcheck option:
margins, dydx($preg) noestimcheck
This works and does output results, but I am wondering if it is the appropriate use of this option.
Thank you all for your help!
Comment