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

Add methods for glm() #211

Closed
juliasilge opened this issue Feb 8, 2022 · 2 comments · Fixed by #212
Closed

Add methods for glm() #211

juliasilge opened this issue Feb 8, 2022 · 2 comments · Fixed by #212
Labels
feature a feature request or enhancement

Comments

@juliasilge
Copy link
Member

Right now a glm() model inherits from the lm() butchering methods, but there are still some things leftover like residuals:

library(butcher)

more_cars <- mtcars[rep(1:32, each = 1000),]
mod <- glm(mpg ~ ., data = more_cars, model = TRUE, x = TRUE)
butchered <- butcher(mod)

sum(weigh(mod)$size)
#> [1] 33.68289
sum(weigh(butchered)$size)
#> [1] 30.88575

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

@juliasilge juliasilge added the feature a feature request or enhancement label Feb 8, 2022
@juliasilge
Copy link
Member Author

juliasilge commented Feb 8, 2022

Here are some environments that need to be stripped out:

`environment(actual$model$family$variance)` is <env:0x145546700>
`environment(expected$model$family$variance)` is <env:0x135739b28>

`environment(actual$model$family$dev.resids)` is <env:0x145546700>
`environment(expected$model$family$dev.resids)` is <env:0x135739b28>

`environment(actual$model$family$aic)` is <env:0x145546700>
`environment(expected$model$family$aic)` is <env:0x135739b28>

`environment(actual$model$family$validmu)` is <env:0x145546700>
`environment(expected$model$family$validmu)` is <env:0x135739b28>

@github-actions
Copy link

github-actions bot commented Apr 2, 2022

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant