[R] using vif from package "car" - "aliased coefficients in the model"
John Fox
jfox at mcmaster.ca
Tue Sep 13 16:53:29 CEST 2011
Dear Dimitri,
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Dimitri Liakhovitski
> Sent: September-13-11 10:29 AM
> To: r-help
> Subject: [R] using vif from package "car" - "aliased coefficients in
> the model"
>
> Hello!
> I have run a simple regression - lm and created a regression object
> "myreg".
> I can see all the coefficients when I print(myreg).
> Then I tried to run vif(myreg) from the package "car".
> However, it's giving me an error: in vif.lm(regr.f) : there are aliased
> coefficients in the model
That's curious, since vif.lm() tests for aliased coefficients via
any(is.na(coef(mod))). Are you sure that there are no NAs among the printed
coefficients? If there are perfect collinearities, lm() will arbitrarily
remove some regressors from the model, and the resulting VIFs would be
misleading, since the correct answer is that at least one VIF is infinite.
Best,
John
--------------------------------
John Fox
Senator William McMaster
Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox
>
> Very sorry for my question: Is there any way to get the vif's for all
> predictors?
>
> Thank you very much!
>
> --
> Dimitri Liakhovitski
> marketfusionanalytics.com
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
More information about the R-help
mailing list