Description Usage Arguments Value Examples
Map the object returned by BuildRule()
to the treatment rule corresponding to a particular dataset
1 2 3 4 5 6 7  PredictRule(
BuildRule.object,
new.X,
desirable.outcome = NULL,
clinical.threshold = 0,
return.predicted.response = FALSE
)

BuildRule.object 
The object returned by the 
new.X 
A data frame representing the dataset for which the treatment rule is desired. 
desirable.outcome 
A logical equal to 
clinical.threshold 
A numeric equal a positive number above which the predicted outcome under treatment must be superior to the predicted outcome under control for treatment to be recommended. Only used when 
return.predicted.response 
logical indicating whether the predicted response variable (for 
If return.predicted.response=FALSE
(the default), then the single object returned is a numeric vector of 0s and 1s, with length equal to the number of rows in new.X
, where a 0 indicates treatment is not recommended and a 1 indicates treatment is recommended for the corresponding observation in new.X
.
If return.predicted.response=TRUE
, then the object returned is a list with some combination of the following components (depending on which prediction approach underlies the BuildRule.object
).
recommended.treatment
: A numeric vector of 0s and 1s, with length equal to the number of rows in new.X
, where a 0 indicates treatment is not recommended and a 1 indicates treatment is recommended for the corresponding observation in new.X
.
predicted.outcome
: A numeric vector showing the predicted values of the score function mapped to recommended.treatment
. Only returned if return.predicted.response=TRUE
and the approach underlying BuildRule.object
. was ‘direct.interactions’.
predicted.outcome.under.control
: A numeric vector showing the predicted values of the outcome under no treatment which, along with predicted.outcome.under.treatment
, corresponds to recommended.treatment
. Only returned if return.predicted.response=TRUE
and the approach underlying BuildRule.object
. was ‘split.regression’.
predicted.outcome.under.treatment
: A numeric vector showing the predicted values of the outcome under treatment which, along with predicted.outcome.under.control
, corresponds to recommended.treatment
. Only returned if return.predicted.response=TRUE
and the approach underlying BuildRule.object
. was ‘split.regression’.
predicted.treatment.prob
: A numeric vector showing the predicted treatment probability that corresponds to recommended.treatment
. Only returned if return.predicted.response=TRUE
and the approach underlying BuildRule.object
. was ‘OWL.framework’.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  set.seed(123)
example.split < SplitData(data=obsStudyGeneExpressions,
n.sets=3, split.proportions=c(0.5, 0.25, 0.25))
development.data < example.split[example.split$partition == "development",]
validation.data < example.split[example.split$partition == "validation",]
one.rule < BuildRule(development.data=development.data,
study.design="observational",
prediction.approach="split.regression",
name.outcome="no_relapse",
type.outcome="binary",
desirable.outcome=TRUE,
name.treatment="intervention",
names.influencing.treatment=c("prognosis", "clinic", "age"),
names.influencing.rule=c("age", paste0("gene_", 1:10)),
propensity.method="logistic.regression",
rule.method="glm.regression")
one.prediction < PredictRule(BuildRule.object=one.rule,
new.X=validation.data[, c("age", paste0("gene_", 1:10))],
desirable.outcome=TRUE,
clinical.threshold=0)
table(one.prediction)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.