Description Usage Arguments Value Examples
View source: R/build_MOTTE_tree_y.R
Fitting MOTTE Tree in the MOTTE.RF
1 2 3 4 5 6 7 8 9 10 | build_MOTTE_tree_CO(
x.b,
x.diff.1,
x.diff.2,
y.diff.1,
y.diff.2,
nodesize,
nsplits,
left.out
)
|
x.b |
Pre-treatment covariates, i.e. microbiomes |
nodesize |
An integer value. The threshold that control the maximum size of a node |
nsplits |
A numeric value, the number of maximum splits |
left.out |
left.out is ensure at least left.out*2 sample for either treated or untreated sample in the group |
x.e |
Post-treatment covariates, i.e. microbiomes |
treat |
A vector of binary value, the arm of treatment |
y.b |
Pre-treatment response, i.e. biomarkers |
y.e |
Post-treatment response, i.e. biomarkers |
seed |
a seed number to generate the random subsets of split candidates. Doesn't work when applying nsplit==NULL |
A data.tree object, node
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | set.seed(1)
B <- create.B(10)
Z <- create.Z(10, 3)
tmp.dat <- sim_MOTTE_data( n.train = 500, n.test = 200,
p = 10, q = 3, ratio = 0.5,
B = B, Z = Z)
train.dat <- tmp.dat$train
x.b <- scale(train.dat$x.b, center = FALSE, scale = TRUE)
x.e <- scale(train.dat$x.e, center = FALSE, scale = TRUE)
y.b <- scale(train.dat$y.b, center = FALSE, scale = TRUE)
y.e <- scale(train.dat$y.e, center = FALSE, scale = TRUE)
treat <- train.dat$trt
#with(train.dat,
build_MOTTE_tree(x.b, x.e, factor(treat), y.b, y.e,
nodesize=30, nsplits=NULL, left.out = 0.1)
#)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.