Description Usage Arguments Details
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.
1 |
method |
a srting of method of the generic function |
... |
augments which pass on each method. |
There are four methods.
fe
methodUsing 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:
y
: a formula whose rhs is outcome (y ~ .
)
x
: a formula whose lhs is covariates (~ x1 + x2
)
z
: a formula whose rhs is endogenous variable
and lhs is exogenous variable (x3 ~ z
)
fixef
: a formula whose lhs is fixed effects (~ fix1 + fix2
)
cluster
: a formula whose lhs is cluster variable (~ clust1
)
data
: a object whose class is data.frame
.
pkg
: a string of package. Default is "fixest"
se
: method of caclulation of se (only fixest
pkg).
the augment se
passes a character scalar:
"standard", "hetero", "cluster", "twoway", "threeway" or "fourway."
By default if there are clusters in the estimation: se = "cluster";
otherwise se = "standard".
lpm
methodUsing 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.
y
: a formula whose rhs is outcome (y ~ .
)
x
: a formula whose lhs is covariates (~ x1 + x2
)
d
: a formula whose lhs is treatment variable (~ d
).
data
: an object whose class is data.frame
ols
methodUsing 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.
y
: a formula whose rhs is outcome (y ~ .
)
x
: a formula whose lhs is covariates (~ x1 + x2
)
d
: a formula whose lhs is treatment variable (~ d
).
data
: an object whose class is data.frame
binomial
methodUsing 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.
y
: a formula whose rhs is outcome (y ~ .
)
x
: a formula whose lhs is covariates (~ x1 + x2
)
link
: character string: "logit"
or "probit"
.
data
: an object whose class is data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.