reg: Unified regression analysis

Description Usage Arguments Details

View source: R/reg.r

Description

This function implements various regression analysis, especially econometrics. This function has some advantages. (1) Unifying augments. By just changing method augment, you can use other regression analyses. (2) Specifying each components of formula. You can easily incorporate this function in a loop system.

Usage

1
reg(method, ...)

Arguments

method

a srting of method of the generic function reg

...

augments which pass on each method.

Details

There are four methods.

fe method

Using the package lfe or fixest, you implement the fixed effect, and the panel IV model. In addition to original class, a returned object also has a class fe_felm (lfe pkg) or fe_fixest (fixest pkg). Thus, you can use summary(). You can pass following augments on this method:

lpm method

Using the lm() in the stats package, you implement the linear proability model. To claculate robust standard errors, this method uses coeftest in the lmtest pkg, and vcovHC in the sandwich pkg. If treatment variable is specified, you can estimate this model without covariates and with covariates. A returned object is a list which includes lm result called fit, robust se test called test, and treatment variable formula called treat (if specified). The returned object has lpm class in addition to original classes. If treatment variable is specified, we add RCT class. You can pass following augments on this method.

ols method

Using the lm in the stats package, you implement the linear regression model. If treatment variable is specified, you can estimate this model without covariates and with covariates. A returned object is a list which includes lm result called fit, and treatment variable formula called treat (if specified). The returned object has ols class in addition to original classes. If treatment variable is specified, we add RCT class. You can pass following augments on this method.

binomial method

Using the glm in the stats package, you implement the logit or probit model. A returned object has binomial class in addition to original classes. You can pass following augments on this method.


KatoPachi/Rkato documentation built on Dec. 18, 2021, 2:42 a.m.