[R] [EXT] Predicted values from glm() when linear predictor is NA.

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Thu Jul 28 03:58:44 CEST 2022


On Thu, 28 Jul 2022 00:41:52 +0000
Andrew Robinson <apro using unimelb.edu.au> wrote:

> Hi Rolf,
> 
> that's an interesting observation.
> 
> I agree that it is counter-intuitive that the fitted values /
> predictions are not NA.

That gives me some comfort!

Does anyone from R-core feel like commenting?

> However, I don't agree with your comment that <<if the linear
> predictor in a Binomial glm is NA, then "success" is a certainty>> -
> that seems to be a peculiarity of these data - note for these three
> observations there are thousands dead and zero alive and that you get
> similar outcomes if you omit TrtTime altogether ...
> 
> > predict(glm(cbind(Dead,Alive) ~ Lifestage,
> > family=binomial,data=demoDat))[demoDat$Lifestage=="L1"]
>  26 65 131
> 20.02007 20.02007 20.02007

Hmm.  Yeah.  I was probably jumping the gun a bit there.  I'll think on
this a bit more.

This issue arose in a more complicated context (which I won't try to go
into) in which I really need some insight into how to deal with missing
values of the linear predictor, and what the resulting fitted values
actually mean.  Psigh!

cheers,

Rolf

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-help mailing list