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

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Thu Jul 28 04:19:49 CEST 2022

On Wed, 27 Jul 2022 18:25:23 -0700
David Winsemius <dwinsemius using comcast.net> wrote:


> The NA is most likely caused by aliasing, so some other combination
> of factors a perfect surrogate for every case with that level of the 
> interaction. 


No, I think it's much simpler than that.  Essentially it boils down to
the fact that if y is 1:10 and x is rep(1,10) then

    lm(y ~ x)

gives a slope estimate of NA.  As it clearly should.



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

More information about the R-help mailing list