I think that StataCorp forgot an -if e(sample)- in the -CheckAdmiss-
sub-program of -glm- (you can see that when you type -viewsource
glm.ado-) and counted missing values as violations.
You can check the predictions yourself by typing after your -glm-
model:
predict mu
assert mu >= 0 & mu <= 1 if e(sample)
Hope this helps,
Maarten
--- Jane Schroeder <[email protected]> wrote:
> When I run binomial -glm- models with a log or identity link function
> I
> get the following error message whenever there are observations with
> missing data for a model covariate, even though all predicted risks
> are
> well within the permissible (0,1) range:
>
> Warning: parameter estimates produce inadmissible mean estimates in
> one
> or more observations.
>
> For example, when I fit a linear risk model to the following (no
> missing
> data), I don't get the error message:
>
> 20-36 vs. | child's gender
> 37+ weeks | female male | Total
> -----------+----------------------+----------
> term | 29,059 30,116 | 59,175
> preterm | 3,591 4,218 | 7,809
> -----------+----------------------+----------
> Total | 32,650 34,334 | 66,984
>
> . glm preterm sex, fam(bin) link(ident)
>
>
------------------------------------------------------------------------------
> | OIM
> preterm | Coef. Std. Err. z P>|z| [95% Conf.
>
> Interval]
>
-------------+----------------------------------------------------------------
> sex | .0128673 .0024772 5.19 0.000 .008012
> .0177226
> _cons | .1099847 .0017315 63.52 0.000 .106591
> .1133784
>
------------------------------------------------------------------------------
> Coefficients are the risk differences
>
> However, if I recode one observation to missing for 'sex' and rerun
> the
> model I get the error message, e.g.:
>
> replace sex=. in 1
> (1 real change made, 1 to missing)
>
> . glm preterm sex, fam(bin) link(ident)
>
>
------------------------------------------------------------------------------
> | OIM
> preterm | Coef. Std. Err. z P>|z| [95% Conf.
>
> Interval]
>
-------------+----------------------------------------------------------------
> sex | .0128709 .0024773 5.20 0.000 .0080155
> .0177262
> _cons | .1099847 .0017315 63.52 0.000 .106591
> .1133784
>
------------------------------------------------------------------------------
> Coefficients are the risk differences
> Warning: parameter estimates produce inadmissible mean estimates in
> one
> or more observations.
>
> Note that the predicted risk for a female (.1099847) is unchanged
> from
> the previous model, and the predicted risk for a male (with one
> preterm
> observation missing) is essentially unchanged (.1228556 vs. .122852).
>
> It's not that much trouble to generate and review the predicted risks
>
> after every model, but I hate to get into the habit of ignoring error
>
> messages. Any suggestions? Thanks-
>
> Jane Schroeder
>
>
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
___________________________________________________________
Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/