Computes the confidence intervals of parameter estimates for fixest's multiple
estimation objects (aka fixest_multi).
Usage
# S3 method for class 'fixest_multi'
confint(
object,
parm,
level = 0.95,
vcov = NULL,
se = NULL,
cluster = NULL,
ssc = NULL,
...
)Arguments
- object
A
fixest_multiobject 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_conleyandconley. It also accepts covariance matrices computed externally. Finally it accepts functions to compute the covariances. See thevcovdocumentation 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 usevcovinstead.- 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
var1andvar2contained in the data.framebaseused for the estimation. All the followingclusterarguments 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^var2orcluster = "var1^var2".- ssc
An object of class
ssc_typeobtained with the functionssc. Represents how the small sample correction should be done. You must use the functionsscfor this argument. The arguments and defaults of the functionsscare:K.adj = TRUE,K.fixef = "nonnested",G.adj = TRUE,G.df = "min",t.df = "min",K.exact = FALSE). See the help of the functionsscfor details. Not all VCOV types are affected by this argument.- ...
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)]
#> x.1 x.2
#> Dependent Var.: y y
#>
#> Constant 1.856*** (0.2508)
#> x1 0.6508*** (0.0667) 0.4959*** (0.0861)
#> x2 0.7091*** (0.0567) 0.8292*** (0.0685)
#> x3 -0.5565*** (0.1275) -0.3152* (0.1512)
#> Fixed-Effects: ------------------- ------------------
#> species No Yes
#> _______________ ___________________ __________________
#> S.E. type IID IID
#> Observations 150 150
#> R2 0.85861 0.86731
#> Within R2 -- 0.65201
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1