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

tidy Error if glm.fit Used #1234

Open
DarioS opened this issue Dec 17, 2024 · 1 comment
Open

tidy Error if glm.fit Used #1234

DarioS opened this issue Dec 17, 2024 · 1 comment

Comments

@DarioS
Copy link

DarioS commented Dec 17, 2024

glm.fit is useful when the model matrix has already been created.

glm.fit is the workhorse function: it is not normally called directly but can be more efficient
where the response vector, design matrix and family have already been calculated.

However, this has been overlooked for the tidy function, even though it has See Also: stats::glm() which has both GLM functions.

fit <- glm.fit(mtcars[, 1:5], mtcars[, "vs"], family = binomial())
> tidy(fit)
Error: No tidy method recognized for this list.

> summary(fit)
                  Length Class  Mode   
coefficients       5     -none- numeric
residuals         32     -none- numeric
fitted.values     32     -none- numeric
effects           32     -none- numeric
R                 25     -none- numeric
rank               1     -none- numeric
qr                 5     qr     list   
family            13     family list   
linear.predictors 32     -none- numeric
deviance           1     -none- numeric
aic                1     -none- numeric
null.deviance      1     -none- numeric
iter               1     -none- numeric
weights           32     -none- numeric
prior.weights     32     -none- numeric
df.residual        1     -none- numeric
df.null            1     -none- numeric
y                 32     -none- numeric
converged          1     -none- logical
boundary           1     -none- logical

Arguably, glm.fit needs tidying much more than glm does, which already has a nice summary function.

@simonpcouch
Copy link
Collaborator

Thanks for the issue! broom indeed doesn't support these model objects.

Unfortunately, as of the 1.0.0 release of the package, we're not accepting new tidiers to broom. Further, supporting glm.fit would additionally be a bit wonky in that its S3 class is "list", so we couldn't just define an S3 method through the usual machinery. Since the slant of this function seems developer / advanced user–focused, I'm not too inclined to introduce tidiers for those objects.

Will leave this open to revisit when I'm focused on broom.

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

2 participants