Description Usage Arguments Details Value Author(s) References See Also Examples
Estimate an optimal dynamic treatment regime using the Interactive Q-learning (IQ-learning) algorithm when the data has been collected from a two-stage randomized trial with binary treatments. iqLearnSS implements the second-stage regression step of the IQ-Learning algorithm (IQ1).
1 2 |
... |
ignored |
moMain |
an object of class |
moCont |
an object of class |
data |
an object of class |
response |
an object is of class |
txName |
an object of class |
iter |
an object of class >=1 if <=0 if the components of the conditional expectation
|
suppress |
an object of class |
There are standard regression analysis tools available for the
object returned by this function. In general, these tools
simply extend the methods defined by the regression function.
If defined, coef()
returns the model
parameter estimates; plot()
generates the standard x-y plots;
residuals
returns model residuals for the combined model; and
summary
returns summary information.
Other tools, such as fitted()
for the lm
regression function, can be accessed using fitObject()
.
fitObject()
retrieves the standard value object returned by the
regression method, which can be passed as input to other functions.
See ?fitObject for details.
Returns an object that inherits directly from class DynTxRegime
.
Kristin A. Linn, Eric B. Laber, Leonard A. Stefanski, and Shannon T. Holloway <sthollow@ncsu.edu>
Laber, E. B., Linn, K. A., and Stefanski, L. A. (2014). Interactive Q-learning. Biometrika, in press.
iqLearnFSM
,
iqLearnFSC
,
iqLearnFSV
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | ##########################################################
# Load and process data set
##########################################################
data(bmiData)
#----------------------------------------------------#
# Recast treatment variables to (-1,1) --- required.
#----------------------------------------------------#
bmiData$A1[which (bmiData$A1=="MR")] <- 1L
bmiData$A1[which (bmiData$A1=="CD")] <- -1L
bmiData$A2[which (bmiData$A2=="MR")] <- 1L
bmiData$A2[which (bmiData$A2=="CD")] <- -1L
bmiData$A1 <- as.integer(bmiData$A1)
bmiData$A2 <- as.integer(bmiData$A2)
#----------------------------------------------------#
# define response y to be the negative 12 month
# change in BMI from baseline
#----------------------------------------------------#
bmiData$y <- -100*(bmiData[,6] - bmiData[,4])/bmiData[,4]
##########################################################
# Second-stage regression - Single Regression Analysis
##########################################################
#----------------------------------------------------#
# Create modelObj object for main effect component
#----------------------------------------------------#
moMain <- buildModelObj(model = ~ gender + parentBMI + month4BMI,
solver.method = 'lm')
#----------------------------------------------------#
# Create modelObj object for contrast component
#----------------------------------------------------#
moCont <- buildModelObj(model = ~ parentBMI + month4BMI,
solver.method = 'lm')
iqSS <- iqLearnSS(moMain = moMain,
moCont = moCont,
data = bmiData,
response = bmiData$y,
txName = "A2",
iter = 0)
# Estimated Value functions
vals <- qFuncs(iqSS)
head(vals)
# Residuals
res <- residuals(iqSS)
head(res)
# Model parameter estimates
coef(iqSS)
# Summary information for fit object
#summary(iqSS)
# Standard x-y plots
plot(iqSS)
# Value objects returned by modeling function
fitObj <- fitObject(iqSS)
fitObj
# All standard lm methods can be applied to the elements of this list.
summary(fitObj[[ "Combined" ]])
coef(fitObj[[ "Combined" ]])
head(residuals(fitObj[[ "Combined" ]]))
head(fitted.values(fitObj[[ "Combined" ]]))
plot(fitObj[[ "Combined"]])
##########################################################
# Second-stage regression - Iterative Regression Analysis
##########################################################
#----------------------------------------------------#
# Create modelObj object for main effect component
#----------------------------------------------------#
moMain <- buildModelObj(model = ~ gender + parentBMI + month4BMI,
solver.method = 'lm')
#----------------------------------------------------#
# Create modelObj object for contrast component
#----------------------------------------------------#
moCont <- buildModelObj(model = ~ parentBMI + month4BMI,
solver.method = 'lm')
iqSS <- iqLearnSS(moMain = moMain,
moCont = moCont,
data = bmiData,
response = bmiData$y,
txName = "A2",
iter = 100)
# Estimated Value functions
vals <- qFuncs(iqSS)
head(vals)
# Residuals
res <- residuals(iqSS)
head(res)
# Model parameter estimates
coef(iqSS)
# Summary information for fit object
#summary(iqSS)
# Standard x-y plots
plot(iqSS)
# Value objects returned by modeling function
fitObj <- fitObject(iqSS)
fitObj
# All standard lm methods can be applied to the elements of this list.
summary(fitObj[[ "MainEffect" ]])
coef(fitObj[[ "MainEffect" ]])
head(residuals(fitObj[[ "MainEffect" ]]))
head(fitted.values(fitObj[[ "MainEffect" ]]))
plot(fitObj[[ "MainEffect"]])
summary(fitObj[[ "Contrast" ]])
coef(fitObj[[ "Contrast" ]])
head(residuals(fitObj[[ "Contrast" ]]))
head(fitted.values(fitObj[[ "Contrast" ]]))
plot(fitObj[[ "Contrast"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.