Skip to contents

produce a flextable describing a linear model produced by function lm.

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

Usage

# S3 method for class 'lm'
as_flextable(x, ...)

Arguments

x

lm model

...

unused argument

Examples

if (require("broom")) {
  lmod <- lm(rating ~ complaints + privileges +
    learning + raises + critical, data = attitude)
  ft <- as_flextable(lmod)
  ft
}

Estimate

Standard Error

t value

Pr(>|t|)

(Intercept)

11.011

11.704

0.941

0.3562

complaints

0.692

0.149

4.649

0.0001

***

privileges

-0.104

0.135

-0.769

0.4496

learning

0.249

0.160

1.560

0.1318

raises

-0.033

0.202

-0.165

0.8700

critical

0.015

0.147

0.105

0.9171

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

Residual standard error: 7.139 on 24 degrees of freedom

Multiple R-squared: 0.7154, Adjusted R-squared: 0.6561

F-statistic: 12.06 on 24 and 5 DF, p-value: 0.0000