Model summary output from grouped analysis of any function that
has data
argument in its function call.
Arguments
- data
Dataframe (or tibble) from which variables are to be taken.
- grouping.vars
Grouping variables.
- ..f
A function, or function name as a string.
- ...
<dynamic> Arguments for
.fn
.
Examples
set.seed(123)
library(dplyr)
# linear mixed effects model
grouped_glance(
data = mutate(MASS::Aids2, interval = death - diag),
grouping.vars = sex,
..f = lme4::lmer,
formula = interval ~ age + (1 | status),
control = lme4::lmerControl(optimizer = "bobyqa")
)
#> # A tibble: 2 × 8
#> sex nobs sigma logLik AIC BIC REMLcrit df.residual
#> <fct> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 F 89 415. -656. 1321. 1331. 1313. 85
#> 2 M 2754 355. -20079. 40165. 40189. 40157. 2750