Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Undefined columns selected" in compare.fits when trying to show models with poly() #120

Open
amazingoats opened this issue Jul 26, 2023 · 0 comments

Comments

@amazingoats
Copy link

Hi Dustin,
I have models that contain the poly() function, and they won't work in compare.fits unless I've added another model first that doesn't contain the poly() function. I would like to just be able to model them on their own or compare them to other models with the poly() function, but it gives me an error.

For example:
m1 = lm(Var1 ~ Var2 + Var3 + poly(Var3, degree=3) ,data=d)
m2 = lm(Var1 ~ Var2 + Var3 + I(Var3^3), data=d)

If I enter: compare.fits(Var1Var3 | Var2, data=d, m2) - It works
If I enter: compare.fits(Var1
Var3 | Var2, data=d, m2, m1) - It works

If I enter: compare.fits(Var1Var3 | Var2, data=d, m1) or compare.fits(Var1Var3 | Var2, data=d, m1, m2)

I get this error:
Error in purrr::map():
ℹ In index: 1.
Caused by error in [.data.frame:
! undefined columns selected
Backtrace:

  1. flexplot::compare.fits(...)
  2. purrr::map(., return_constant_for_predicted_data, data = k, model = model)
  3. purrr:::map_("list", .x, .f, ..., .progress = .progress)
  4. flexplot (local) .f(.x[[i]], ...)
  5. base::[.data.frame(data, , missing_variable)
  6. base::stop("undefined columns selected")

Any help would be appreciated! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant