Learn R Programming

nbpInference (version 1.0.3)

covAdj.variance: Covariate-Adjusted Variance Estimation

Description

This function calculates the covariate-adjusted conservative variance estimator For the (classic or bias-corrected) Neyman estimator. For details on the definition of the covariate-adjusted Neyman estimator, see fogarty2018mitigating;textualnbpInference and frazier2024bias;textualnbpInference.

Usage

covAdj.variance(Y, Z, X, pairs, pmat, xi, Q)

Value

a 2I x 2I numeric matrix

Arguments

Y

a 2I-length vector of outcome values

Z

a 2I-length vector of treatment values

X

a 2I x k matrix of covariate values

pairs

an I x 2 dataframe containing the indices of observations that form our set of matched pairs. An appropriate pairs dataframe can be formed using the nbp.caliper function.

pmat

a 2I x 2I matrix where the diagonals equal zero, and the off-diagonal elements (i, j) contain the probability the ith observation has Z = max(Z_i, Z_j) and the jth observation has Z = min(Z_i, Z_j). We can create a p-matrix using the make.pmatrix function. A p-matrix can be created using the make.pmatrix function.

xi

a number in the range 0 to 0.5, the cutoff related to the treatment assignment probability caliper.

Q

an arbitrary I x L numeric (real-valued) matrix, where L < I

See Also

Other inference: bias.corrected.neyman(), classic.neyman(), make.pmatrix(), nbp.caliper()

Examples

Run this code
set.seed(12345)
X <- rnorm(100, 0, 5)
Z <- X + rnorm(100, 0, (1+sqrt(abs(X))))
Y <- X + Z + rnorm(100, 0, 0.5)
pmat <- make.pmatrix(Z, X)
pairs <- nbp.caliper(Z, X, pmat, xi = 0.1, M = 10000)
covAdj.variance(Y, Z, X, pairs, pmat, xi = 0.1)

Run the code above in your browser using DataLab