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 misspecified (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,
...
)

## Arguments

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

If TRUE all standard errors are calculated (default TRUE when exposure only has two levels)

labels

Optional treatment labels

...

Additional arguments to lower level functions

## Value

An object of class 'ate.targeted' is returned. See targeted-class

for more details about this class and its generic functions.

## Details

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, ...)

Klaus K. Holst

## Examples

m <- lvm(y ~ a+x, a~x)
distribution(m,~ a+y) <- binomial.lvm()
d <- sim(m,1e4,seed=1)

a <- ate(y ~ a, nuisance=~x, data=d)
summary(a)
#>
#> Augmented Inverse Probability Weighting estimator
#>   Response y (Outcome model: gaussian):
#> 	 y ~ x + a
#>   Exposure a (Propensity model: logistic regression):
#> 	 a ~ x
#>
#>                    Estimate  Std.Err     2.5%    97.5%    P-value
#>  a=0               0.496843 0.007478  0.48219  0.51150  0.000e+00
#>  a=1               0.706396 0.007364  0.69196  0.72083  0.000e+00
#> Outcome model:
#>  (Intercept)       0.485158 0.006898  0.47164  0.49868  0.000e+00
#>  x                 0.175278 0.004231  0.16699  0.18357  0.000e+00
#>  a                 0.224335 0.010050  0.20464  0.24403 2.287e-110
#> Propensity model:
#>  (Intercept)      -0.001888 0.022109 -0.04522  0.04144  9.320e-01
#>  x                -1.019511 0.026347 -1.07115 -0.96787  0.000e+00
#>
#> Average Treatment Effect (constrast: 'a=1' - 'a=0'):
#>
#>     Estimate Std.Err   2.5%  97.5%   P-value
#> ATE   0.2096 0.01013 0.1897 0.2294 4.494e-95
#>
b <- cate(a ~ 1, y ~ a*x, a ~ x, data=d)

# Multiple treatments
m <- lvm(y ~ a+x, a~x)
distribution(m,~ y) <- binomial.lvm()
m <- ordinal(m, K=4, ~a)
transform(m, ~a) <- factor
d <- sim(m, 1e4, seed=1)
(a <- ate(y~a|a*x|x, data=d))
#>     Estimate Std.Err   2.5%  97.5%    P-value
#> a=0   0.2121 0.01695 0.1788 0.2453  6.738e-36
#> a=1   0.3422 0.01831 0.3063 0.3781  6.005e-78
#> a=2   0.3922 0.01617 0.3605 0.4239 6.820e-130
#> a=3   0.6052 0.00771 0.5901 0.6203  0.000e+00

# Comparison with randomized experiment
m0 <- cancel(m, a~x)
d0 <- sim(m0,2e5)
lm(y~a-1,d0)
#>
#> Call:
#> lm(formula = y ~ a - 1, data = d0)
#>
#> Coefficients:
#>     a0      a1      a2      a3
#> 0.2222  0.3408  0.4071  0.6228
#>

# Choosing a different contrast for the association measures
summary(a, contrast=c(2,4))
#>
#> Augmented Inverse Probability Weighting estimator
#>   Response y (Outcome model: gaussian):
#> 	 y ~ a * x
#>   Exposure a (Propensity model: logistic regression):
#> 	 a ~ x
#>
#>     Estimate Std.Err   2.5%  97.5%    P-value
#> a=0   0.2121 0.01695 0.1788 0.2453  6.738e-36
#> a=1   0.3422 0.01831 0.3063 0.3781  6.005e-78
#> a=2   0.3922 0.01617 0.3605 0.4239 6.820e-130
#> a=3   0.6052 0.00771 0.5901 0.6203  0.000e+00
#>
#> Average Treatment Effect (constrast: 'a=1' - 'a=3'):
#>
#>     Estimate Std.Err    2.5%   97.5%   P-value
#> ATE   -0.263 0.01955 -0.3013 -0.2247 3.016e-41
#>