-
Notifications
You must be signed in to change notification settings - Fork 43
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
replacing {broom}
and {broom.mixed}
tidiers with {parameters}
package to reduce no. of dependencies
#152
Comments
I like the general idea but this would be a massive change and I'm not sure it's worth it. A lot of the current codebase depends on the output from broom looking exactly as it does now, so it would require considerable refactoring. For example, the The other thing that worries me a little bit is just that broom is a really established package with considerable support around maintaining it. I've never really looked into parameters. It looks like it's pretty well maintained too. But it would still worry me a bit. So I guess I'm leaning toward no thanks, but I'm happy to engage in the conversation a bit more. |
Hmm, that's a fair point. This is indeed a context where the
As someone who has contributed to both of these packages, I can vouch for the rigor and speed at which
We can revisit this when |
Sounds good to me. Thanks. |
This comment has been minimized.
This comment has been minimized.
Okay, I appreciate it. I'm hoping to come back to work on some bugs and things here in the next couple weeks. I suppose we could use the GitHub version as a dependency for now and then wait until they push to CRAN before our next release. |
Just wanted to post another reprex, this time with CRAN versions of both packages. As far as I can see, there are just two (IMO) minor differences, but not sure how much difference it makes to your code:
library(lme4)
#> Loading required package: Matrix
library(broom.mixed)
library(tibble)
library(parameters)
options(tibble.width = Inf)
mod <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
# `broom.mixed` output --------------------------------
tidy(mod)
#> # A tibble: 6 x 6
#> effect group term estimate std.error statistic
#> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 fixed <NA> (Intercept) 251. 6.82 36.8
#> 2 fixed <NA> Days 10.5 1.55 6.77
#> 3 ran_pars Subject sd__(Intercept) 24.7 NA NA
#> 4 ran_pars Subject cor__(Intercept).Days 0.0656 NA NA
#> 5 ran_pars Subject sd__Days 5.92 NA NA
#> 6 ran_pars Residual sd__Observation 25.6 NA NA
# `parameters` output ---------------------------------
# (with further modications to match `broom` conventions)
model_parameters(mod, effects = "all") %>%
standardize_names(style = "broom") %>%
as_tibble()
#> # A tibble: 6 x 11
#> term estimate std.error conf.level conf.low conf.high
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 (Intercept) 251. 6.82 0.95 238. 265.
#> 2 Days 10.5 1.55 0.95 7.42 13.5
#> 3 SD (Intercept) 24.7 NA 0.95 NA NA
#> 4 SD (Days) 5.92 NA 0.95 NA NA
#> 5 Cor (Intercept~Days: Subject) 0.0656 NA 0.95 NA NA
#> 6 SD (Observations) 25.6 NA 0.95 NA NA
#> statistic df.error p.value effect group
#> <dbl> <int> <dbl> <chr> <chr>
#> 1 36.8 174 4.37e-84 fixed ""
#> 2 6.77 174 1.88e-10 fixed ""
#> 3 NA NA NA random "Subject"
#> 4 NA NA NA random "Subject"
#> 5 NA NA NA random "Subject"
#> 6 NA NA NA random "Residual" Created on 2021-11-03 by the reprex package (v2.0.1) |
Thanks. Just to be clear, the parameters package handles the models that broom and broom.mixed handle, correct? |
Yes, you can see the list of supported models using this function: insight::supported_models()
#> [1] "aareg" "afex_aov" "AKP"
#> [4] "Anova.mlm" "aov" "aovlist"
#> [7] "Arima" "averaging" "bamlss"
#> [10] "bamlss.frame" "bayesQR" "bayesx"
#> [13] "BBmm" "BBreg" "bcplm"
#> [16] "betamfx" "betaor" "betareg"
#> [19] "BFBayesFactor" "bfsl" "BGGM"
#> [22] "bife" "bifeAPEs" "bigglm"
#> [25] "biglm" "blavaan" "blrm"
#> [28] "bracl" "brglm" "brmsfit"
#> [31] "brmultinom" "btergm" "censReg"
#> [34] "cgam" "cgamm" "cglm"
#> [37] "clm" "clm2" "clmm"
#> [40] "clmm2" "clogit" "coeftest"
#> [43] "complmrob" "confusionMatrix" "coxme"
#> [46] "coxph" "coxph.penal" "coxr"
#> [49] "cpglm" "cpglmm" "crch"
#> [52] "crq" "crqs" "crr"
#> [55] "dep.effect" "DirichletRegModel" "drc"
#> [58] "eglm" "elm" "epi.2by2"
#> [61] "ergm" "feglm" "feis"
#> [64] "felm" "fitdistr" "fixest"
#> [67] "flexsurvreg" "gam" "Gam"
#> [70] "gamlss" "gamm" "gamm4"
#> [73] "garch" "gbm" "gee"
#> [76] "geeglm" "glht" "glimML"
#> [79] "glm" "Glm" "glmm"
#> [82] "glmmadmb" "glmmPQL" "glmmTMB"
#> [85] "glmrob" "glmRob" "glmx"
#> [88] "gls" "gmnl" "HLfit"
#> [91] "htest" "hurdle" "iv_robust"
#> [94] "ivFixed" "ivprobit" "ivreg"
#> [97] "lavaan" "lm" "lm_robust"
#> [100] "lme" "lmerMod" "lmerModLmerTest"
#> [103] "lmodel2" "lmrob" "lmRob"
#> [106] "logistf" "logitmfx" "logitor"
#> [109] "LORgee" "lqm" "lqmm"
#> [112] "lrm" "manova" "MANOVA"
#> [115] "margins" "maxLik" "mclogit"
#> [118] "mcmc" "mcmc.list" "MCMCglmm"
#> [121] "mcp1" "mcp12" "mcp2"
#> [124] "med1way" "mediate" "merMod"
#> [127] "merModList" "meta_bma" "meta_fixed"
#> [130] "meta_random" "metaplus" "mhurdle"
#> [133] "mipo" "mira" "mixed"
#> [136] "MixMod" "mixor" "mjoint"
#> [139] "mle" "mle2" "mlm"
#> [142] "mlogit" "mmlogit" "model_fit"
#> [145] "multinom" "mvord" "negbinirr"
#> [148] "negbinmfx" "ols" "onesampb"
#> [151] "orm" "pgmm" "plm"
#> [154] "PMCMR" "poissonirr" "poissonmfx"
#> [157] "polr" "probitmfx" "psm"
#> [160] "Rchoice" "ridgelm" "riskRegression"
#> [163] "rjags" "rlm" "rlmerMod"
#> [166] "RM" "rma" "rma.uni"
#> [169] "robmixglm" "robtab" "rq"
#> [172] "rqs" "rqss" "Sarlm"
#> [175] "scam" "selection" "sem"
#> [178] "SemiParBIV" "semLm" "semLme"
#> [181] "slm" "speedglm" "speedlm"
#> [184] "stanfit" "stanmvreg" "stanreg"
#> [187] "summary.lm" "survfit" "survreg"
#> [190] "svy_vglm" "svyglm" "svyolr"
#> [193] "t1way" "tobit" "trimcibt"
#> [196] "truncreg" "vgam" "vglm"
#> [199] "wbgee" "wblm" "wbm"
#> [202] "wmcpAKP" "yuen" "yuend"
#> [205] "zcpglm" "zeroinfl" "zerotrunc" Created on 2021-11-03 by the reprex package (v2.0.1) |
Thanks, I'll play around with this in a bit. |
Cool! The documentation can be found here: https://easystats.github.io/parameters/ |
Only in the printed output. That's because parameters uses an empty string in |
broom
tidiers with parameters
to reduce no. of dependencies{broom}
and {broom.mixed}
tidiers with {parameters}
package to reduce no. of dependencies
I would find this helpful--easystats is quickly becoming a huge part of my workflow and it would open up a huge number of classes to switch to {parameters} instead. |
Before making a PR related to this, I was wondering if you would be open to this. If you agree, I will open a PR.
rationale
parameters
(https://easystats.github.io/parameters/) has way fewer dependencies and can handle pretty much every model thatbroom
andbroom.mixed
combined support. It offers a number of other additional features not inbroom
(e.g., robust SEs, standardization, etc.)dependency calculations
Created on 2021-11-03 by the reprex package (v2.0.1)
example with
merMod
example with
lm
Created on 2021-02-18 by the reprex package (v1.0.0)
The text was updated successfully, but these errors were encountered: