ineqx | R Documentation |
The ineqx package implements Rosche (202X). [...]
ineqx( treat = NULL, post = NULL, y, ystat = "Var", group = NULL, time = NULL, weights = NULL, controls = NULL, decomp = "post", ref = NULL, AME_mu = NULL, AME_sigma = NULL, dat )
treat |
Character string. Treatment variable. Values must be 0/1 |
post |
Character string. Before/after variable. Values must be 0/1 |
y |
Character string. Dependent variable. Variable must be continuous. |
ystat |
Character string. Either "Var" (default) or "CV2". Choose to analyze (the effect of x on) the variance or squared coefficient of variation. |
group |
Character string. Variable must be categorical. Grouping variable to decompose variance into within- and between-group components. |
time |
Character string. c.x with specify penalized splines, i.x will specify dummies. Time variable to analyze change over time. |
weights |
Character string. Weight variable. |
controls |
Character vector with additional control variables. E.g. c("c.age", "i.sex", ...) |
decomp |
Character string. Either "post" (default) or "effect". |
ref |
Number, vector, or list. Counterfactual reference point. See details. |
AME_mu |
Dataframe with average marginal effects (Mu) |
AME_sigma |
Dataframe with average marginal effects (Sigma) |
dat |
Dataframe |
The main function of ineqx
. [...]
Counterfactual reference point (ref)
ref
can either be a number, c(number, "variable name"), or list(n=c(...), mu=c(...), sigma=c(...), beta=c(...), lambda=c(...)). [...]
Return
...
List with eight elements: "vars", "dMu", "dSigma", "dW", "dB", "dC", "dP", "dT". See details.
Benjamin Rosche <benjamin.rosche@gmail.com>
data(incdat) # Descriptive variance decomposition decomp_descr <- ineqx(y="inc", group="group", time="i.year", ref=1, dat=incdat) plot(decomp_descr, type="dT") # Causal variance decomposition decomp_treat <- ineqx(treat="x", post="t", y="inc", group="group", time="i.year", ref=1, dat=incdat) plot(decomp_treat, type="dT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.