Learn R Programming

nbpInference (version 1.0.3)

make.pmatrix: Make matrix of treatment assignment probabilities

Description

This function creates a N x N 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), conditioned on covariates. Uses the "model-based" conditional density estimation method described in frazier2024biasnbpInference.

Usage

make.pmatrix(Z, X)

Value

an N x N numeric matrix. Each entry represents the probability the ith observation has Z = max(Z_i, Z_j) and the jth observation has Z = min(Z_i, Z_j), conditioned on covariates.

Arguments

Z

an N-length vector of treatment values, which must be numeric.

X

an N x k matrix of covariate values, which must be numeric.

See Also

Other inference: bias.corrected.neyman(), classic.neyman(), covAdj.variance(), nbp.caliper()

Examples

Run this code
set.seed(12345)
X <- rnorm(100, 0, 5)
Z <- X + rnorm(100, 0, (1+sqrt(abs(X))))
make.pmatrix(Z, X)

Run the code above in your browser using DataLab