mn.HT | R Documentation |
This function implements the Horvitz-Thompson estimator of the mean outcome in the presence of missing data.
mn.HT(y, tr, p, X=NULL, bal=FALSE)
y |
A vector or a matrix of outcomes with missing data. |
tr |
A vector of non-missing indicators (=1 if |
p |
A vector of known or fitted propensity scores. |
X |
The model matrix for the propensity score model, assumed to be logistic (set |
bal |
Logical; if |
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.
mu |
The estimated mean(s) or, if |
v |
The estimated variance(s) of |
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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.