Description Usage Arguments Examples
This function is used for matching with replacement and determines the treatment effect and relevant covariates for the matched pairs.
1 | MatchForTree(Y, Z, X, version = "prognostic")
|
Y |
response vector |
Z |
treatment indicator |
X |
covariate matrix |
version |
version type of matching to be performed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | N<-2000
numx <- 5
alpha <-0.8
theta<-0.8
beta<- c(1,.8,.6,.4,.2)
gamma <- 1
Z <- rep(c(0, 1), each = N/2)
sigma <- diag(numx)
X.i <- mvrnorm(N,mu=rep(0,numx),Sigma=sigma)
W <- Z * ifelse(X.i[,1] > 0, 1, 0)
mu <- alpha + theta*Z + X.i %*% beta + W * gamma
Y <- rnorm(N, mean=mu)
MatchForTree(Y, Z, X.i)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.