Closed yuryzablotski closed 1 year ago
broom::tidy()
model.matrix()
model.frame()
terms()
I didn't inspect the internals of the object though
(phi)
is being incorrectly categorized as the intercept
tidy_add_reference_rows()
is run.I explored quickly beta regression.
By the way, a nice introduction: https://www.andrewheiss.com/blog/2021/11/08/beta-regression-guide/
Beta regression have something similar with zero-inflated Poisson models, there are multi-components models, as you model both the mean and phi, each could have their own coefficients. Here, (phi) is properly interpreted as an intercept, but this is the intercept of another component.
I will therefore explore it and include betareg support in #233. Next week I'll be on leave but will explore it later after the 12 of August.
A related issue for gtsummary
is https://github.com/ddsjoberg/gtsummary/issues/1540
Adding pairwise contrasts for such model is another question. Let's start with basic support and then see if pairwise contrast could be added or not.
Hi guys, beta regression can't be processed with tbl_regression(). Would be nice if it worked:
d <- mtcars %>% mutate(mpg = mpg/100, cyl = factor(cyl))
library(betareg) m <- betareg(mpg ~ cyl, data = d)
plot_model(m, type = "pred")
library(emmeans) emmeans(m, pairwise ~ cyl, type = "response")
library(gtsummary) tbl_regression(m, add_pairwise_contrasts = T)
The error message on my computer is:
Error in
dplyr::left_join()
: ! Join columns inx
must be present in the data. ✖ Problem withvariable
. Backtrace:Thanks upfront! Love gtsummary!!!