Computes the confidence intervals of parameter estimates for fixest
's multiple
estimation objects (aka fixest_multi
).
Usage
# S3 method for fixest_multi
confint(
object,
parm,
level = 0.95,
vcov = NULL,
se = NULL,
cluster = NULL,
ssc = NULL,
...
)
Arguments
- object
A
fixest_multi
object obtained from a multiple estimation infixest
.- parm
The parameters for which to compute the confidence interval (either an integer vector OR a character vector with the parameter name). If missing, all parameters are used.
- level
The confidence level. Default is 0.95.
- vcov
Versatile argument to specify the VCOV. In general, it is either a character scalar equal to a VCOV type, either a formula of the form:
vcov_type ~ variables
. The VCOV types implemented are: "iid", "hetero" (or "HC1"), "cluster", "twoway", "NW" (or "newey_west"), "DK" (or "driscoll_kraay"), and "conley". It also accepts object fromvcov_cluster
,vcov_NW
,NW
,vcov_DK
,DK
,vcov_conley
andconley
. It also accepts covariance matrices computed externally. Finally it accepts functions to compute the covariances. See thevcov
documentation in the vignette.- se
Character scalar. Which kind of standard error should be computed: “standard”, “hetero”, “cluster”, “twoway”, “threeway” or “fourway”? By default if there are clusters in the estimation:
se = "cluster"
, otherwisese = "iid"
. Note that this argument is deprecated, you should usevcov
instead.- cluster
Tells how to cluster the standard-errors (if clustering is requested). Can be either a list of vectors, a character vector of variable names, a formula or an integer vector. Assume we want to perform 2-way clustering over
var1
andvar2
contained in the data.framebase
used for the estimation. All the followingcluster
arguments are valid and do the same thing:cluster = base[, c("var1", "var2")]
,cluster = c("var1", "var2")
,cluster = ~var1+var2
. If the two variables were used as fixed-effects in the estimation, you can leave it blank withvcov = "twoway"
(assumingvar1
[resp.var2
] was the 1st [resp. 2nd] fixed-effect). You can interact two variables using^
with the following syntax:cluster = ~var1^var2
orcluster = "var1^var2"
.- ssc
An object of class
ssc.type
obtained with the functionssc
. Represents how the degree of freedom correction should be done.You must use the functionssc
for this argument. The arguments and defaults of the functionssc
are:adj = TRUE
,fixef.K="nested"
,cluster.adj = TRUE
,cluster.df = "min"
,t.df = "min"
,fixef.force_exact=FALSE)
. See the help of the functionssc
for details.- ...
Not currently used.
Value
It returns a data frame whose first columns indicate which model has been estimated. The last three columns indicate the coefficient name, and the lower and upper confidence intervals.
Examples
base = setNames(iris, c("y", "x1", "x2", "x3", "species"))
est = feols(y ~ csw(x.[,1:3]) | sw0(species), base, vcov = "iid")
confint(est)
#> id fixef rhs coefficient 2.5 % 97.5 %
#> 1 1 1 x1 (Intercept) 5.5798647 7.47258038
#> 2 1 1 x1 x1 -0.5298200 0.08309785
#> 3 2 1 x1 + x2 (Intercept) 1.7590943 2.73918600
#> 4 2 1 x1 + x2 x1 0.4585161 0.73253337
#> 5 2 1 x1 + x2 x2 0.4380915 0.50574857
#> 6 3 1 x1 + x2 + x3 (Intercept) 1.3603752 2.35161975
#> 7 3 1 x1 + x2 + x3 x1 0.5191189 0.78255545
#> 8 3 1 x1 + x2 + x3 x2 0.5970350 0.82122888
#> 9 3 1 x1 + x2 + x3 x3 -0.8085615 -0.30440382
#> 10 4 species x1 x1 0.5933983 1.01372348
#> 11 5 species x1 + x2 x1 0.2713535 0.59308089
#> 12 5 species x1 + x2 x2 0.6486505 0.90260841
#> 13 6 species x1 + x2 + x3 x1 0.3257653 0.66601260
#> 14 6 species x1 + x2 + x3 x2 0.6937939 0.96469395
#> 15 6 species x1 + x2 + x3 x3 -0.6140049 -0.01630542
# focusing only on the coefficient 'x3'
confint(est, "x3")
#> id fixef rhs coefficient 2.5 % 97.5 %
#> 1 3 1 x1 + x2 + x3 x3 -0.8085615 -0.30440382
#> 2 6 species x1 + x2 + x3 x3 -0.6140049 -0.01630542
# the 'id' provides the index of the estimation
est[c(3, 6)]
#> Standard-errors: IID
#> Expl. vars.: x1 + x2 + x3
#> Fixed-effects: 1
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 1.855997 0.250777 7.40098 9.8539e-12 ***
#> x1 0.650837 0.066647 9.76538 < 2.2e-16 ***
#> x2 0.709132 0.056719 12.50248 < 2.2e-16 ***
#> x3 -0.556483 0.127548 -4.36293 2.4129e-05 ***
#> ---
#> Fixed-effects: species
#> Estimate Std. Error t value Pr(>|t|)
#> x1 0.495889 0.086070 5.76147 4.8675e-08 ***
#> x2 0.829244 0.068528 12.10087 < 2.2e-16 ***
#> x3 -0.315155 0.151196 -2.08442 3.8888e-02 *