[R] vif in package car: there are aliased coefficients in the model

John Fox jfox at mcmaster.ca
Sat Mar 28 01:51:08 CET 2015


Dear Rodolfo,

It's apparently the case that at least one of the columns of the model
matrix for your model is perfectly collinear with others. 

There's not nearly enough information here to figure out exactly what the
problem is, and the information that you provided certainly falls short of
allowing me or anyone else to reproduce your problem and diagnose it
properly. It's not even clear from your message exactly what the structure
of the model is, although localizacao  is apparently a factor with 3 levels.


If you look at the summary() output for your model or just print it, you
should at least see which coefficients are aliased, and that might help you
understand what went wrong.

I hope this helps,
 John

-------------------------------------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/


> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Rodolfo
> Pelinson
> Sent: March-27-15 3:07 PM
> To: r-help at r-project.org
> Subject: [R] vif in package car: there are aliased coefficients in the
model
> 
> Hello. I'm trying to use the function vif from package car in a lm.
However it
> returns the following error:
> "Error in vif.default(lm(MDescores.sitescores ~ hidroperiodo + localizacao
> +  : there are aliased coefficients in the model"
> 
> When I exclude any predictor from the model, it returns this warning
> message:
> "Warning message: In cov2cor(v) : diag(.) had 0 or NA entries; non-finite
> result is doubtful"
> 
> When I exclude any other predictor from the model vif finally works. I
can't
> figure it out whats the problem. This are the results that R returns
> me:
> 
> > vif(lm(MDescores.sitescores ~ hidroperiodo + localizacao + area +
> profundidade + NTVM +  NTVI + PCs...c.1.., data = MDVIF)) Error in
> vif.default(lm(MDescores.sitescores ~ hidroperiodo + localizacao +
>  :   there are aliased coefficients in the model
> 
> > vif(lm(MDescores.sitescores ~ localizacao + area + profundidade + NTVM
> > +
>  NTVI + PCs...c.1.., data = MDVIF))
>              GVIF Df GVIF^(1/(2*Df))
> localizacao   NaN  2             NaN
> area          NaN  1             NaN
> profundidade  NaN  1             NaN
> NTVM          NaN  1             NaN
> NTVI          NaN  1             NaN
> PCs...c.1..   NaN  1             NaN
> Warning message:
> In cov2cor(v) : diag(.) had 0 or NA entries; non-finite result is doubtful
> 
> Thanks.
> --
> Rodolfo Mei Pelinson.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



More information about the R-help mailing list