This functions defines or extracts the default type of standard-errors to computed in
fixest summary, and vcov.
setFixest_vcov(
no_FE = "iid",
one_FE = "iid",
two_FE = "iid",
panel = "iid",
all = NULL,
reset = FALSE
)
getFixest_vcov()Character scalar equal to either: "iid" (default), or "hetero". The type
of standard-errors to use by default for estimations without fixed-effects.
Character scalar equal to either: "iid" (default), "hetero", or "cluster".
The type of standard-errors to use by default for estimations with one fixed-effect.
Character scalar equal to either: "iid" (default), "hetero", "cluster", or
"twoway". The type of standard-errors to use by default for estimations with two or more
fixed-effects.
Character scalar equal to either: "iid" (default), "hetero", "cluster", or
"driscoll_kraaay". The type of standard-errors to use by default for estimations with the
argument panel.id set up. Note that panel has precedence over the presence of fixed-effects.
Character scalar equal to either: "iid", or "hetero" (or "cluster" if
the argument no_FE is provided).
By default is is NULL. If provided, it sets all the SEs to that value.
Logical, default is FALSE. Whether to reset to the default values.
The function getFixest_vcov() returns a list with three elements containing the default for
estimations i) without, ii) with one, or iii) with two or more fixed-effects.
# By default: 'standard' VCOVs
data(base_did)
est_no_FE = feols(y ~ x1, base_did)
est_one_FE = feols(y ~ x1 | id, base_did)
est_two_FE = feols(y ~ x1 | id + period, base_did)
est_panel = feols(y ~ x1 | id + period, base_did, panel.id = ~id + period)
etable(est_no_FE, est_one_FE, est_two_FE)
#> est_no_FE est_one_FE est_two_FE
#> Dependent Var.: y y y
#>
#> Constant 1.989*** (0.1492)
#> x1 0.9831*** (0.0501) 0.9615*** (0.0514) 0.9779*** (0.0473)
#> Fixed-Effects: ------------------ ------------------ ------------------
#> id No Yes Yes
#> period No No Yes
#> _______________ __________________ __________________ __________________
#> S.E. type IID IID IID
#> Observations 1,080 1,080 1,080
#> R2 0.26304 0.38715 0.48696
#> Within R2 -- 0.26507 0.30776
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Changing the default standard-errors
setFixest_vcov(no_FE = "hetero", one_FE = "cluster",
two_FE = "twoway", panel = "drisc")
etable(est_no_FE, est_one_FE, est_two_FE, est_panel)
#> est_no_FE est_one_FE est_two_FE
#> Dependent Var.: y y y
#>
#> Constant 1.989*** (0.1490)
#> x1 0.9831*** (0.0510) 0.9615*** (0.0481) 0.9779*** (0.0342)
#> Fixed-Effects: ------------------ ------------------ ------------------
#> id No Yes Yes
#> period No No Yes
#> _______________ __________________ __________________ __________________
#> S.E. type Heteroskedas.-rob. by: id by: id & period
#> Observations 1,080 1,080 1,080
#> R2 0.26304 0.38715 0.48696
#> Within R2 -- 0.26507 0.30776
#>
#> est_panel
#> Dependent Var.: y
#>
#> Constant
#> x1 0.9779*** (0.0242)
#> Fixed-Effects: ------------------
#> id Yes
#> period Yes
#> _______________ __________________
#> S.E. type Drisco.-Kra. (L=1)
#> Observations 1,080
#> R2 0.48696
#> Within R2 0.30776
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Resetting the defaults
setFixest_vcov(reset = TRUE)