[R] using vif from package "car" - "aliased coefficients in the model"
Dimitri Liakhovitski
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!
Dimitri
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"
>>
>> 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.
>
>
--
Dimitri Liakhovitski
marketfusionanalytics.com
More information about the R-help
mailing list