Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rep.fixest

Replicates fixest objects


Description

Simple function that replicates fixest objects while (optionally) computing different standard-errors. Useful mostly in combination with etable or coefplot.

Usage

## S3 method for class 'fixest'
rep(x, times = 1, each = 1, cluster, ...)

## S3 method for class 'fixest_list'
rep(x, times = 1, each = 1, cluster, ...)

.l(...)

Arguments

x

Either a fixest object, either a list of fixest objects created with .l().

times

Integer vector giving the number of repetitions of the vector of elements. By default times = 1. It must be either of length 1, either of the same length as the argument x.

each

Integer scalar indicating the repetition of each element. Default is 1.

cluster

A list containing the types of standard-error to be computed, default is missing. If not missing, it must be of the same length as times, each, or the final vector. Note that if the arguments times and each are missing, then times becomes equal to the length of cluster. (Note that cluster accepts the character values "standard" or "hetero" to compute non-clustered SEs.)

...

In .l(): fixest objects. In rep(): not currently used.

Details

To apply rep.fixest on a list of fixest objects, it is absolutely necessary to use .l() and not list().

Value

Returns a list of the appropriate length. Each element of the list is a fixest object.

Examples

# Let's show results with different standard-errors

est = feols(Ozone ~ Solar.R + Wind + Temp, data = airquality)

my_cluster = list("Month", "Day", ~ Day + Month)

etable(rep(est, cluster = my_cluster))

coefplot(rep(est, cluster = my_cluster), drop = "Int")

#
# To rep multiple objects, you need to use .l()
#

est_bis = feols(Ozone ~ Solar.R + Wind + Temp | Month, airquality)

etable(rep(.l(est, est_bis), cluster = my_cluster))

# using each
etable(rep(.l(est, est_bis), each = 3, cluster = my_cluster))

fixest

Fast Fixed-Effects Estimations

v0.10.0
GPL-3
Authors
Laurent Berge [aut, cre], Sebastian Krantz [ctb], Grant McDermott [ctb] (<https://orcid.org/0000-0001-7883-8573>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.