[R] using vif from package "car" - "aliased coefficients in the model"
jfox at mcmaster.ca
Tue Sep 13 16:53:29 CEST 2011
> -----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"
> I have run a simple regression - lm and created a regression object
> 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.
Senator William McMaster
Professor of Social Statistics
Department of Sociology
Hamilton, Ontario, Canada
> Very sorry for my question: Is there any way to get the vif's for all
> Thank you very much!
> Dimitri Liakhovitski
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help