Description Usage Arguments Examples
This function generates the tree structure as a list function.
1 2 3 4 5 6 7 8 9 10 | LTfunction(
Y,
Z,
X,
X.i,
version = "prognostic",
pval.thresh = 0.05,
min.split.size = 10,
sample = "single"
)
|
Y |
response vector |
Z |
treatment indicator |
X |
covariate matrix |
X.i |
covariate matrix - ids |
version |
type of score - default is the prognostic score |
pval.thresh |
Threshold of p-value |
min.split.size |
Minimum size to split |
sample |
Use a single or double sample - default is single. The double sample approach uses a separate sample to construct the tree and to estimate the effects. This can be modified as required. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | set.seed(10)
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)
# Single sample approach
LT1<-LTfunction(Y, as.logical(Z), X.i, X.i)
# Double sample approach
Nused <- 200
subjects <- c(1:(Nused/2), 1001:(1000+Nused/2))
LT2<-LTfunction(Y[subjects], Z[subjects], X.i[subjects,], X.i[subjects,], sample = "double")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.