Skip to contents

produce a flextable describing a mixed model. The function is only using package 'broom.mixed' that provides the data presented in the resulting flextable.

You can remove significance stars by setting options options(show.signif.stars = FALSE).

Usage

# S3 method for merMod
as_flextable(x, add.random = TRUE, ...)

# S3 method for lme
as_flextable(x, add.random = TRUE, ...)

# S3 method for gls
as_flextable(x, add.random = TRUE, ...)

# S3 method for nlme
as_flextable(x, add.random = TRUE, ...)

# S3 method for brmsfit
as_flextable(x, add.random = TRUE, ...)

# S3 method for glmmTMB
as_flextable(x, add.random = TRUE, ...)

# S3 method for glmmadmb
as_flextable(x, add.random = TRUE, ...)

Arguments

x

a mixed model

add.random

TRUE or FALSE, if TRUE random effects are added to the table.

...

unused argument

Examples

if (require("broom.mixed") && require("nlme")) {
  m1 <- lme(distance ~ age, data = Orthodont)
  ft <- as_flextable(m1)
  ft
}
#> Loading required package: broom.mixed

group

Estimate

Standard Error

df

statistic

p-value

Fixed effects

(Intercept)

16.761

0.775

80

21.620

0.0000

***

age

0.660

0.071

80

9.265

0.0000

***

Random effects

Subject

sd_(Intercept)

2.327

Subject

cor_age.(Intercept)

-0.609

Subject

sd_age

0.226

Residual

sd_Observation

1.310

Signif. codes: 0 <= '***' < 0.001 < '**' < 0.01 < '*' < 0.05

square root of the estimated residual variance: 1.3

data's log-likelihood under the model: -221.3

Akaike Information Criterion: 454.6

Bayesian Information Criterion: 470.6