extract.lm: Extract statistics from lm object

View source: R/dthelper-reporting.R View source: R/dthelper-functions.R

extract.lmR Documentation

Extract statistics from lm object

Description

gets summary() of lm object and returns specified statistics from coefficient table

Usage

extract.lm(
  lm.model,
  var = c("Estimate", "Std. Error", "t value", "Pr(>|t|)"),
  include.intercept = TRUE
)

Arguments

lm.model

lm object

var

Variable. Set to "Estimate", "Std. Error", "t value", or "Pr(>|t|)"

include.intercept

If set to FALSE, ignores estimates from intercept

Value

A vector

Examples

lm.model <- lm(y ~ x)
extract.lm(lm.model, var = "Estimate")
extract.lm(lm.model, var = "Std. Error")
extract.lm(lm.model, var = "Pr(>|t|)")

dennisteowh/dthelper documentation built on March 19, 2022, 11:42 a.m.