I know that VIF values have no upper limit, and that anything over 10 is usually bad news if you are trying to avoid multicollinearity especially for regression models such as multiple logistic regression.

However - most of what I have read suggests removing the offending infinity variable. Here in lies the problem.

I'm currently working on a dataset with nearly 2000 variables, and every single one has produced a VIF of infinity.

enter image description here

I've been doing this on python:

vif_info = pd.DataFrame()
vif_info['VIF'] = [variance_inflation_factor(df.values, i) for i in range(dif.shape[1])]
vif_info['Column'] = df.columns
vif_info.sort_values('VIF', ascending=False)

and I have tried various different methods, which have all produced the same results, so I'm relatively sure I haven't done something wrong there.

I have also tried log transforming the data and I still get the same result.

I'm not sure if it adds up though because when I produce something like a clustermap using a regular correlation matrix (see below) there seems to be clear specific variables that are highly correlated but not all variables seem to be this way.

In terms of statistical analysis I'm not sure how one would proceed with these results (or if theres something obvious that I've done wrong).

clustermap correlation matrix

  • $\begingroup$ What kind of analysis do you want to do with your variables? $\endgroup$ Commented Jul 28, 2022 at 11:29
  • $\begingroup$ Ideally I'd do a multiple logistic regression. My response variable is categorical (3 categories) and I'd like to which of the variables are most significantly associated with each category $\endgroup$ Commented Jul 28, 2022 at 11:38

2 Answers 2


It seems that a somevariables are able to create perfect multiple regressions on other variables (which would explain why all the VIF are infinity).

In order to identify them, I would try to do some actual regressions $X_j=X_{\backslash j}\beta+\epsilon$ and check the coefficients in order to try to identify the problematic variables.

Otherwise, maybe this comes from your dataset. I am not familiar with chemistry data at all. According to your experience, is it common to have very high VIF in such a dataset ? Also, what is the size of your dataset ? How big is the number of observations in comparison to your 2000 regressors ?


Based on your comment, it is likely that the issue comes from the fact that you have way more variables than observations ($k=2000 > N = 45$). So all the regressions end up having $R^2=1$, which corresponds to your VIF equal to 1 for all variables.

As a consequence, I suggest you try to find a way to use a small number of regressors for your regressions. A technique like forward stepwise regression could help, but will prevent you from doing inference with your resulting model. This will be fine if you are only interested in predictions.

  • $\begingroup$ I'm honestly not sure how common this is as it's my first project in this domain. the number of observations is pretty small - only 45. The dataset is a publicly available one: metabolomicsworkbench.org/data/… $\endgroup$ Commented Jul 28, 2022 at 12:43
  • $\begingroup$ OK, I get it. I edited my answer. $\endgroup$
    – FP0
    Commented Jul 29, 2022 at 0:05

If you were going for prediction, I would have suggested some regularization approach.

In a context of Null Hypothesis Significance Testing (NHST), you may want to look at the collinearity diagnostics of Belsley, Kuh and Welsch. In contrast to VIF, they also reveal which groups of predictors are closely associated. This makes deciding how to "thin out" your predictor set much more focused. The disadvantage is that BKW is quite a bit more complicated. And I don't know how well it works with 2000 predictors.

Alternatively, you could use a dimension reduction technique like PCA and run your logistic regression on the first few principal components. The disadvantage here is that you get the p values of the principal components, not of your original data.

Finally, NHST really presupposes you have predefined hypotheses in the context of a planned experiment. If you really want to feed in 2000 predictors and assess whether any coefficient is nonzero, perhaps you should go back to the planning stage and plan your experimental controls more carefully.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.