Summary information for fixest_multi objects. In particular, this is used to specify the type of standard-errors to be computed.
Usage
# S3 method for fixest_multi
summary(
object,
type = "short",
vcov = NULL,
se = NULL,
cluster = NULL,
ssc = NULL,
.vcov = NULL,
stage = 2,
lean = FALSE,
n = 1000,
...
)
Arguments
- object
A
fixest_multi
object, obtained from afixest
estimation leading to multiple results.- type
A character either equal to
"short"
,"long"
,"compact"
,"se_compact"
or"se_long"
. Ifshort
, only the table of coefficients is displayed for each estimation. Iflong
, then the full results are displayed for each estimation. Ifcompact
, adata.frame
is returned with one line per model and the formatted coefficients + standard-errors in the columns. Ifse_compact
, adata.frame
is returned with one line per model, one numeric column for each coefficient and one numeric column for each standard-error. If"se_long"
, same as"se_compact"
but the data is in a long format instead of wide.- vcov, .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.- stage
Can be equal to
2
(default),1
,1:2
or2:1
. Only used if the object is an IV estimation: defines the stage to whichsummary
should be applied. Ifstage = 1
and there are multiple endogenous regressors or ifstage
is of length 2, then an object of classfixest_multi
is returned.- lean
Logical, default is
FALSE
. Used to reduce the (memory) size of the summary object. IfTRUE
, then all objects of length N (the number of observations) are removed from the result. Note that somefixest
methods may consequently not work when applied to the summary.- n
Integer, default is 1000. Number of coefficients to display when the print method is used.
- ...
Not currently used.
Value
It returns either an object of class fixest_multi
(if type
equals short
or long
),
either a data.frame
(if type equals compact
or se_compact
).
See also
The main fixest estimation functions: feols
, fepois
,
fenegbin
, feglm
, feNmlm
. Tools for mutliple fixest
estimations: summary.fixest_multi
, print.fixest_multi
, as.list.fixest_multi
,
sub-sub-.fixest_multi
, sub-.fixest_multi
.
Examples
base = iris
names(base) = c("y", "x1", "x2", "x3", "species")
# Multiple estimation
res = feols(y ~ csw(x1, x2, x3), base, split = ~species)
# By default, the type is "short"
# You can still use the arguments from summary.fixest
summary(res, se = "hetero")
#> Standard-errors: Heteroskedasticity-robust
#>
#> ### Sample: setosa
#>
#> Expl. vars.: x1
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.639001 0.298624 8.83722 1.2326e-11 ***
#> x1 0.690490 0.085903 8.03803 1.9293e-10 ***
#> ---
#> Expl. vars.: x1 + x2
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.303738 0.433561 5.31352 2.8928e-06 ***
#> x1 0.667416 0.092247 7.23508 3.6001e-09 ***
#> x2 0.283419 0.264794 1.07034 2.8993e-01
#> ---
#> Expl. vars.: x1 + x2 + x3
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.351890 0.437230 5.379067 2.4390e-06 ***
#> x1 0.654835 0.092468 7.081774 6.8711e-09 ***
#> x2 0.237560 0.275270 0.863009 3.9261e-01
#> x3 0.252126 0.284622 0.885827 3.8032e-01
#>
#> ### Sample: versicolor
#>
#> Expl. vars.: x1
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 3.539735 0.617019 5.73683 6.3108e-07 ***
#> x1 0.865078 0.220701 3.91969 2.8079e-04 ***
#> ---
#> Expl. vars.: x1 + x2
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.116431 0.431296 4.90714 1.1507e-05 ***
#> x1 0.247642 0.176500 1.40307 1.6717e-01
#> x2 0.735587 0.111386 6.60395 3.2636e-08 ***
#> ---
#> Expl. vars.: x1 + x2 + x3
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 1.895540 0.434294 4.36465 7.1434e-05 ***
#> x1 0.386858 0.207117 1.86782 6.8165e-02 .
#> x2 0.908337 0.159800 5.68420 8.5897e-07 ***
#> x3 -0.679224 0.436600 -1.55571 1.2663e-01
#>
#> ### Sample: virginica
#>
#> Expl. vars.: x1
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 3.906836 0.760748 5.13552 5.0735e-06 ***
#> x1 0.901534 0.246200 3.66179 6.2338e-04 ***
#> ---
#> Expl. vars.: x1 + x2
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.624782 0.538060 1.16118 2.5143e-01
#> x1 0.259954 0.130150 1.99734 5.1596e-02 .
#> x2 0.934819 0.076962 12.14650 4.2031e-16 ***
#> ---
#> Expl. vars.: x1 + x2 + x3
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.699883 0.553402 1.264692 2.1235e-01
#> x1 0.330337 0.122494 2.696759 9.7515e-03 **
#> x2 0.945536 0.080881 11.690520 2.2562e-15 ***
#> x3 -0.169753 0.210310 -0.807154 4.2373e-01
summary(res, type = "long")
#>
#> ### Sample: setosa
#>
#> Expl. vars.: x1
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): setosa
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.639001 0.310014 8.51251 3.7424e-11 ***
#> x1 0.690490 0.089899 7.68074 6.7098e-10 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.233723 Adj. R2: 0.542029
#>
#> Expl. vars.: x1 + x2
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): setosa
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.303738 0.385294 5.97917 2.8943e-07 ***
#> x1 0.667416 0.090356 7.38653 2.1252e-09 ***
#> x2 0.283419 0.197224 1.43704 1.5733e-01
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.228751 Adj. R2: 0.551971
#>
#> Expl. vars.: x1 + x2 + x3
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): setosa
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.351890 0.392868 5.986471 3.0342e-07 ***
#> x1 0.654835 0.092447 7.083324 6.8344e-09 ***
#> x2 0.237560 0.208019 1.142011 2.5936e-01
#> x3 0.252126 0.346864 0.726873 4.7099e-01
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.227449 Adj. R2: 0.547429
#>
#> ### Sample: versicolor
#>
#> Expl. vars.: x1
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): versicolor
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 3.539735 0.562874 6.28869 9.0690e-08 ***
#> x1 0.865078 0.201938 4.28389 8.7719e-05 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.434612 Adj. R2: 0.261511
#>
#> Expl. vars.: x1 + x2
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): versicolor
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.116431 0.494256 4.28206 9.0640e-05 ***
#> x1 0.247642 0.186839 1.32543 1.9144e-01
#> x2 0.735587 0.124768 5.89565 3.8707e-07 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.329521 Adj. R2: 0.566438
#>
#> Expl. vars.: x1 + x2 + x3
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): versicolor
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 1.895540 0.507055 3.73833 5.1122e-04 ***
#> x1 0.386858 0.204545 1.89131 6.4890e-02 .
#> x2 0.908337 0.165432 5.49068 1.6667e-06 ***
#> x3 -0.679224 0.435382 -1.56006 1.2560e-01
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.321135 Adj. R2: 0.579273
#>
#> ### Sample: virginica
#>
#> Expl. vars.: x1
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): virginica
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 3.906836 0.757061 5.16053 4.6563e-06 ***
#> x1 0.901534 0.253106 3.56189 8.4346e-04 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.559836 Adj. R2: 0.192579
#>
#> Expl. vars.: x1 + x2
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): virginica
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.624782 0.524867 1.19036 2.3988e-01
#> x1 0.259954 0.153338 1.69531 9.6634e-02 .
#> x2 0.934819 0.089602 10.43302 8.0094e-14 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.307439 Adj. R2: 0.75132
#>
#> Expl. vars.: x1 + x2 + x3
#> OLS estimation, Dep. Var.: y
#> Observations: 50
#> Sample (species): virginica
#> Standard-errors: IID
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.699883 0.533601 1.311623 1.9616e-01
#> x1 0.330337 0.174329 1.894909 6.4400e-02 .
#> x2 0.945536 0.090722 10.422336 1.0743e-13 ***
#> x3 -0.169753 0.198072 -0.857023 3.9587e-01
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.305014 Adj. R2: 0.749908
summary(res, type = "compact")
#> lhs sample rhs (Intercept) x1 x2
#> 1 y setosa x1 2.64*** (0.310) 0.690*** (0.090)
#> 2 y setosa x1 + x2 2.30*** (0.385) 0.667*** (0.090) 0.283 (0.197)
#> 3 y setosa x1 + x2 + x3 2.35*** (0.393) 0.655*** (0.092) 0.238 (0.208)
#> 4 y versicolor x1 3.54*** (0.563) 0.865*** (0.202)
#> 5 y versicolor x1 + x2 2.12*** (0.494) 0.248 (0.187) 0.736*** (0.125)
#> 6 y versicolor x1 + x2 + x3 1.90*** (0.507) 0.387. (0.205) 0.908*** (0.165)
#> 7 y virginica x1 3.91*** (0.757) 0.902*** (0.253)
#> 8 y virginica x1 + x2 0.625 (0.525) 0.260. (0.153) 0.935*** (0.090)
#> 9 y virginica x1 + x2 + x3 0.700 (0.534) 0.330. (0.174) 0.946*** (0.091)
#> x3
#> 1
#> 2
#> 3 0.252 (0.347)
#> 4
#> 5
#> 6 -0.679 (0.435)
#> 7
#> 8
#> 9 -0.170 (0.198)
summary(res, type = "se_compact")
#> lhs sample rhs (Intercept) (Intercept)__se x1 x1__se
#> 1 y setosa x1 2.6390012 0.3100143 0.6904897 0.08989888
#> 2 y setosa x1 + x2 2.3037382 0.3852942 0.6674162 0.09035581
#> 3 y setosa x1 + x2 + x3 2.3518898 0.3928675 0.6548350 0.09244742
#> 4 y versicolor x1 3.5397347 0.5628736 0.8650777 0.20193757
#> 5 y versicolor x1 + x2 2.1164314 0.4942556 0.2476422 0.18683892
#> 6 y versicolor x1 + x2 + x3 1.8955395 0.5070552 0.3868576 0.20454490
#> 7 y virginica x1 3.9068365 0.7570605 0.9015345 0.25310551
#> 8 y virginica x1 + x2 0.6247824 0.5248675 0.2599540 0.15333757
#> 9 y virginica x1 + x2 + x3 0.6998830 0.5336009 0.3303370 0.17432873
#> x2 x2__se x3 x3__se
#> 1 NA NA NA NA
#> 2 0.2834193 0.19722377 NA NA
#> 3 0.2375602 0.20801921 0.2521257 0.3468636
#> 4 NA NA NA NA
#> 5 0.7355868 0.12476776 NA NA
#> 6 0.9083370 0.16543248 -0.6792238 0.4353821
#> 7 NA NA NA NA
#> 8 0.9348189 0.08960197 NA NA
#> 9 0.9455356 0.09072204 -0.1697527 0.1980724
summary(res, type = "se_long")
#> lhs sample rhs type (Intercept) x1 x2
#> 1 y setosa x1 coef 2.6390012 0.69048972 NA
#> 2 y setosa x1 se 0.3100143 0.08989888 NA
#> 3 y setosa x1 + x2 coef 2.3037382 0.66741621 0.28341929
#> 4 y setosa x1 + x2 se 0.3852942 0.09035581 0.19722377
#> 5 y setosa x1 + x2 + x3 coef 2.3518898 0.65483497 0.23756017
#> 6 y setosa x1 + x2 + x3 se 0.3928675 0.09244742 0.20801921
#> 7 y versicolor x1 coef 3.5397347 0.86507772 NA
#> 8 y versicolor x1 se 0.5628736 0.20193757 NA
#> 9 y versicolor x1 + x2 coef 2.1164314 0.24764216 0.73558681
#> 10 y versicolor x1 + x2 se 0.4942556 0.18683892 0.12476776
#> 11 y versicolor x1 + x2 + x3 coef 1.8955395 0.38685762 0.90833700
#> 12 y versicolor x1 + x2 + x3 se 0.5070552 0.20454490 0.16543248
#> 13 y virginica x1 coef 3.9068365 0.90153448 NA
#> 14 y virginica x1 se 0.7570605 0.25310551 NA
#> 15 y virginica x1 + x2 coef 0.6247824 0.25995398 0.93481889
#> 16 y virginica x1 + x2 se 0.5248675 0.15333757 0.08960197
#> 17 y virginica x1 + x2 + x3 coef 0.6998830 0.33033703 0.94553559
#> 18 y virginica x1 + x2 + x3 se 0.5336009 0.17432873 0.09072204
#> x3
#> 1 NA
#> 2 NA
#> 3 NA
#> 4 NA
#> 5 0.2521257
#> 6 0.3468636
#> 7 NA
#> 8 NA
#> 9 NA
#> 10 NA
#> 11 -0.6792238
#> 12 0.4353821
#> 13 NA
#> 14 NA
#> 15 NA
#> 16 NA
#> 17 -0.1697527
#> 18 0.1980724