Extract fixed effects parameters, variance estimates etc.

extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = NULL,
  digits = 3,
  exponentiate = FALSE,
  ...
)

# S3 method for merMod
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = list(method = "Wald"),
  digits = 3,
  exponentiate = FALSE,
  ...,
  p_value = "Wald"
)

# S3 method for glmmTMB
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = NULL,
  digits = 3,
  ...,
  exponentiate = FALSE,
  component = "cond"
)

# S3 method for lme
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = list(method = "Wald"),
  digits = 3,
  exponentiate = FALSE,
  ...
)

# S3 method for brmsfit
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = NULL,
  digits = 3,
  exponentiate = FALSE,
  ...,
  component = NULL
)

# S3 method for stanreg
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = NULL,
  digits = 3,
  exponentiate = FALSE,
  ...,
  component = NULL
)

# S3 method for gam
extract_fixed_effects(
  model,
  ci_level = 0.95,
  ci_args = list(method = "Wald"),
  digits = 3,
  exponentiate = FALSE,
  ...
)

extract_fixef(
  model,
  ci_level = 0.95,
  ci_args = NULL,
  digits = 3,
  exponentiate = FALSE,
  ...
)

Arguments

model

An lme4, glmmTMB, nlme, mgcv, or brms model.

ci_level

Confidence level < 1, typically above 0.90. A value of 0 will not report it (except for gam objects, which will revert to .95 due to gam.vcomp). Default is .95.

ci_args

Additional arguments to the corresponding confint method.

digits

Rounding. Default is 3.

exponentiate

Exponentiate the fixed-effect coefficient estimates and confidence intervals (common for logistic regression). If TRUE, also scales the standard errors by the exponentiated coefficient, transforming them to the new scale.

...

Other stuff to pass to the corresponding method.

p_value

For lme4 models, one of 'Wald' or 'KR'. See details.

component

For glmmTMB objects, which of the three components 'cond' or 'zi' to select. Default is 'cond'. For brmsfit (and experimentally, rstanarm) objects, this can filter results to a certain part of the output, e.g. 'sigma' or 'zi' of distributional models, or a specific outcome of a multivariate model. In this case component is a regular expression that begins parameters of the output.

Value

A data.frame with the fixed effects and associated statistics.

Details

Essentially duplicates the broom::tidy approach with minor name changes. For lme4, 'Wald' p-values are provided lmer models for consistency with others, but there is much issue with them, especially for low N/small numbers of groups. The Kenward-Roger is also available if the pbkrtest package is installed (experimental). For either case, Only the p-value from the process is provide, all other output is default provided lme4 without adjustment.

Note

extract_fixef is an alias.

For nlme, this is just a multiplier based on the estimated standard error and critical value for the ci_level.

Examples

library(lme4)
library(mixedup)

lmer_mod <- lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)

extract_fixed_effects(lmer_mod)
#> # A tibble: 2 × 7
#>   term      value    se     t p_value lower_2.5 upper_97.5
#>   <chr>     <dbl> <dbl> <dbl>   <dbl>     <dbl>      <dbl>
#> 1 Intercept 251.   6.82 36.8        0    238.        265. 
#> 2 Days       10.5  1.55  6.77       0      7.44       13.5