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

Plotting model_parameters() output for gam objects #888

Open
fabianstamp opened this issue Jul 18, 2023 · 0 comments
Open

Plotting model_parameters() output for gam objects #888

fabianstamp opened this issue Jul 18, 2023 · 0 comments
Labels
bug 🐛 Something isn't working

Comments

@fabianstamp
Copy link

Calling plot(model_parameters(model)) for generalized additive models does not seem to be supported so far. Is there any way to make this work?

# example data
df <- tibble::tibble(
 name = rep(c("name1",
                      "name2",
                      "name3",
                      "name4",
                      "name5"),
                      times = 200),
 Y= sample(x = 1000000:10000000, size = 1000),
 A = rep(c(0, 1), times = 500),
 B = rep(c(1, 2, 3, 4, 5,6,7,8,9,10), times = 100),
 C = rep(c(10, 20, 30, 40, 50,60,70,80,90,100), times = 100))


# linear model
model_lm <- stats::lm(Y~ B + C, data = df)

# parameters
model_parameters(
  model_lm)

# plot parameters
plot(model_parameters(
  model_lm))

# gam
model_gam <- mgcv::gam(Y~ s(B) + s(C), data = df)

# parameters
model_parameters(
  model_gam)

# plot parameters (this does not work)
plot(model_parameters(
  model_gam))`

Running this will returns

Error in if (all(x$group == "TRUE")) { : missing value where TRUE/FALSE needed
@strengejacke strengejacke added the bug 🐛 Something isn't working label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants