reg: Stata-style Regression Modelling Function

Description Usage Arguments Details Value See Also

Description

This is a slim wrapper around various regression modelling functions that simplifies the process of estimating regression equations with various robust variance-covariance estimation procedures. This negates the need for the two-step exercise of summary(lm(...)) to view results. It also supports survey design objects through the same interface. Reversing the typical formula-data argument order to data-argument order makes the function easily usable within a data analysis “pipeline”.

Usage

1
2
3
reg(data, formula, ..., vcov_type = if (is.null(vcov_cluster)) "const" else
  "HC0", vcov_cluster = NULL, boot_iterations = 1000L, digits = 2L,
  signif.stars = FALSE)

Arguments

data

A data frame, or “survey design” object from the survey package.

formula

A model formula.

...

Additional arguments passed to glm or svyglm.

vcov_type

A character string specifying a variance-covariance estimation procedure. See vcovHC.

vcov_cluster

If non-NULL, a formula specifying a clustering variable to be used for clustered standard errors.

boot_iterations

If vcov_type = "boot", an integer specifying the number of bootstrap iterations.

digits

An integer specifying the preferred number of digits to use when printing the output (passed to print.reg).

signif.stars

A logical specifying whether to print significance stars. Passed to print.reg.

Details

Estimation is provided by glm and svyglm, respectively.

Value

A “reg” object, which contains a traditional R modelling object in element “model”.

See Also

summary.reg


leeper/reggie documentation built on May 12, 2019, 12:31 a.m.