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

extraline_register

Register extraline macros to be used in etable


Description

This function is used to create extraline (which is an argument of etable) macros that can be easily summoned in etable.

Usage

extraline_register(type, fun, alias)

Arguments

type

A character scalar giving the type-name.

fun

A function to be applied to a fixest estimation. It must return a scalar.

alias

A character scalar. This is the alias to be used in lieu of the type name to form the row name.

Details

You can register as many macros as you wish, the only constraint is that the type name should not conflict with a fitstat type name.

Examples

# We register a function computing the standard-deviation of the dependent variable
my_fun = function(x) sd(model.matrix(x, type = "lhs"))
extraline_register("sdy", my_fun, "SD(y)")

# An estimation
data(iris)
est = feols(Petal.Length ~ Sepal.Length | Species, iris)

# Now we can easily create a row with the mean of y.
# We just "summon" it in a one-sided formula
etable(est, extraline = ~ sdy)

# We can change the alias on the fly:
etable(est, extraline = list("_Standard deviation of the dep. var." = ~ sdy))

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.