mn.HT: Horvitz-Thompson estimator for the missing-data setup

View source: R/my-code.R

mn.HTR Documentation

Horvitz-Thompson estimator for the missing-data setup

Description

This function implements the Horvitz-Thompson estimator of the mean outcome in the presence of missing data.

Usage

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

Arguments

y

A vector or a matrix of outcomes with missing data.

tr

A vector of non-missing indicators (=1 if y is observed or 0 if y is missing).

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 mean(s) or, if bal=TRUE, their differences from the overall sample means.

v

The estimated variance(s) of mu.

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)

#missing data
y[tr==0] <- 0

#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 <- mn.HT(y, tr, ppi.hat)
out.HT$mu
out.HT$v

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

#balance checking 
out.HT <- mn.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.