build_MOTTE_tree: Fitting MOTTE Tree in the MOTTE.RF

Description Usage Arguments Value Examples

View source: R/build_MOTTE_tree.R

Description

Fitting MOTTE Tree in the MOTTE.RF

Usage

1
build_MOTTE_tree(x.b, x.e, treat, y.b, y.e, nodesize, nsplits, left.out)

Arguments

x.b

Pre-treatment covariates, i.e. microbiomes

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

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

Value

A data.tree object, node

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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

with(train.dat,
    build_MOTTE_tree(x.b, x.e, factor(treat), y.b, y.e,
                     nodesize=30, nsplits=NULL, left.out = 0.1)
 )

 train.dat <- tmp.dat$train

   x.b <- train.dat$x.b
   x.e <- train.dat$x.e
   treat <- train.dat$trt
   y.b <- train.dat$y.b
   y.e <- train.dat$y.e

boyiguo1/MOTTE.RF documentation built on June 14, 2020, 4:12 p.m.