[R] glm with four variables

iago mosqueira i.mosqueira at ic.ac.uk
Fri Feb 8 14:17:51 CET 2002


Hi,

Yes, it appears R thinks that is the case. lm() complains of singularities.
I have a total of four variables (dep,lat,ne and date) and Matlab tells me
none of them is singular, and the rank of the combined matrix is 4, so they
don't appear to be correlated. Is there any way I can avoid this? Or does it
simply indicate two variables will be enough here?


Thanks

iago

----- Original Message -----
From: "Martyn Plummer" <plummer at iarc.fr>
To: "iago mosqueira" <i.mosqueira at ic.ac.uk>
Cc: "R-help" <r-help at stat.math.ethz.ch>
Sent: 08 February 2002 13:13
Subject: RE: [R] glm with four variables


> On 08-Feb-2002 iago mosqueira wrote:
> > Hi,
> >
> > Sorry if this is a very basic question, but when I run this
> >
> > glm(formula = loge ~ lat + ne + dep, family = gaussian)
> >
> > summary shows the same formula but results only for the first two
variables.
> > What am I doing wrong?
>
> Probably dep is aliased: i.e. some linear combination of lat, ne and the
> intercept equals dep for all values. A model with all four terms is, in
> this case, unidentifiable so dep is dropped.  This appears to take place
> silently.  It might be more useful to issue a warning.
>
> Martyn

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list