Dear all,
I run the following glm on cost data and I'm interested in the marginal effect of a categorical variable.
glm totalcost i.y1 y2 i.y3 , family(gamma) link(log) robust
where y1 is a categorical variable coded into three classes (A B C)
the difference between C and A is statistically significant in the glm model. But if I look at the confidence interval for the marginal effect of C, this is large and it largely overlaps with the marginal effect of A. The difference between C and A does not seem to be statistically significant. Is there something wrong in what I've done? Or am I misinterpreting the results?
thanks
I run the following glm on cost data and I'm interested in the marginal effect of a categorical variable.
glm totalcost i.y1 y2 i.y3 , family(gamma) link(log) robust
where y1 is a categorical variable coded into three classes (A B C)
Code:
glm totalcost i.y1 y2 i.y3 , family(gamma) link(log) robust Iteration 0: log pseudolikelihood = -2154.0474 Iteration 1: log pseudolikelihood = -1983.0575 Iteration 2: log pseudolikelihood = -1979.9279 Iteration 3: log pseudolikelihood = -1979.8941 Iteration 4: log pseudolikelihood = -1979.8941 Generalized linear models No. of obs = 250 Optimization : ML Residual df = 245 Scale parameter = 10.3413 Deviance = 975.3459595 (1/df) Deviance = 3.981004 Pearson = 2533.619027 (1/df) Pearson = 10.3413 Variance function: V(u) = u^2 [Gamma] Link function : g(u) = ln(u) [Log] AIC = 15.87915 Log pseudolikelihood = -1979.894074 BIC = -377.412 ------------------------------------------------------------------------------------- | Robust totalcost | Coef. Std. Err. z P>|z| [95% Conf. Interval] --------------------+---------------------------------------------------------------- y1 | B | .1712582 .4287108 0.40 0.690 -.6689995 1.011516 C | 1.384857 .5072588 2.73 0.006 .3906478 2.379066 | y2 | .0417224 .014174 2.94 0.003 .0139419 .0695029 | y3 | yes | -.0345493 .436378 -0.08 0.937 -.8898344 .8207358 _cons | 4.20057 .8834935 4.75 0.000 2.468954 5.932185 ------------------------------------------------------------------------------------- . margins y1, Predictive margins Number of obs = 250 Model VCE : Robust Expression : Predicted mean costototalepaziente, predict() ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- y1 | A | 895.8442 289.5275 3.09 0.002 328.3806 1463.308 B | 1063.185 323.9021 3.28 0.001 428.349 1698.022 C | 3578.229 1460.978 2.45 0.014 714.7648 6441.693 ------------------------------------------------------------------------------
thanks
Comment