Error in str2lang and olsrr

Can someone tell me, what should I do in this situation?

First, restart R and confirm that the model ran

summary(model)

If so, model is class(lm) and ols_vif_tol(model) should run.

still the same, i can't run the data on ols_vif_tol(model)
Error in str2lang(x) : attempt to use zero-length variable name

am i wrong somewhere?

Try running the example

# model
model <- lm(mpg ~ disp + hp + wt + drat, data = mtcars)

# vif and tolerance
ols_vif_tol(model)

in a fresh R session. You should get

suppressPackageStartupMessages({
  library(olsrr)
})
# model
model <- lm(mpg ~ disp + hp + wt + drat, data = mtcars)

# vif and tolerance
ols_vif_tol(model)
#>   Variables Tolerance      VIF
#> 1      disp 0.1218116 8.209402
#> 2        hp 0.3454979 2.894373
#> 3        wt 0.1962092 5.096601
#> 4      drat 0.4386836 2.279547

Created on 2021-01-02 by the reprex package (v0.3.0.9001)

If not, olsrr may be corrupt and I'd try re-installing it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.