[R] using vif from package "car" - "aliased coefficients in the model"
dimitri.liakhovitski at gmail.com
Tue Sep 13 17:21:11 CEST 2011
John, you were right.
After I checked: I had MORE predictors that entered the model than
predictors that were left in and that show up in in
summary(myreg)$coeff). That means, some of the predictors were kicked
out from the results.
I have rerun my lm with all the predictors left in and then vif worked!
Thanks a lot!
On Tue, Sep 13, 2011 at 10:53 AM, John Fox <jfox at mcmaster.ca> wrote:
> 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"
>> 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.
> John Fox
> Senator William McMaster
> Professor of Social Statistics
> Department of Sociology
> McMaster University
> 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