Dimitri Liakhovitski
2011-Sep-13 14:28 UTC
[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 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
John Fox
2011-Sep-13 14:53 UTC
[R] using vif from package "car" - "aliased coefficients in the model"
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 modelThat'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.
Seemingly Similar Threads
- optim seems to be finding a local minimum
- expand.grid on contents of a list
- "rounding" to a number that is LOWER than my number
- summing columns with NAs present
- Which Durbin-Watson is correct? (weights involved) - using durbinWatsonTest and dwtest (packages car and lmtest)