Description Usage Arguments Details Value References See Also Examples
Estimate the optimal dynamic treatment regime / individualized treatment rule, in the form of decision list, namely, a sequence of if-then clauses.
1 2 3 |
y |
a matrix of immediate outcomes,
of size |
a |
a matrix of treatments/interventions actually received
at each stage, of size |
x |
a matrix of features (such as demographics, biomarkers,
confounders), of size |
stage.x |
a vector of length |
seed |
seed for random number generator to obtain |
kfolds |
number of folds to perform cross validation. |
fold |
a vector of length |
maxlen |
maximum length of the decision list in each stage. Should be a scalar. |
zeta.choices |
Choices for the tuning parameter zeta. Larger value of zeta tends to construct a condition that covers more observations in each if-then clause. Should be null or a numeric vector. |
eta.choices |
Choices for the tuning parameter eta. Larger value of eta tends to construct a condition that uses less features in each if-then clause. Should be null or a numeric vector. |
The algorithm is quite complicated. See the reference if interested.
An object of class listdtr
.
https://arxiv.org/abs/1606.01472
predict.listdtr
,
print.listdtr
,
plot.listdtr
,
build.rule.cv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# an example for one-stage study
x <- matrix(rnorm(500), 100, 5)
stage.x <- rep(1, 5)
a <- rbinom(100, 1, 0.5)
y <- a * x[, 1] + rnorm(100, 0, 0.1)
dtr <- listdtr(y, a, x, stage.x)
dtr # display the regime in words
plot(dtr) # display the regime in diagrams
yrec <- predict(dtr, x, 1)
yopt <- ifelse(x[, 1] > 0, 1, 0)
table(yrec, yopt) # discrepancy between recommended and optimal
# an example for two-stage study
x <- matrix(rnorm(500), 100, 5)
stage.x <- c(1, 1, 1, 2, 2)
a1 <- rbinom(100, 1, 0.5)
a2 <- rbinom(100, 1, 0.5)
y1 <- rep(0, 100)
y2 <- 9 * a1 * sin(x[, 1] * pi / 8) - 2 * a2 * x[, 4] + rnorm(100)
dtr <- listdtr(cbind(y1, y2), cbind(a1, a2), x, stage.x)
dtr # display the regime in words
plot(dtr) # display the regime in diagrams
yrec <- predict(dtr, x, 1)
yopt <- ifelse(x[, 1] > 0, 1, 0)
table(yrec, yopt) # discrepancy between recommended and optimal
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.