GLM_summary: Tidy report of GLM ('lm' and 'glm' models).

View source: R/bruceR-stats_4_regress.R

GLM_summaryR Documentation

Tidy report of GLM (lm and glm models).

Description

NOTE: model_summary is preferred.

Usage

GLM_summary(model, robust = FALSE, cluster = NULL, digits = 3, ...)

Arguments

model

A model fitted with lm or glm function.

robust

[Only for lm and glm] FALSE (default), TRUE (then the default is "HC1"), "HC0", "HC1", "HC2", "HC3", "HC4", "HC4m", or "HC5". It will add a table with heteroskedasticity-robust standard errors (aka. Huber-White standard errors). For details, see ?sandwich::vcovHC and ?jtools::summ.lm.

*** "HC1" is the default of Stata, whereas "HC3" is the default suggested by the sandwich package.

cluster

[Only for lm and glm] Cluster-robust standard errors are computed if cluster is set to the name of the input data's cluster variable or is a vector of clusters.

digits

Number of decimal places of output. Defaults to 3.

...

Other arguments. You may re-define formula, data, or family.

Value

No return value.

See Also

print_table (print simple table)

model_summary (highly suggested)

HLM_summary

regress

Examples

## Example 1: OLS regression
lm = lm(Temp ~ Month + Day + Wind + Solar.R, data=airquality)
GLM_summary(lm)
GLM_summary(lm, robust="HC1")
# Stata's default is "HC1"
# R package <sandwich>'s default is "HC3"

## Example 2: Logistic regression
glm = glm(case ~ age + parity + education + spontaneous + induced,
          data=infert, family=binomial)
GLM_summary(glm)
GLM_summary(glm, robust="HC1", cluster="stratum")


bruceR documentation built on June 22, 2024, 12:26 p.m.