| ate | R Documentation |
Augmented Inverse Probability Weighting estimator for the Average (Causal)
Treatment Effect. All nuisance models are here parametric (glm). For a more
general approach see the cate implementation. In this implementation
the standard errors are correct even when the nuisance models are
mis-specified (the influence curve is calculated including the term coming
from the parametric nuisance models). The estimate is consistent if either
the propensity model or the outcome model / Q-model is correctly specified.
ate(
formula,
data = parent.frame(),
weights,
offset,
family = stats::gaussian(identity),
nuisance = NULL,
propensity = nuisance,
all,
labels = NULL,
adjust.nuisance = TRUE,
adjust.propensity = TRUE,
...
)
formula |
formula (see details below) |
data |
data.frame |
weights |
optional frequency weights |
offset |
optional offset (character or vector). can also be specified in the formula. |
family |
Exponential family argument for outcome model |
nuisance |
outcome regression formula (Q-model) |
propensity |
propensity model formula |
all |
when TRUE all standard errors are calculated (default TRUE when exposure only has two levels) |
labels |
optional treatment labels |
adjust.nuisance |
adjust for uncertainty due to estimation of outcome regression model parameters |
adjust.propensity |
adjust for uncertainty due to estimation of propensity regression model parameters |
... |
additional arguments to lower level functions |
The formula may either be specified as: response ~ treatment | nuisance-formula | propensity-formula
For example: ate(y~a | x+z+a | x*z, data=...)
Alternatively, as a list: ate(list(y~a, ~x+z, ~x*z), data=...)
Or using the nuisance (and propensity argument):
ate(y~a, nuisance=~x+z, ...)
An object of class 'ate.targeted' is returned. See
targeted-class for more details about this class and its
generic functions.
Klaus K. Holst
cate
m <- lava::lvm(y ~ a+x, a~x) |>
lava::distribution(~y, value = lava::binomial.lvm()) |>
lava::ordinal(K=4, ~a) |>
transform(~a, value = factor)
d <- lava::sim(m, 1e3, seed=1)
# (a <- ate(y~a|a*x|x, data=d))
(a <- ate(y~a, nuisance=~a*x, propensity=~x, data = d))
# Comparison with randomized experiment
m0 <- lava::cancel(m, a~x)
lm(y~a-1, lava::sim(m0,2e4))
# Choosing a different contrast for the association measures
summary(a, contrast=c(2,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.