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

supporting mgcv::gam models in check_model #103

Open
IndrajeetPatil opened this issue Mar 25, 2021 · 4 comments
Open

supporting mgcv::gam models in check_model #103

IndrajeetPatil opened this issue Mar 25, 2021 · 4 comments
Labels
Enhancement 💥 New feature or request

Comments

@IndrajeetPatil
Copy link
Member

Came across this slide in this presentation: https://chrismainey.github.io/Why_mgcv_is_awesome/Why_data_table_is_awesome.html#1

Screenshot 2021-03-25 at 15 40 13

and thought maybe we can also support something similar in check_model?

library(mgcv)
#> Loading required package: nlme
#> This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.
set.seed(0)
dat <- gamSim(1, n = 200)
#> Gu & Wahba 4 term additive model
b <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)

library(performance)

check_model(b)
#> Error in data.frame(Parameter = terms, VIF = result, SE_factor = sqrt(result), : arguments imply differing number of rows: 0, 1

Created on 2021-03-25 by the reprex package (v1.0.0)

@IndrajeetPatil IndrajeetPatil added the Enhancement 💥 New feature or request label Mar 25, 2021
@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Mar 26, 2021

imho GAMs are the future of psych stats (I predict that it'll be the next big thing after the [still] current mixed model wave), so providing good support for them across easystats is a good bet

@strengejacke
Copy link
Member

It works, but I can't say how sensible / valid the results are, since I simply used the same approach as for (g)lm's when computing qq-plots etc.

@strengejacke
Copy link
Member

library(mgcv)
#> Loading required package: nlme
#> This is mgcv 1.8-38. For overview type 'help("mgcv-package")'.
library(performance)

set.seed(0)
dat <- gamSim(1, n = 200)
#> Gu & Wahba 4 term additive model
b <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
check_model(b)

Created on 2022-02-26 by the reprex package (v2.0.1)

We probably could ask Gavin Simpson here?

@bwiernik
Copy link
Contributor

Let's swap out the qq plot for a dharma qq plot and I think we are good

@strengejacke strengejacke reopened this Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💥 New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants