[R] glm with four variables

David Meyer david.meyer at ci.tuwien.ac.at
Fri Feb 8 14:32:12 CET 2002


iago mosqueira wrote:
> 
> 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.

Did you include the intercept term (vector of ones) for your
rank-checking?


 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
	Mag. David Meyer		Wiedner Hauptstrasse 8-10
Vienna University of Technology		A-1040 Vienna/AUSTRIA
       Department for			Tel.: (+431) 58801/10772
Statistics and Probability Theory	mail: david.meyer at ci.tuwien.ac.at
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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