ate.HT: Horvitz-Thompson estimator for the causal-inference setup

View source: R/my-code.R

ate.HTR Documentation

Horvitz-Thompson estimator for the causal-inference setup

Description

This function implements the Horvitz-Thompson estimator of the mean outcome of the average treatment effect in causal inference.

Usage

ate.HT(y, tr, p, X=NULL, bal=FALSE)

Arguments

y

A vector or a matrix of observed outcomes.

tr

A vector of treatment indicators (=1 if treated or 0 if untreated).

p

A vector of known or fitted propensity scores.

X

The model matrix for the propensity score model, assumed to be logistic (set X=NULL if p is known or treated to be so).

bal

Logical; if TRUE, the function is used for checking balance (see the details).

Details

Variance estimation is based on asymptotic expansions, allowing for misspecification of the propensity score model.

For balance checking with bal=TRUE, the input y should correpond to the covariates for which balance is to be checked, and the output mu gives the differences between the Horvitz-Thompson estimates and the overall sample means for these covariates.

Value

mu

The estimated means for treatments 1 and 0 or, if bal=TRUE, their differences from the overall sample means.

diff

The estimated average treatment effect.

v

The estimated variances of mu.

v.diff

The estimated variance of diff.

References

Tan, Z. (2006) "A distributional approach for causal inference using propensity scores," Journal of the American Statistical Association, 101, 1619-1637.

Tan, Z. (2010) "Bounded, efficient and doubly robust estimation with inverse weighting," Biometrika, 97, 661-682.

Examples

data(KS.data)
attach(KS.data)
z=cbind(z1,z2,z3,z4)
x=cbind(x1,x2,x3,x4)

#logistic propensity score model, correct
ppi.glm <- glm(tr~z, family=binomial(link=logit))

X <- model.matrix(ppi.glm)
ppi.hat <- ppi.glm$fitted

#ppi.hat treated as known
out.HT <- ate.HT(y, tr, ppi.hat)
out.HT$diff
out.HT$v.diff

#ppi.hat treated as estimated
out.HT <- ate.HT(y, tr, ppi.hat, X)
out.HT$diff
out.HT$v.diff

#balance checking 
out.HT <- ate.HT(x, tr, ppi.hat, X, bal=TRUE)
out.HT$mu
out.HT$v

out.HT$mu/ sqrt(out.HT$v)   #t-statistic

iWeigReg documentation built on May 20, 2022, 5:06 p.m.