I run a model using ppmlhfde:
ppmlhdfe count_hosp i.age,a(ID year) d
and get a regular regression output:
age
16 .0113165 .4828513 0.02 0.981 -.9350546 .9576876
17 -.0768659 .4458241 -0.17 0.863 -.950665 .7969332
18 -.3476529 .4247297 -0.82 0.413 -1.180108 .4848021
19 -.3433407 .4123064 -0.83 0.405 -1.151446 .464765
20 -.1059408 .4228156 -0.25 0.802 -.9346442 .7227625
21 -.231311 .4099034 -0.56 0.573 -1.034707 .5720849
22 -.1326907 .4021873 -0.33 0.741 -.9209634 .655582
23 -.0055452 .4127051 -0.01 0.989 -.8144323 .8033419
24 -.1010815 .3960518 -0.26 0.799 -.8773287 .6751657
25 -.2754137 .4013621 -0.69 0.493 -1.062069 .5112415
26 -.0035383 .3580536 -0.01 0.992 -.7053105 .6982339
27 -.036817 .4349444 -0.08 0.933 -.8892924 .8156585
_cons .4713073 .3285848 1.43 0.151 -.1727072 1.115322
After this i want the adjusted number of events at each age, if I run:
margins age
this gives mean error:
variable __00000T not found
st_data(): 3598 Stata returned error
__marg_cr_eval(): - function returned error
deriv__call2user_v(): - function returned error
_deriv__compute_value(): - function returned error
_deriv(): - function returned error
st__marg_cr_compute(): - function returned error
<istmt>: - function returned error
but if I run:
margins age,atmeans, I get:
Adjusted predictions Number of obs = 1,221
Model VCE: Robust
Expression: Predicted mean of count_hosp, predict()
Delta-method
Margin std. err. z P>z [95% conf. interval]
age
15 .9243775 .3037364 3.04 0.002 .329065 1.51969
16 .9348976 .3226807 2.90 0.004 .302455 1.56734
17 .8559865 .2242008 3.82 0.000 .416561 1.295412
18 .6529285 .1587149 4.11 0.000 .3418531 .9640039
19 .6557501 .1259732 5.21 0.000 .4088471 .9026531
20 .8314571 .1769006 4.70 0.000 .4847383 1.178176
21 .7334867 .127113 5.77 0.000 .4843499 .9826236
22 .8095106 .1414199 5.72 0.000 .5323327 1.086688
23 .9192658 .18295 5.02 0.000 .5606905 1.277841
24 .8355072 .1851369 4.51 0.000 .4726456 1.198369
25 .7018409 .1754192 4.00 0.000 .3580256 1.045656
26 .9211125 .2371358 3.88 0.000 .4563349 1.38589
27 .8909636 .3207591 2.78 0.005 .2622872 1.51964
28 .9243775 .3037364 3.04 0.002 .329065 1.51969
I thought we are not supposed to use atmeans, and should use the margins command without atmeans,
Am I doing something wrong here that I ma getting the error message when using margins age?
ppmlhdfe count_hosp i.age,a(ID year) d
and get a regular regression output:
age
16 .0113165 .4828513 0.02 0.981 -.9350546 .9576876
17 -.0768659 .4458241 -0.17 0.863 -.950665 .7969332
18 -.3476529 .4247297 -0.82 0.413 -1.180108 .4848021
19 -.3433407 .4123064 -0.83 0.405 -1.151446 .464765
20 -.1059408 .4228156 -0.25 0.802 -.9346442 .7227625
21 -.231311 .4099034 -0.56 0.573 -1.034707 .5720849
22 -.1326907 .4021873 -0.33 0.741 -.9209634 .655582
23 -.0055452 .4127051 -0.01 0.989 -.8144323 .8033419
24 -.1010815 .3960518 -0.26 0.799 -.8773287 .6751657
25 -.2754137 .4013621 -0.69 0.493 -1.062069 .5112415
26 -.0035383 .3580536 -0.01 0.992 -.7053105 .6982339
27 -.036817 .4349444 -0.08 0.933 -.8892924 .8156585
_cons .4713073 .3285848 1.43 0.151 -.1727072 1.115322
After this i want the adjusted number of events at each age, if I run:
margins age
this gives mean error:
variable __00000T not found
st_data(): 3598 Stata returned error
__marg_cr_eval(): - function returned error
deriv__call2user_v(): - function returned error
_deriv__compute_value(): - function returned error
_deriv(): - function returned error
st__marg_cr_compute(): - function returned error
<istmt>: - function returned error
but if I run:
margins age,atmeans, I get:
Adjusted predictions Number of obs = 1,221
Model VCE: Robust
Expression: Predicted mean of count_hosp, predict()
Delta-method
Margin std. err. z P>z [95% conf. interval]
age
15 .9243775 .3037364 3.04 0.002 .329065 1.51969
16 .9348976 .3226807 2.90 0.004 .302455 1.56734
17 .8559865 .2242008 3.82 0.000 .416561 1.295412
18 .6529285 .1587149 4.11 0.000 .3418531 .9640039
19 .6557501 .1259732 5.21 0.000 .4088471 .9026531
20 .8314571 .1769006 4.70 0.000 .4847383 1.178176
21 .7334867 .127113 5.77 0.000 .4843499 .9826236
22 .8095106 .1414199 5.72 0.000 .5323327 1.086688
23 .9192658 .18295 5.02 0.000 .5606905 1.277841
24 .8355072 .1851369 4.51 0.000 .4726456 1.198369
25 .7018409 .1754192 4.00 0.000 .3580256 1.045656
26 .9211125 .2371358 3.88 0.000 .4563349 1.38589
27 .8909636 .3207591 2.78 0.005 .2622872 1.51964
28 .9243775 .3037364 3.04 0.002 .329065 1.51969
I thought we are not supposed to use atmeans, and should use the margins command without atmeans,
Am I doing something wrong here that I ma getting the error message when using margins age?