reg: Replicate STATA Regressions

Description Usage Arguments Value Examples

Description

reg replicates STATA regressions including regressions with robust standard errors and clustered standard errors.

Usage

1
reg(formula, data, robust = FALSE, cluster = NULL)

Arguments

formula

A formula providing the specifications for your model.

data

A data frame on which to run your regression.

robust

A logical value to indicate if the model should use robust standard errors.

cluster

A character vector to specify up to two variables by which to cluster standard errors.

Value

A data frame with one row for each independent variable and columns containing the estimated coefficients and the associated standard errors, t-statistics, and p-values.

Examples

1
2
3
reg(y ~ x, my_data, robust = TRUE)
reg(y ~ x, my_data, cluster = "variable")
reg(y ~ x, my_data, cluster = c("variable_1", "variable_2"))

joevanderlans/regr documentation built on May 12, 2019, 2:02 p.m.