LaraVolski / Foxlights

0 stars 0 forks source link

Need to test for multicollinearity #1

Closed kaitlyngaynor closed 4 years ago

kaitlyngaynor commented 4 years ago

We need to check to make sure that there isn't collinearity in the models. Kaitlyn to add code for this

kaitlyngaynor commented 4 years ago

I used the vif() function in the car package for this. Just run vif() on the model object (I have done this for fit4 as an example) and you will get the Variance Inflation Factor for each covariate. Good practice is that you want VIF < 4.

Note that you'll get an error if there are <2 fixed effects in the model, since there is no worry about collinearity there.

Here is some example text to use in methods: To ensure that correlated covariates were not confounding the results of our analyses, we tested all covariates in the top model for collinearity and confirmed that variance inflation factors (VIF) < 4 (this was the case for all models).

Feel free to close the issue once you understand and implement :)

kaitlyngaynor commented 4 years ago

See here for commit (very small change!)