#----------------------------------------------------#
# 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')
Run the code above in your browser using DataLab