Description Usage Arguments Details Value Examples
View source: R/modelObjSubset.R
This function extends the buildModelObj() function of package modelObj. Here, the returned model object includes a specification of the decision point and a subset of the data to which the model is to be applied.
1 2 3 4 |
... |
Ignored. |
model |
an object of class |
dp |
an object of class |
subset |
an object of class |
solver.method |
an object of class |
solver.args |
an object of class solver.method = "glm" solver.args = list("family"=binomial) It is assumed that the R method
specified in |
predict.method |
an object of class |
predict.args |
an object of class predict.method = "predict.glm" predict.args = list("type"="response"). It is assumed that
|
In some clinical trial settings, an analyst may
want to use different models for unique subsets of the data.
buildModelObjSubset
provides a mechanism for users to
define models for such subsets. Specifically,
models are specified in connection with the decision point and subset to
which they are to be applied. For DynTxRegime methods qLearn
and optimalSeq
, a list of said objects can be passed as
input.
An object of type modelObjSubset, which contains a complete description of the conditions under which a model is to be used and the R methods to be used to obtain parameter estimates and predictions.
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 29 30 31 32 33 | #----------------------------------------------------#
# Consider a 2 decision point trial. #
# At the first decision point, the subset of #
# treatment options available to each patient is #
# always the set "a1." At the second decision point, #
# Some patients are eligible to received treatment #
# from set "a" and others from set "b." The outcome #
# for these subsets will be modeled as ~ x1 + x2 and #
# ~ x2 + x3, respectively. #
# #
# All parameter estimates are to be obtained used lm #
# and prediction obtained using predict. #
# #
# The following illustrates how to build these #
# model objects. #
#----------------------------------------------------#
model <- list()
model[[1]] <- buildModelObjSubset(dp = 1,
subset = "a1",
model = ~ x1 + x2 + x3,
solver.method = 'lm')
model[[2]] <- buildModelObjSubset(dp = 2,
subset = "a",
model = ~ ~ x1 + x2,
solver.method = 'lm')
model[[3]] <- buildModelObjSubset(dp = 2,
subset = "b",
model = ~ x2 + x3,
solver.method = 'lm')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.