Tidy output from grouped analysis of any function that has data argument in its function call.

grouped_tidy(data, grouping.vars, ..f, ..., tidy.args = list())

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.

tidy.args

A list of arguments to be used in the relevant S3 method.

Value

A tibble::tibble() with information about model components.

Methods

See the following help topics for more details about individual methods:broom

broom.mixed

See also

Examples

set.seed(123) # linear mixed effects model broomExtra::grouped_tidy( data = dplyr::mutate(MASS::Aids2, interval = death - diag), grouping.vars = sex, ..f = lme4::lmer, formula = interval ~ age + (1 | status), control = lme4::lmerControl(optimizer = "bobyqa"), tidy.args = list(conf.int = TRUE, conf.level = 0.99) )
#> # A tibble: 8 x 9 #> sex effect group term estimate std.error statistic conf.low #> <fct> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 F fixed NA (Intercept) 623. 161. 3.88 209. #> 2 F fixed NA age -4.34 2.61 -1.66 -11.1 #> 3 F ran_pars status sd__(Intercept) 169. NA NA NA #> 4 F ran_pars Residual sd__Observation 415. NA NA NA #> 5 M fixed NA (Intercept) 553. 62.5 8.84 392. #> 6 M fixed NA age -3.60 0.696 -5.17 -5.39 #> 7 M ran_pars status sd__(Intercept) 79.8 NA NA NA #> 8 M ran_pars Residual sd__Observation 355. NA NA NA #> conf.high #> <dbl> #> 1 1037. #> 2 2.38 #> 3 NA #> 4 NA #> 5 714. #> 6 -1.80 #> 7 NA #> 8 NA