Learn R Programming

MatchGATE (version 0.0.10)

match_y1y0_bc: Imputing Missing Potential Outcomes with Bias-Corrected Matching

Description

Impute missing potential outcomes for each individual with bias-corrected matching.

Usage

match_y1y0_bc(X, A, Y, miu1.hat, miu0.hat, K = 5, method = "euclidean")

Value

Returns a matrix of completed matches, where each row is the imputed \((Y^1, Y^0)\)

for each individual.

Arguments

X

A matrix representing covariates, where each row represents the value of a different covariates for an individual.

A

A vector representing the treatment received by each individual.

Y

A vector representing the observed outcome for each individual.

miu1.hat

The estimated outcome regression function for \(Y^1\).

miu0.hat

The estimated outcome regression function for \(Y^0\).

K

When imputing missing potential outcomes, the average number of similar individuals are taken based on covariates similarity.

method

The distance measure to be used. It is a argument embed in dist function.

Details

Here are the implementation details for the imputation processes. Denote \(\hat{Y}^0_i\) and \(\hat{Y}^1_i\) as the imputed potential outcomes for individual \(i\). For example, if \(A_i = 0\), then \(\hat{Y}^0_i = Y^0_i\). However, for obtaining \(\hat{Y}^1_i\), we require to introduce an outcome regression function \(\mu_1(X)\) for \(Y^1\). Let \(\hat{\mu}_1(X)\) be the fitted value of \(\mu_1(X)\), then \(\hat{Y}^1_i\) is defined as follows, $$\hat{Y}_i^1 = \frac 1 K \sum_{j\in\mathcal{J}_K(i)}\{Y_j+ \hat{\mu}_1(X_i)-\hat{\mu}_1(X_j)\},$$ where \(\mathcal{J}_K(i)\) represents the set of \(K\) matched individuals with \(A_i = 1\), that are the closest to the individual \(i\) in terms of covariates similarity, and vice versa.

Examples

Run this code
n = 100
X1 <- runif(n, -0.5,0.5)
X2 <- sample(c(0,1,2), n, TRUE)
X = cbind(X1, X2)
A = sample(c(0,1), n, TRUE)
Y = A * (2*X1) + X1 + X2^2 + rnorm(n)
miu1_hat <- cbind(1,X) %*% as.matrix(lm(Y ~ X, subset = A==1)$coef)
miu0_hat <- cbind(1,X) %*% as.matrix(lm(Y ~ X, subset = A==0)$coef)
match_y1y0_bc(X = X, A = A, Y = Y, miu1.hat = miu1_hat,
              miu0.hat = miu0_hat, K = 5)


Run the code above in your browser using DataLab