Type: | Package |
Title: | Methods for Estimating Optimal Dynamic Treatment Regimes |
Version: | 4.16 |
Date: | 2025-05-03 |
Author: | Shannon T. Holloway [aut, cre], E. B. Laber [aut], K. A. Linn [aut], B. Zhang [aut], M. Davidian [aut], A. A. Tsiatis [aut] |
Maintainer: | Shannon T. Holloway <shannon.t.holloway@gmail.com> |
Description: | Methods to estimate dynamic treatment regimes using Interactive Q-Learning, Q-Learning, weighted learning, and value-search methods based on Augmented Inverse Probability Weighted Estimators and Inverse Probability Weighted Estimators. Dynamic Treatment Regimes: Statistical Methods for Precision Medicine, Tsiatis, A. A., Davidian, M. D., Holloway, S. T., and Laber, E. B., Chapman & Hall/CRC Press, 2020, ISBN:978-1-4987-6977-8. |
License: | GPL-2 |
Depends: | methods, modelObj, stats |
Suggests: | MASS, rpart, nnet |
Imports: | kernlab, rgenoud, dfoptim |
NeedsCompilation: | no |
Repository: | CRAN |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.1 |
Collate: | 'A_generics.R' 'A_List.R' 'A_DecisionPointList.R' 'A_OptimalInfo.R' 'A_OptimalObj.R' 'A_DynTxRegime.R' 'A_ModelObjSubset.R' 'A_SubsetList.R' 'A_ModelObj_SubsetList.R' 'A_ModelObj_DecisionPointList.R' 'A_newModelObjSubset.R' 'B_TxInfoBasic.R' 'B_TxInfoFactor.R' 'B_TxInfoInteger.R' 'B_TxObj.R' 'B_TxInfoNoSubsets.R' 'B_TxSubset.R' 'B_TxSubsetInteger.R' 'B_TxSubsetFactor.R' 'B_TxInfoWithSubsets.R' 'B_TxInfoList.R' 'C_TypedFit.R' 'C_TypedFit_SubsetList.R' 'C_TypedFit_fSet.R' 'C_TypedFitObj.R' 'D_OutcomeNoFit.R' 'D_newModel.R' 'D_OutcomeSimpleFit.R' 'D_OutcomeSimpleFit_fSet.R' 'D_OutcomeIterateFit.R' 'D_OutcomeSimpleFit_SubsetList.R' 'D_OutcomeObj.R' 'E_class_QLearn.R' 'E_class_IQLearnSS.R' 'E_class_IQLearnFS.R' 'E_class_IQLearnFS_C.R' 'E_class_IQLearnFS_ME.R' 'E_class_IQLearnFS_VHet.R' 'E_iqLearnFSC.R' 'E_iqLearnFSM.R' 'E_iqLearnFSV.R' 'E_iqLearnSS.R' 'E_qLearn.R' 'F_PropensityFit.R' 'F_PropensityFit_fSet.R' 'F_PropensityFit_SubsetList.R' 'F_PropensityObj.R' 'G_Regime.R' 'G_RegimeObj.R' 'H_class_OptimalSeq.R' 'H_class_OptimalSeqCoarsened.R' 'H_class_OptimalSeqMissing.R' 'H_optimalSeq.R' 'I_ClassificationFit.R' 'I_ClassificationFit_SubsetList.R' 'I_ClassificationFit_fSet.R' 'I_ClassificationObj.R' 'J_class_OptimalClass.R' 'J_optimalClass.R' 'K_Kernel.R' 'K_MultiRadialKernel.R' 'K_RadialKernel.R' 'K_PolyKernel.R' 'K_LinearKernel.R' 'K_KernelObj.R' 'L_Surrogate.R' 'L_ExpSurrogate.R' 'L_HingeSurrogate.R' 'L_HuberHingeSurrogate.R' 'L_LogitSurrogate.R' 'L_SmoothRampSurrogate.R' 'L_SqHingeSurrogate.R' 'M_MethodObject.R' 'M_OptimBasic.R' 'M_OptimKernel.R' 'M_OptimObj.R' 'N_CVBasic.R' 'N_CVInfo.R' 'N_CVInfoLambda.R' 'N_CVInfokParam.R' 'N_CVInfo2Par.R' 'N_CVInfoObj.R' 'N_OptimStep.R' 'O_LearningObject.R' 'O_Learning.R' 'O_LearningMulti.R' 'P_class_.owl.R' 'P_class_OWL.R' 'P_owl.R' 'Q_class_.rwl.R' 'Q_class_RWL.R' 'Q_rwl.R' 'R_class_BOWLBasic.R' 'R_class_BOWL.R' 'R_bowl.R' 'S_class_.earl.R' 'S_class_EARL.R' 'S_earl.R' 'checkFSetAndOutcomeModels.R' 'checkFSetAndPropensityModels.R' 'checkInputs.R' 'internalTest.R' 'titleIt.R' |
Packaged: | 2025-05-03 18:44:32 UTC; 19194 |
Date/Publication: | 2025-05-03 19:20:02 UTC |
apply() for List
objects
Description
Applies the specified function to each element of the List
.
Usage
.cycleList(object, ...)
## S4 method for signature 'List'
.cycleList(object, func, trm = "object", nm = NULL, ...)
## S4 method for signature 'DecisionPointList'
.cycleList(object, func, trm = "object", nm = "dp=", ...)
## S4 method for signature 'SubsetList'
.cycleList(object, func, trm = "object", nm = "Subset=", ...)
Arguments
object |
The object inheriting from list to which func is applied. |
... |
Additional arguments to be passed to func. |
func |
A character. The name of the function to be called for each element of object. |
trm |
A character. The formal input argument name through which each element of object is passed to func. |
nm |
A character. The naming convention for element of the returned list or displayed in print/show calls. |
Value
If func returns a value object, a list containing the value objects returned by func.
Create a BOWL Object for First Step of BOWL Algorithm
Description
Create a BOWL Object for First Step of BOWL Algorithm
Usage
## S4 method for signature ''NULL''
.newBOWL(
BOWLObj,
moPropen,
fSet,
data,
response,
txName,
lambdas,
cvFolds,
kernel,
surrogate,
suppress,
guess,
...
)
## S4 method for signature 'BOWL'
.newBOWL(
BOWLObj,
moPropen,
fSet,
data,
response,
txName,
lambdas,
cvFolds,
kernel,
surrogate,
suppress,
guess,
...
)
Arguments
BOWLObj |
NULL or an object returned from a previous step |
moPropen |
modelObj or modelObjSubset for propensity modeling |
fSet |
optional function defining subsets for modeling |
data |
data.frame of covariates |
response |
response |
txName |
treatment variable column header in data |
lambdas |
tuning parameter(s) |
cvFolds |
number of cross-validation folds |
kernel |
Kernel object |
surrogate |
Surrogate object |
suppress |
T/F indicating if prints to screen are to be executed |
guess |
Starting values for optimization |
Create a CVInfo Object
Description
Dispatch appropriate cross-validation procedure.
Usage
.newCVInfo(lambdas, kernel, ...)
## S4 method for signature 'ANY,ANY'
.newCVInfo(lambdas, kernel, ...)
## S4 method for signature 'numeric,Kernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
## S4 method for signature 'numeric,MultiRadialKernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
## S4 method for signature 'array,Kernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
## S4 method for signature 'array,MultiRadialKernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
## S4 method for signature 'numeric,MultiRadialKernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
## S4 method for signature 'array,MultiRadialKernel'
.newCVInfo(lambdas, kernel, methodObject, cvObject, suppress, ...)
Arguments
lambdas |
tuning parameters |
kernel |
kernel object |
Create a New CVInfoObj Object
Description
Call newCVInfo and stores result in @cvInfo
Usage
.newCVInfoObj(lambdas, kernel, ...)
## S4 method for signature 'ANY,Kernel'
.newCVInfoObj(lambdas, kernel, methodObject, cvObject, suppress, ...)
Arguments
lambdas |
Tuning parameters to be considered |
kernel |
Kernel (w/kernel parameters) to be considered |
... |
Additional arguments as needed |
methodObject |
Object parameters for weighted learning method |
cvObject |
Cross-Validation object |
suppress |
T/F indicating if screen prints are generated |
Complete a Classification Regression Step
Description
Methods dispatch appropriate typed fit methods based on the modeling object specified by the user and the feasible tx definitions. The value object returned depends on the underlying typed fit method.
Usage
.newClassificationFit(moClass, txObj, ...)
## S4 method for signature 'modelObj,TxInfoNoSubsets'
.newClassificationFit(moClass, txObj, response, data, suppress, ...)
## S4 method for signature 'ModelObj_SubsetList,TxInfoWithSubsets'
.newClassificationFit(moClass, data, response, txObj, suppress, ...)
## S4 method for signature 'modelObj,TxInfoWithSubsets'
.newClassificationFit(moClass, txObj, response, data, suppress, ...)
Arguments
moClass |
modeling object(s) defining the classification regression |
txObj |
TxObj defining the tx feasible sets |
... |
additional arguments. Ignored. |
data |
data.frame of covariates and tx received |
suppress |
logical indicating user's screen printing preference |
Create an Object of Class ClassificationFitObj
Description
Method calls .newClassificationFit() and stores the result in @classif.
Usage
.newClassificationObj(moClass, txObj, ...)
## S4 method for signature 'ANY'
.newClassificationObj(moClass, txObj, data, response, suppress, ...)
Arguments
moClass |
modeling object(s) defining the classification regression |
txObj |
TxObj defining the tx feasible sets |
... |
additional arguments. Ignored. |
data |
data.frame of covariates and tx received |
suppress |
logical indicating user's screen printing preference |
Complete an EARL Analysis
Description
Complete an EARL Analysis
Usage
.newEARL(
moPropen,
moMain,
moCont,
data,
response,
txName,
lambdas,
cvFolds,
surrogate,
iter,
guess,
kernel,
fSet,
suppress,
...
)
Arguments
moPropen |
modelObj for propensity modeling |
moMain |
modelObj for main effects of outcome model |
moCont |
modelObj for contrasts of outcome model |
data |
data.frame of covariates |
response |
Vector of responses |
txName |
Tx variable column header in data |
lambdas |
Tuning parameter(s) |
cvFolds |
Number of cross-validation folds |
surrogate |
Surrogate object |
iter |
Maximum iterations for outcome regression |
guess |
optional numeric vector providing starting values for optimization methods |
kernel |
Kernel object or SubsetList |
fSet |
NULL or function defining subset rules |
suppress |
T/F indicating if prints to screen are executed |
... |
Additional inputs for optimization |
Value
An EARL object
Complete First Stage Analysis of Contrasts for Interactive Q-Learning Algorithm
Description
Performs regression on the fitted contrasts of the second stage regression.
Usage
.newIQLearnFS_C(moMain, moCont, response, ...)
## S4 method for signature 'modelObj,modelObj,IQLearnSS'
.newIQLearnFS_C(moMain, moCont, response, data, txName, iter, suppress)
## S4 method for signature 'modelObj,'NULL',IQLearnSS'
.newIQLearnFS_C(moMain, moCont, response, data, txName, iter, suppress)
## S4 method for signature ''NULL',modelObj,IQLearnSS'
.newIQLearnFS_C(moMain, moCont, response, data, txName, iter, suppress)
Complete First Stage Analysis of Main Effects for Interactive Q-Learning Algorithm
Description
Performs regression on the fitted main effects the second stage regression.
Usage
.newIQLearnFS_ME(moMain, moCont, response, ...)
## S4 method for signature 'modelObj,modelObj,IQLearnSS'
.newIQLearnFS_ME(moMain, moCont, data, response, txName, iter, suppress)
## S4 method for signature 'modelObj,'NULL',IQLearnSS'
.newIQLearnFS_ME(moMain, moCont, data, response, txName, iter, suppress)
## S4 method for signature ''NULL',modelObj,IQLearnSS'
.newIQLearnFS_ME(moMain, moCont, data, response, txName, iter, suppress)
Complete First Stage Analysis of Residuals for Interactive Q-Learning Algorithm
Description
Performs log-linear regression on the residuals.
Usage
.newIQLearnFS_VHet(object, moMain, moCont, ...)
## S4 method for signature 'IQLearnFS_C,modelObj,modelObj'
.newIQLearnFS_VHet(object, moMain, moCont, data, iter, suppress)
## S4 method for signature 'IQLearnFS_C,modelObj,'NULL''
.newIQLearnFS_VHet(object, moMain, moCont, data, iter, suppress)
## S4 method for signature 'IQLearnFS_C,'NULL',modelObj'
.newIQLearnFS_VHet(object, moMain, moCont, data, iter, suppress)
Complete Second Stage Analysis of Interactive Q-Learning Algorithm
Description
Performs the regression of the outcome.
Usage
.newIQLearnSS(moMain, moCont, ...)
## S4 method for signature 'modelObj,modelObj'
.newIQLearnSS(moMain, moCont, data, response, txName, iter, suppress)
## S4 method for signature 'modelObj,'NULL''
.newIQLearnSS(moMain, moCont, data, response, txName, iter, suppress)
## S4 method for signature ''NULL',modelObj'
.newIQLearnSS(moMain, moCont, data, response, txName, iter, suppress)
Create a KernelObj
Description
Processes input to determine type of kernel, creates it, and stores in @slot kernel.
Usage
.newKernelObj(kernel, model, ...)
## S4 method for signature 'character,formula'
.newKernelObj(kernel, model, data, kparam = NULL, ...)
## S4 method for signature 'list,list'
.newKernelObj(kernel, model, data, kparam = NULL, ...)
Arguments
kernel |
A character. Name of kernel |
model |
A formula or list of formula |
Complete a Learning Analysis
Description
Performs a weighted learning analysis.
Usage
.newLearning(fSet, kernel, ...)
## S4 method for signature ''NULL',Kernel'
.newLearning(
fSet,
kernel,
...,
moPropen,
moMain,
moCont,
data,
response,
txName,
lambdas,
cvFolds,
iter,
surrogate,
suppress,
guess,
createObj,
prodPi = 1,
index = NULL
)
## S4 method for signature ''function',Kernel'
.newLearning(
fSet,
kernel,
...,
moPropen,
moMain,
moCont,
data,
response,
txName,
lambdas,
cvFolds,
iter,
surrogate,
suppress,
guess,
createObj,
prodPi = 1,
index = NULL
)
## S4 method for signature ''function',SubsetList'
.newLearning(
fSet,
kernel,
moPropen,
moMain,
moCont,
data,
response,
txName,
lambdas,
cvFolds,
iter,
surrogate,
suppress,
guess,
createObj,
prodPi = 1,
index = NULL,
...
)
Arguments
fSet |
NULL or function defining subset rules |
kernel |
Kernel object or SubsetList |
... |
Additional inputs for optimization |
moPropen |
modelObj for propensity model |
moMain |
modelObj for main effects of outcome model |
moCont |
modelObj for contrasts of outcome model |
data |
data.frame of covariates |
response |
Vector of responses |
txName |
Tx variable column header in data |
lambdas |
Tuning parameter(s) |
cvFolds |
Number of cross-validation folds |
iter |
Maximum number of iterations for outcome regression |
surrogate |
Surrogate object |
suppress |
T/F indicating if prints to screen are executed |
guess |
optional numeric vector providing starting values for optimization methods |
createObj |
A function name defining the method object for a specific learning algorithm |
prodPi |
A vector of propensity weights |
index |
The subset of individuals to be included in learning |
Value
A Learning
object
Combine model object models
Description
Combines moMain and moCont into a single modeling object.
Usage
.newModel(moMain, moCont, ...)
## S4 method for signature 'modelObj,modelObj'
.newModel(moMain, moCont, txName, suppress)
## S4 method for signature 'modelObj,'NULL''
.newModel(moMain, moCont, txName, suppress)
## S4 method for signature ''NULL',modelObj'
.newModel(moMain, moCont, txName, suppress)
Complete an OWL Analysis
Description
Complete an OWL Analysis
Usage
.newOWL(
moPropen,
data,
response,
txName,
lambdas,
cvFolds,
kernel,
fSet,
surrogate,
suppress,
guess,
...
)
Arguments
moPropen |
modelObj for propensity modeling |
data |
data.frame of covariates |
response |
Vector of responses |
txName |
Tx variable column header in data |
lambdas |
Tuning parameter(s) |
cvFolds |
Number of cross-validation folds |
kernel |
Kernel object or SubsetList |
fSet |
NULL or function defining subset rules |
surrogate |
Surrogate object |
suppress |
T/F indicating if prints to screen are executed |
guess |
optional numeric vector providing starting values for optimization methods |
... |
Additional inputs for optimization |
Value
An OWL object
Complete an Optimization Step
Description
Dispatches appropriate methods to optimize an object function.
Usage
.newOptim(kernel, ...)
## S4 method for signature 'LinearKernel'
.newOptim(kernel, lambda, methodObject, suppress, ...)
## S4 method for signature 'Kernel'
.newOptim(kernel, lambda, methodObject, suppress, ...)
Create an OptimObj Object
Description
Call newOptim and stores result under common name
Usage
.newOptimObj(methodObject, kernel, ...)
## S4 method for signature 'ANY'
.newOptimObj(methodObject, lambda, suppress, ...)
## S4 method for signature '.rwl'
.newOptimObj(methodObject, lambda, suppress, ...)
Arguments
methodObject |
object containing parameters needed by a weighted learning method |
... |
additional inputs passed to optimization routine. |
lambda |
tuning parameters |
suppress |
integer indicating screen print preferences |
Estimate the Optimal Treatment and Value Using Classification
Description
Method dispatches the appropriate function to obtain estimates for the optimal treatment and value using classification.
Usage
.newOptimalClass(response, ...)
## S4 method for signature 'vector'
.newOptimalClass(
moPropen,
moMain,
moCont,
moClass,
data,
response,
txName,
iter,
fSet,
suppress,
...
)
## S4 method for signature 'OptimalClass'
.newOptimalClass(
moPropen,
moMain,
moCont,
moClass,
data,
response,
txName,
iter,
fSet,
suppress,
...
)
Complete a the Coarsened/Missing Data Analysis
Description
Dispatches appropriate coarsened or missing data perspective method.
Usage
.newOptimalSeq(moPropen, moMain, moCont, fSet, ...)
## S4 method for signature
## 'ModelObj_DecisionPointList,
## ModelObj_DecisionPointList,
## ModelObj_DecisionPointList,
## list'
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_DecisionPointList,ModelObj_DecisionPointList,‘NULL',list’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_DecisionPointList,‘NULL',ModelObj_DecisionPointList,list’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_DecisionPointList,'NULL','NULL',list'
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_DecisionPointList,
## ModelObj_DecisionPointList,
## ModelObj_DecisionPointList,
## ‘NULL'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_DecisionPointList,ModelObj_DecisionPointList,‘NULL','NULL'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_DecisionPointList,‘NULL',ModelObj_DecisionPointList,'NULL'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_DecisionPointList,'NULL','NULL','NULL''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,modelObj,modelObj,'NULL''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,modelObj,'NULL','NULL''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,'NULL',modelObj,'NULL''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,'NULL','NULL','NULL''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,modelObj,modelObj,'function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,modelObj,'NULL','function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,'NULL',modelObj,'function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,'NULL','NULL','function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_SubsetList,modelObj,modelObj,'function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_SubsetList,modelObj,'NULL','function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_SubsetList,'NULL',modelObj,'function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'ModelObj_SubsetList,'NULL','NULL','function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_SubsetList,
## ModelObj_SubsetList,
## ModelObj_SubsetList,
## ‘function'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_SubsetList,ModelObj_SubsetList,‘NULL','function'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'ModelObj_SubsetList,‘NULL',ModelObj_SubsetList,'function'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature
## 'modelObj,ModelObj_SubsetList,ModelObj_SubsetList,‘function'’
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,ModelObj_SubsetList,'NULL','function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
## S4 method for signature 'modelObj,'NULL',ModelObj_SubsetList,'function''
.newOptimalSeq(
moPropen,
moMain,
moCont,
data,
response,
txName,
regimesObj,
fSet,
iter,
suppress,
argsList,
...
)
Arguments
moPropen |
model object(s) for propensity regression |
moMain |
model object(s) for main effects of outcome regression |
moCont |
model object(s) for contrasts of outcome regression |
fSet |
function(s) defining feasible tx |
... |
additional inputs. |
Perform an Outcome Regression Step
Description
Dispatch appropriate methods to perform outcome regression step.
Usage
.newOutcomeFit(moMain, moCont, txObj, iter, ...)
## S4 method for signature ''NULL','NULL',TxObj,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature 'modelObj,modelObj,TxInfoNoSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature 'modelObj,'NULL',TxInfoNoSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature ''NULL',modelObj,TxInfoNoSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature 'modelObj,modelObj,TxInfoWithSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature 'modelObj,'NULL',TxInfoWithSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature ''NULL',modelObj,TxInfoWithSubsets,'NULL''
.newOutcomeFit(moMain, moCont, txObj, iter, data, response, suppress)
## S4 method for signature 'modelObj,modelObj,TxInfoWithSubsets,integer'
.newOutcomeFit(moMain, moCont, response, txObj, data, iter, suppress)
## S4 method for signature 'modelObj,modelObj,TxInfoNoSubsets,integer'
.newOutcomeFit(moMain, moCont, response, txObj, data, iter, suppress)
## S4 method for signature
## 'ModelObj_SubsetList,ModelObj_SubsetList,TxInfoWithSubsets,integer'
.newOutcomeFit(moMain, moCont, response, txObj, data, iter, suppress)
## S4 method for signature
## 'ModelObj_SubsetList,ModelObj_SubsetList,TxInfoWithSubsets,ANY'
.newOutcomeFit(moMain, moCont, txObj, data, response, iter, suppress)
## S4 method for signature 'ModelObj_SubsetList,'NULL',TxInfoWithSubsets,ANY'
.newOutcomeFit(moMain, moCont, txObj, data, response, iter, suppress)
## S4 method for signature ''NULL',ModelObj_SubsetList,TxInfoWithSubsets,ANY'
.newOutcomeFit(moMain, moCont, txObj, data, response, iter, suppress)
Arguments
moMain |
A modeling object for main effects or NULL |
moCont |
A modeling object for contrasts or NULL |
txObj |
A TxObj object |
iter |
NULL or numeric |
... |
Any optional additional input. |
Create a new OutcomeObj
object
Description
Calls newOutcomeFit and stores in @outcome.
Usage
.newOutcomeObj(moMain, moCont, txObj, iter, ...)
## S4 method for signature 'ANY,ANY,ANY'
.newOutcomeObj(moMain, moCont, txObj, data, response, iter, suppress)
## S4 method for signature
## 'ModelObj_DecisionPointList,ModelObj_DecisionPointList,TxInfoList'
.newOutcomeObj(moMain, moCont, txObj, data, response, iter, suppress, ...)
## S4 method for signature 'ModelObj_DecisionPointList,ANY,TxInfoList'
.newOutcomeObj(moMain, moCont, txObj, data, response, iter, suppress, ...)
## S4 method for signature ''NULL',ModelObj_DecisionPointList,TxInfoList'
.newOutcomeObj(moMain, moCont, txObj, data, response, iter, suppress, ...)
Arguments
moMain |
A modeling object for main effects |
moCont |
A modeling object for contrasts |
txObj |
A TxObj object |
iter |
NULL or integer |
... |
Any optional additional input. |
Complete a Propensity Regression Step
Description
Dispatches appropriate method for completing propensity regressions.
Usage
.newPropensityFit(moPropen, txObj, ...)
## S4 method for signature 'modelObj,TxInfoNoSubsets'
.newPropensityFit(moPropen, txObj, data, suppress)
## S4 method for signature 'modelObj,TxInfoWithSubsets'
.newPropensityFit(moPropen, txObj, data, suppress)
## S4 method for signature 'ModelObj_SubsetList,TxInfoWithSubsets'
.newPropensityFit(moPropen, txObj, data, suppress)
Arguments
moPropen |
A modeling object |
txObj |
A TxObj object |
... |
Any optional additional input. |
Create a new PropensityObj
object
Description
Calls newPropensityFit and stores result in @propen.
Usage
.newPropensityObj(moPropen, txObj, data, suppress, ...)
## S4 method for signature 'ANY,ANY'
.newPropensityObj(moPropen, txObj, data, suppress)
## S4 method for signature 'ModelObj_DecisionPointList,TxInfoList'
.newPropensityObj(moPropen, txObj, data, suppress)
Arguments
moPropen |
A modeling object |
txObj |
A TxObj object |
... |
Any optional additional input. |
Perform a Step of the Q-Learning Algorithm
Description
Method performs all necessary regression and predictions steps for a single step of the Q-learning algorithm.
Usage
.newQLearn(response, ...)
## S4 method for signature 'vector'
.newQLearn(moMain, moCont, fSet, response, data, txName, iter, suppress)
## S4 method for signature 'QLearn'
.newQLearn(moMain, moCont, fSet, response, data, txName, iter, suppress)
Arguments
response |
a vector or the value object returned by a prior call to qlearn() |
moMain |
modeling object specifying the main effects component of the outcome model |
moCont |
modeling object specifying the contrasts component of the outcome model |
fSet |
function defining the feasible tx subsets |
data |
data.frame of covariates and tx received |
txName |
character name of tx variable in data |
iter |
the maximum number of iterations in the iterative algorithm |
suppress |
logical indicating user's screen printing preference |
Value
an object of class QLearn.
Complete a Residual Weighted Learning Analysis
Description
Complete a Residual Weighted Learning Analysis
Usage
.newRWL(kernel, ...)
## S4 method for signature 'SubsetList'
.newRWL(
moPropen,
moMain,
responseType,
data,
response,
txName,
lambdas,
cvFolds,
surrogate,
guess,
kernel,
fSet,
suppress,
...
)
Arguments
kernel |
A Kernel object |
Complete a Residual Weighted Learning Analysis
Description
Complete a Residual Weighted Learning Analysis
Usage
## S4 method for signature 'Kernel'
.newRWL(
moPropen,
moMain,
responseType,
data,
response,
txName,
lambdas,
cvFolds,
surrogate,
guess,
kernel,
fSet,
suppress,
...
)
Arguments
moPropen |
modelObj for propensity modeling |
moMain |
modelObj for main effects |
responseType |
Character indicating type of response |
data |
data.frame of covariates |
response |
vector of responses |
txName |
treatment variable column header in data |
lambdas |
tuning parameter(s) |
cvFolds |
number of cross-validation folds |
surrogate |
Surrogate object |
guess |
optional numeric vector providing starting values for optimization methods |
kernel |
Kernel object |
fSet |
Function or NULL defining subsets |
suppress |
T/F indicating if prints to screen are executed |
... |
Additional inputs for optimization |
Value
An RWL object
Create a new Regime
object
Description
Create a new Regime
object
Usage
.newRegime(object)
## S4 method for signature ''function''
.newRegime(object)
Arguments
object |
A function defining the treatment regime |
Create a New RegimeObj
Object
Description
Calls newRegime and stores object in @regime.
Usage
.newRegimeObj(object)
## S4 method for signature ''function''
.newRegimeObj(object)
## S4 method for signature 'list'
.newRegimeObj(object)
Arguments
object |
A function defining the treatment regime |
Create TxObj
Object
Description
Creates appropriate TxObj
based on class of fSet and txName.
Usage
.newTxObj(fSet, txName, ...)
## S4 method for signature 'ANY,character'
.newTxObj(fSet, txName, ...)
## S4 method for signature ''NULL',character'
.newTxObj(fSet, txName, data, suppress, verify = TRUE)
## S4 method for signature ''function',character'
.newTxObj(fSet, txName, data, suppress, verify = TRUE)
## S4 method for signature 'list,list'
.newTxObj(fSet, txName, data, suppress, verify = TRUE)
## S4 method for signature ''NULL',list'
.newTxObj(fSet, txName, data, suppress, verify = TRUE)
Create TxSubset
Object
Description
Processes input to determine ptsSubset and singleton to create a
TxSubset
object
Usage
.newTxSubset(fSet, superset, ...)
## S4 method for signature ''function',ANY'
.newTxSubset(fSet, superset, ..., data, verify, suppress)
## S4 method for signature ''function',integer'
.newTxSubset(fSet, superset, txName, data, verify, ...)
## S4 method for signature ''function',character'
.newTxSubset(fSet, superset, ..., txName, data, verify)
Complete a Regression Step
Description
This function completes a regression step and stores a character object used to identify the purpose of the step, such as a propensity or outcome regression.
Usage
.newTypedFit(modelObj, txObj, ...)
## S4 method for signature 'modelObj,TxInfoNoSubsets'
.newTypedFit(modelObj, txObj, response, data, type, suppress)
## S4 method for signature 'ModelObj_SubsetList,TxInfoWithSubsets'
.newTypedFit(modelObj, txObj, data, response, type, suppress)
## S4 method for signature 'modelObj,TxInfoWithSubsets'
.newTypedFit(modelObj, txObj, data, response, type, suppress)
Arguments
modelObj |
A modeling object |
txObj |
A TxObj object |
... |
Any optional additional input. |
Create a new TypedFitObj
object
Description
Call newTypedFit and stores result in @fit
Usage
.newTypedFitObj(modelObj, txObj, ...)
## S4 method for signature 'ANY'
.newTypedFitObj(modelObj, txObj, response, data, type, suppress)
Arguments
modelObj |
A modeling object |
txObj |
A TxObj object |
... |
Any optional additional input. |
Perform Classification Step
Description
Perform Classification Step
Usage
.optimalClass(
moPropen,
moMain,
moCont,
moClass,
data,
response,
txName,
iter,
fSet,
suppress,
step
)
Arguments
moPropen |
model object(s) for propensity regression |
moMain |
model object(s) for main effects of outcome regression or NULL |
moCont |
model object(s) for contrasts of outcome regression or NULL |
moClass |
model object(s) for classification procedure |
data |
data.frame of covariates and treatment history |
response |
vector of responses |
txName |
character of column header of data containing tx |
iter |
maximum number of iterations for outcome regression or NULL |
fSet |
function defining subsets or NULL |
suppress |
T/F indicating screen printing preference |
step |
integer indicating step of algorithm |
Value
an object of class OptimalClass
Define the Objective Function
Description
Method is defined by inheriting classes to define the objective function optmized by the genetic algorithm.
Usage
.seqFunc(eta, txObj, ...)
## S4 method for signature 'numeric,TxInfoList'
.seqFunc(eta, txObj, regimesObj, l.data, outcomeObj, propenObj, response)
## S4 method for signature 'numeric,TxObj'
.seqFunc(eta, txObj, regimesObj, l.data, outcomeObj, propenObj, response)
Class BOWL
Description
Class BOWL
contains results from a single step of BOWL algorithm.
Slots
step
Integer indicating step of the algorithm
analysis
Contains a Learning or LearningMulti object.
analysis@txInfo
Feasible tx information.
analysis@propen
Propensity regression analysis.
analysis@outcome
Outcome regression analysis.
analysis@cvInfo
Cross-validation analysis if single regime.
analysis@optim
Optimization analysis if single regime.
analysis@optimResult
list of cross-validation and optimization results if multiple regimes. optimResult[[i]]@cvInfo and optimResult[[i]]@optim.
analysis@optimal
Estimated optimal Tx and value.
analysis@call
Unevaluated call to statistical method.
prodPi
Vector of the products of the propensity for the tx received
sumR
Vector of the sum of the rewards
index
Vector indicating compliance with estimated optimal regime
Methods Available for Objects of Class BOWL
Description
Methods Available for Objects of Class BOWL
Usage
## S4 method for signature 'BOWL'
print(x, ...)
## S4 method for signature 'BOWL'
show(object)
Class BOWLBasic
Description
Class BOWLBasic
contains the results for a single OWL analysis and the
weights needed for next iteration
Slots
analysis
Contains a Learning or LearningMulti object.
analysis@txInfo
Feasible tx information.
analysis@propen
Propensity regression analysis.
analysis@outcome
Outcome regression analysis.
analysis@cvInfo
Cross-validation analysis if single regime.
analysis@optim
Optimization analysis if single regime.
analysis@optimResult
list of cross-validation and optimization results if multiple regimes. optimResult[[i]]@cvInfo and optimResult[[i]]@optim.
analysis@optimal
Estimated optimal Tx and value.
analysis@call
Unevaluated call to statistical method.
prodPi
Vector of the products of the propensity for the tx received
sumR
Vector of the sum of the rewards
index
Vector indicating compliance with estimated optimal regime
Methods Available for Objects of Class BOWLBasic
Description
Methods Available for Objects of Class BOWLBasic
Usage
## S4 method for signature 'BOWLBasic'
Call(name, ...)
## S4 method for signature 'BOWLBasic'
coef(object, ...)
## S4 method for signature 'BOWLBasic'
cvInfo(object, ...)
## S4 method for signature 'BOWLBasic'
estimator(x, ...)
## S4 method for signature 'BOWLBasic'
fitObject(object, ...)
## S4 method for signature 'BOWLBasic'
optimObj(object, ...)
## S4 method for signature 'BOWLBasic,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'BOWLBasic,missing'
optTx(x, newdata, ...)
## S4 method for signature 'BOWLBasic'
outcome(object, ...)
## S4 method for signature 'BOWLBasic,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'BOWLBasic'
print(x, ...)
## S4 method for signature 'BOWLBasic'
propen(object, ...)
## S4 method for signature 'BOWLBasic'
regimeCoef(object, ...)
## S4 method for signature 'BOWLBasic'
show(object)
## S4 method for signature 'BOWLBasic'
summary(object, ...)
Class BOWLObj
Description
Class BOWLObj
contains product and sum information required for
iteration
Slots
prodPi
Vector of the products of the propensity for the tx received
sumR
Vector of the sum of the rewards
index
Vector indicating compliance with estimated optimal regime
Class CVBasic
Description
Class CVBasic
holds cross-validation procedure parameters
Slots
folds
An integer
sample
A lsit
Class CVInfo
Description
Class CVInfo
holds cross-validation procedure results
Slots
value
Values obtained for each parameter combination
params
list of parameter values considered
optimal
list of optimal parameter values
Methods Available for Objects of Class CVInfo
Description
Methods Available for Objects of Class CVInfo
.getPars
retrieves parameters considered in cross-validation.
.getOptimal
retrieves optimal parameters identified in cross-validation.
.getValue
retrieves values obtained in cross-validation.
cvInfo
retrieves cross-validation information.
print
print cross-validation results.
show
display cross-validation results.
summary
summarize cross-validation results.
Usage
## S4 method for signature 'CVInfo'
.getPars(object)
## S4 method for signature 'CVInfo'
.getOptimal(object)
## S4 method for signature 'CVInfo'
.getValue(object)
## S4 method for signature 'CVInfo'
cvInfo(object)
## S4 method for signature 'CVInfo'
print(x, ...)
## S4 method for signature 'CVInfo'
show(object)
## S4 method for signature 'CVInfo'
summary(object, ...)
Class CVInfo2Par
Description
Class CVInfo2Par
holds information regarding cross-validation
procedure when multiple kernel parameters and tuning parameters are
considered.
Slots
value
Matrix of values at parameters considered
Methods Available for Objects of Class CVInfo2Par
Description
Methods Available for Objects of Class CVInfo2Par
Class CVInfoLambda
Description
Class CVInfoLambda
holds information regarding cross-validation
procedure when only multiple lambda values are considered.
Slots
value
Array of values at tuning parameters considered
Methods Available for Objects of Class CVInfoLambda
Description
Methods Available for Objects of Class CVInfoLambda
Class CVInfoObj
Description
Class CVInfoObj
holds information regarding cross-validation
procedure under a common name.
Slots
cvInfo
ANY expected to be CVInfo or NULL
Methods Available for Objects of Class CVInfoObj
Description
Call methods equivalently named for object inheriting from CVInfo. Methods dispached depend on object in @cvInfo.
Usage
## S4 method for signature 'CVInfoObj'
.getPars(object)
## S4 method for signature 'CVInfoObj'
.getOptimal(object)
## S4 method for signature 'CVInfoObj'
.getValue(object)
## S4 method for signature 'CVInfoObj'
cvInfo(object)
## S4 method for signature 'CVInfoObj'
print(x, ...)
## S4 method for signature 'CVInfoObj'
show(object)
## S4 method for signature 'CVInfoObj'
summary(object, ...)
Class CVInfokParam
Description
Class CVInfokParam
holds information regarding cross-validation
procedure when only multiple kernel parameters values are considered.
Slots
value
Array of values at parameters considered
Methods Available for Objects of Class CVInfokParam
Description
Methods Available for Objects of Class CVInfokParam
Retrieve Unevaluated Original Call
Description
Returns the unevaluated original call to a DynTxRegime statistical method.
Usage
Call(name, ...)
Arguments
name |
Object for which call is desired |
... |
Optional additional input required by R's base call(). |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
Class ClassificationFit
Description
Class ClassificationFit
combines a TypedFit
object and a
TxInfoNoSubsets
object to define a classification regression result
when subsets are not identified.
Methods Available for Objects of Class ClassificationFit
Description
.predictAll(object, newdata)
predicts optimal treatment
Usage
## S4 method for signature 'ClassificationFit'
classif(object, ...)
## S4 method for signature 'ClassificationFit'
coef(object, ...)
## S4 method for signature 'ClassificationFit'
fitObject(object, ...)
## S4 method for signature 'ClassificationFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'ClassificationFit'
predict(object, ...)
## S4 method for signature 'ClassificationFit,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'ClassificationFit'
print(x, ...)
## S4 method for signature 'ClassificationFit'
show(object)
## S4 method for signature 'ClassificationFit'
summary(object, ...)
Class ClassificationFit_SubsetList
Description
Class ClassificationFit_SubsetList
contains a
TypedFit_SubsetList
object to define classification regression
results when subsets are identified and modeled uniquely.
Methods Available for Objects of Class ClassificationFit_SubsetList
Description
.predictAll(object, newdata)
predicts optimal treatment
Usage
## S4 method for signature 'ClassificationFit_SubsetList'
classif(object, ...)
## S4 method for signature 'ClassificationFit_SubsetList'
coef(object, ...)
## S4 method for signature 'ClassificationFit_SubsetList'
fitObject(object, ...)
## S4 method for signature 'ClassificationFit_SubsetList'
predict(object, ...)
## S4 method for signature 'ClassificationFit_SubsetList,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'ClassificationFit_SubsetList'
summary(object, ...)
Class ClassificationFit_fSet
Description
Class ClassificationFit_fSet
contains a TypedFit_fSet
object to
define a classification regression result when subsets are identified but
not modeled uniquely.
Methods Available for Objects of Class ClassificationFit_fSet
Description
.predictAll(object, newdata)
predicts optimal treatment
Usage
## S4 method for signature 'ClassificationFit_fSet'
classif(object, ...)
## S4 method for signature 'ClassificationFit_fSet'
coef(object, ...)
## S4 method for signature 'ClassificationFit_fSet'
fitObject(object, ...)
## S4 method for signature 'ClassificationFit_fSet,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'ClassificationFit_fSet'
summary(object, ...)
Class ClassificationObj
Description
Stores classification regression results under a common name.
Slots
classif
ANY - required to be NA,
ClassificationFit
,ClassificationFit_fSet
, or
ClassificationFit_SubsetList
.
Methods Available for Objects of Class ClassificationObj
Description
.predictAll(object, newdata)
predicts optimal treatment
Usage
## S4 method for signature 'ClassificationObj'
classif(object, ...)
## S4 method for signature 'ClassificationObj'
coef(object, ...)
## S4 method for signature 'ClassificationObj'
fitObject(object, ...)
## S4 method for signature 'ClassificationObj,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'ClassificationObj'
predict(object, ...)
## S4 method for signature 'ClassificationObj,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'ClassificationObj'
print(x, ...)
## S4 method for signature 'ClassificationObj'
show(object)
## S4 method for signature 'ClassificationObj'
summary(object, ...)
Identify Statistical Method Used to Obtain Result
Description
Prints are displays a brief description of the statistical method used to obtain the input object.
Usage
DTRstep(object)
Arguments
object |
Value object returned by any statistical method of DynTxRegime |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
Class DecisionPointList
Description
Class DecisionListList
represents a List
for decision points.
This class extends List
to require non-zero length.
Usage
## S4 method for signature 'DecisionPointList'
initialize(.Object, ...)
Methods Available for Objects of Class DecisionPointList
Description
Methods Available for Objects of Class DecisionPointList
plot(x,suppress)
generates plots of the regression analysis for each decision point.
If suppress = FALSE, titles of plot will include the decision point
identifier.
print(x)
adds decision point information to print statements.
Each decision point is preceded by 'dp=x' where x is the decision point
number.
show(object)
adds decision point information to show statements.
Each decision point is preceded by 'dp=x' where x is the decision point
number.
Usage
## S4 method for signature 'DecisionPointList,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'DecisionPointList'
print(x, ...)
## S4 method for signature 'DecisionPointList'
show(object)
Class DynTxRegime
Description
Class DynTxRegime
is a component of all statistical methods
implemented in the package. This class contains the estimated optimal Tx,
decision functions if applicable, the estimated value and the original
unevaluated call. It extends internal class OptimalObj
.
Slots
call
object of class call or NULL
Hidden methods
Description
Hidden methods
Retrieve the Decision Point to which modelObj Pertains
Retrieve the Subset to which modelObj Pertains
Constructor method of SubsetList Class
Compare Equivalence of Provided Treatment Vectors
Convert a -1/1 Tx to User Provided Tx
Convert a User Provided Tx Variable to Binary -1/1
Convert Provided Treatment Vector to Appropriate Class
Get Treatment Levels
Retrieve Superset
Retrieve Treatment Variable Name
Ensure Validity of Provided Treatment Vector
Make Predictions for all Treatments.
Make Predictions for all Treatments.
Uses .predictAll() defined for OutcomeObj objects
Uses optTx defined for DynTxRegime objects
Print Q-Learning Information
Show Q-Learning Information
Usage
tmp(x)
## S4 method for signature 'List'
initialize(.Object, ...)
## S4 replacement method for signature 'List'
x[[i]] <- value
## S4 replacement method for signature 'DecisionPointList'
x[[i]] <- value
.getDecisionPoint(object)
.getSubset(object)
## S4 method for signature 'SubsetList'
initialize(.Object, ...)
## S4 replacement method for signature 'SubsetList'
x[[i]] <- value
## S4 method for signature 'ModelObj_SubsetList,ANY'
plot(x, y, ...)
## S4 method for signature 'ModelObj_DecisionPointList,ANY'
plot(x, y, ...)
.compareTx(object, vec1, vec2)
.convertFromBinary(txObj, ...)
.convertToBinary(txObj, ...)
.convertTx(object, txVec)
.getLevels(object, txVec)
.getSuperset(object)
.getTxName(object)
.validTx(object, txVec)
.getPtsSubset(object)
.getSingleton(object)
.getSubsetRule(object)
.getSubsets(object)
## S4 method for signature 'ANY'
.getSubsetRule(object)
.identifySubsets(fSetResult, input, ...)
## S4 method for signature 'list,data.frame'
.identifySubsets(fSetResult, input, ..., fSet)
## S4 method for signature 'list,list'
.identifySubsets(fSetResult, input, ..., fSet)
## S4 method for signature 'ANY,data.frame'
.identifySubsets(fSetResult, input, ..., fSet)
## S4 method for signature 'ANY,list'
.identifySubsets(fSetResult, input, ..., fSet)
## S4 method for signature 'ANY,ANY'
.identifySubsets(fSetResult, input, ..., fSet)
## S4 method for signature 'TxInfoList'
initialize(.Object, ...)
.predictAll(object, newdata, ...)
.predictMu(object, data, ...)
## S4 method for signature 'QLearn'
Call(name, ...)
## S4 method for signature 'QLearn'
coef(object, ...)
## S4 method for signature 'QLearn'
DTRstep(object)
## S4 method for signature 'QLearn'
estimator(x, ...)
## S4 method for signature 'QLearn'
fitObject(object, ...)
## S4 method for signature 'QLearn,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'QLearn,missing'
optTx(x, newdata, ...)
## S4 method for signature 'QLearn'
outcome(object, ...)
## S4 method for signature 'QLearn,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'QLearn'
print(x, ...)
## S4 method for signature 'QLearn'
show(object)
## S4 method for signature 'QLearn'
summary(object, ...)
## S4 method for signature 'IQLearnSS'
DTRstep(object)
## S4 method for signature 'IQLearnFS_C'
DTRstep(object)
## S4 method for signature 'IQLearnFS_ME'
DTRstep(object)
## S4 method for signature 'IQLearnFS_VHet'
DTRstep(object)
.getNumPars(object)
.getParNames(object)
.getPars(object)
.getRegimeFunction(object)
.predictOptimalTx(x, newdata, ...)
.setPars(object, pars)
## S4 method for signature 'OptimalSeq'
Call(name, ...)
## S4 method for signature 'OptimalSeq'
coef(object, ...)
## S4 method for signature 'OptimalSeq'
DTRstep(object)
## S4 method for signature 'OptimalSeq'
estimator(x, ...)
## S4 method for signature 'OptimalSeq'
fitObject(object, ...)
## S4 method for signature 'OptimalSeq,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalSeq,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalSeq'
outcome(object, ...)
## S4 method for signature 'OptimalSeq,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'OptimalSeq'
propen(object, ...)
## S4 method for signature 'OptimalSeq'
regimeCoef(object, ...)
## S4 method for signature 'OptimalSeq'
summary(object, ...)
## S4 method for signature 'OptimalClass'
Call(name, ...)
## S4 method for signature 'OptimalClass'
coef(object, ...)
## S4 method for signature 'OptimalClass'
DTRstep(object)
## S4 method for signature 'OptimalClass'
estimator(x, ...)
## S4 method for signature 'OptimalClass'
fitObject(object, ...)
## S4 method for signature 'OptimalClass,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalClass,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalClass'
outcome(object, ...)
## S4 method for signature 'OptimalClass,missing'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OptimalClass'
propen(object, ...)
## S4 method for signature 'OptimalClass'
summary(object, ...)
## S4 method for signature 'Kernel'
initialize(.Object, data, model, kparam, ...)
.getKernelX(data, object, ...)
.kernel(object, x1, x2, ...)
.kernelNumPars(object, ...)
.dPhiFunc(surrogate, ...)
.optim(surrogate, ...)
.phiFunc(surrogate, ...)
.dobjFn(par, methodObject, kernel, ...)
.objFn(par, methodObject, kernel, ...)
.subsetObject(methodObject, ...)
.valueFunc(methodObject, ...)
.optimFunc(methodObject, ...)
## S4 method for signature 'CVBasic'
initialize(.Object, cvFolds, txVec, ...)
.getValue(object)
.getOptimal(object)
## S4 method for signature 'OWL'
Call(name, ...)
## S4 method for signature 'OWL'
coef(object, ...)
## S4 method for signature 'OWL'
cvInfo(object, ...)
## S4 method for signature 'OWL'
DTRstep(object)
## S4 method for signature 'OWL'
estimator(x, ...)
## S4 method for signature 'OWL'
fitObject(object, ...)
## S4 method for signature 'OWL'
optimObj(object, ...)
## S4 method for signature 'OWL,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'OWL,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OWL'
outcome(object, ...)
## S4 method for signature 'OWL,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'OWL'
propen(object, ...)
## S4 method for signature 'OWL'
regimeCoef(object, ...)
## S4 method for signature 'OWL'
summary(object, ...)
## S4 method for signature 'RWL'
Call(name, ...)
## S4 method for signature 'RWL'
coef(object, ...)
## S4 method for signature 'RWL'
cvInfo(object, ...)
## S4 method for signature 'RWL'
DTRstep(object)
## S4 method for signature 'RWL'
estimator(x, ...)
## S4 method for signature 'RWL'
fitObject(object, ...)
## S4 method for signature 'RWL'
optimObj(object, ...)
## S4 method for signature 'RWL,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'RWL,missing'
optTx(x, newdata, ...)
## S4 method for signature 'RWL'
outcome(object, ...)
## S4 method for signature 'RWL,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'RWL'
propen(object, ...)
## S4 method for signature 'RWL'
regimeCoef(object, ...)
## S4 method for signature 'RWL'
residuals(object, ...)
## S4 method for signature 'RWL'
summary(object, ...)
.newBOWL(BOWLObj, ...)
## S4 method for signature 'BOWL'
Call(name, ...)
## S4 method for signature 'BOWL'
cvInfo(object, ...)
## S4 method for signature 'BOWL'
coef(object, ...)
## S4 method for signature 'BOWL'
DTRstep(object)
## S4 method for signature 'BOWL'
estimator(x, ...)
## S4 method for signature 'BOWL'
fitObject(object, ...)
## S4 method for signature 'BOWL'
optimObj(object, ...)
## S4 method for signature 'BOWL,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'BOWL,missing'
optTx(x, newdata, ...)
## S4 method for signature 'BOWL'
outcome(object, ...)
## S4 method for signature 'BOWL,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'BOWL'
propen(object, ...)
## S4 method for signature 'BOWL'
regimeCoef(object, ...)
## S4 method for signature 'BOWL'
summary(object, ...)
## S4 method for signature 'EARL'
Call(name, ...)
## S4 method for signature 'EARL'
coef(object, ...)
## S4 method for signature 'EARL'
cvInfo(object, ...)
## S4 method for signature 'EARL'
DTRstep(object)
## S4 method for signature 'EARL'
estimator(x, ...)
## S4 method for signature 'EARL'
fitObject(object, ...)
## S4 method for signature 'EARL'
optimObj(object, ...)
## S4 method for signature 'EARL,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'EARL,missing'
optTx(x, newdata, ...)
## S4 method for signature 'EARL'
outcome(object, ...)
## S4 method for signature 'EARL,missing'
plot(x, y, suppress = FALSE, ...)
## S4 method for signature 'EARL'
propen(object, ...)
## S4 method for signature 'EARL'
regimeCoef(object, ...)
## S4 method for signature 'EARL'
summary(object, ...)
Methods Available for Objects of Class DynTxRegime
Description
Methods Available for Objects of Class DynTxRegime
Call(name)
retrieves the unevaluated call to the original statistical method
Usage
## S4 method for signature 'DynTxRegime'
Call(name, ...)
Class EARL
Description
Class EARL
contains results for an EARL analysis.
Slots
analysis
Contains a Learning or LearningMulti object.
analysis@txInfo
Feasible tx information.
analysis@propen
Propensity regression analysis.
analysis@outcome
Outcome regression analysis.
analysis@cvInfo
Cross-validation analysis if single regime.
analysis@optim
Optimization analysis if single regime.
analysis@optimResult
list of cross-validation and optimization results if multiple regimes. optimResult[[i]]@cvInfo and optimResult[[i]]@optim.
analysis@optimal
Estimated optimal Tx and value.
analysis@call
Unevaluated call to statistical method.
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- propen
: Retrieve value object returned by propensity regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Post-Processing of Optimization Analysis
- cvInfo
: Retrieve cross-validation results.
- optimObj
: Retrieve value object returned by optimization method(s).
- regimeCoef
: Retrieve estimated parameters for optimal tx regime.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class EARL
Description
Methods Available for Objects of Class EARL
Usage
## S4 method for signature 'EARL'
print(x, ...)
## S4 method for signature 'EARL'
show(object)
Class ExpSurrogate
Description
Exponential surrogate for 0/1 loss.
Methods Available for Objects of Class ExpSurrogate
Description
Methods Available for Objects of Class ExpSurrogate
.phiFunc
calculates exponential surrogate loss-function
.dphiFunc
calculates derivative of exponential surrogate loss-function
Usage
## S4 method for signature 'ExpSurrogate'
.phiFunc(surrogate, u)
## S4 method for signature 'ExpSurrogate'
.dPhiFunc(surrogate, u, du)
Class HingeSurrogate
Description
Hinge surrogate for 0/1 loss function.
Methods Available for Objects of Class HingeSurrogate
Description
Utilizes dfoptim::hjk to obtain parameter estimates. Requires that the objective function be defined by the calling learning method. Returns NULL if optimization is not successful due to problems or the list object returned by dfoptim::hjk if optimization is successful.
Usage
## S4 method for signature 'HingeSurrogate'
.phiFunc(surrogate, u)
## S4 method for signature 'HingeSurrogate'
.dPhiFunc(surrogate, u, du)
## S4 method for signature 'HingeSurrogate'
.optim(surrogate, par, lambda, fn, gr, suppress, ...)
Class HuberHingeSurrogate
Description
Huberized hinge surrogate for 0/1 loss function.
Methods Available for Objects of Class HuberHingeSurrogate
Description
Methods Available for Objects of Class HuberHingeSurrogate
.phiFunc
calculates huberized hinge surrogate loss-function
.dphiFunc
calculates derivative of huberized hinge surrogate loss-function
Usage
## S4 method for signature 'HuberHingeSurrogate'
.phiFunc(surrogate, u)
## S4 method for signature 'HuberHingeSurrogate'
.dPhiFunc(surrogate, u, du)
Class IQLearnFS
Description
Class IQLearnFS
contains results for a component of the first stage
analysis of the interactive Q-Learning algorithm.
Methods Available for Objects of Class IQLearnFS
Description
Employs methods defined for QLearn
Usage
## S4 method for signature 'IQLearnFS'
print(x, ...)
## S4 method for signature 'IQLearnFS'
show(object)
## S4 method for signature 'IQLearnFS'
summary(object, ...)
Class IQLearnFS_C
Description
Class IQLearnFS_C
contains the results for the first stage
contrasts component of the interactive Q-Learning algorithm.
Objects of this class are returned by iqLearnFSC().
Slots
txVec
: A numeric. treatment vector from training data
residuals
: A numeric. residuals of the fit
step
: Not used in this context.
outcome
: The outcome regression analysis
txInfo
: The feasible tx information
optimal
: The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
- residuals
:Retrieve the residuals of the regression.
- sd
:Retrieve the standard deviation of the residuals.
Methods Available for Objects of Class IQLearnFS_C
Description
Methods Available for Objects of Class IQLearnFS_C
Usage
## S4 method for signature 'IQLearnFS_C'
print(x, ...)
## S4 method for signature 'IQLearnFS_C'
show(object)
Class IQLearnFS_ME
Description
Class IQLearnFS_ME
contains the results for the first stage
main effects component of the interactive Q-Learning algorithm.
Objects of this class are returned by iqLearnFSM().
Slots
step
: Not used in this context.
outcome
: The outcome regression analysis
txInfo
: The feasible tx information
optimal
: The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class IQLearnFS_ME
Description
Methods Available for Objects of Class IQLearnFS_ME
Usage
## S4 method for signature 'IQLearnFS_ME'
print(x, ...)
## S4 method for signature 'IQLearnFS_ME'
show(object)
Class IQLearnFS_VHet
Description
Class IQLearnFS_VHet
contains the results for the first stage
residuals component of the interactive Q-Learning algorithm.
Objects of this class are returned by iqLearnFSV().
Slots
residuals
: Standardized residuals of contrast after modeling
scale
: Scaling factor for stdization
step
: Not used in this context.
outcome
: The outcome regression analysis
txInfo
: The feasible tx information
optimal
: The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
- residuals
:Retrieve the residuals of the regression.
- qqplot
QQ plot of the residuals for the interactive Q-Learning algorithm.
Methods Available for Objects of Class IQLearnFS_VHet
Description
Methods Available for Objects of Class IQLearnFS_VHet
Usage
## S4 method for signature 'IQLearnFS_VHet'
print(x, ...)
## S4 method for signature 'IQLearnFS_VHet'
qqplot(
x,
y,
plot.it = TRUE,
xlab = deparse1(substitute(x)),
ylab = deparse1(substitute(y)),
...,
conf.level = NULL,
conf.args = list(exact = NULL, simulate.p.value = FALSE, B = 2000, col = NA, border =
NULL)
)
## S4 method for signature 'IQLearnFS_VHet'
show(object)
Functions
-
qqplot(IQLearnFS_VHet)
:
Class IQLearnSS
Description
Class IQLearnSS
contains the results for the second stage
of the interactive Q-Learning algorithm. Objects of this class are
returned by iqLearnSS().
Slots
yContHat
: A numeric. Estimated contrast component
yMainHat
: A numeric. Estimated main effects component
delta
: A numeric. Indicator of compliance * response used for value calc
step
: Not used in this context.
outcome
: The outcome regression analysis
txInfo
: The feasible tx information
optimal
: The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
- fittCont
:Retrieve the contrasts component of the regression.
- fittMain
:Retrieve the main effects component of the regression.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class IQLearnSS
Description
Methods Available for Objects of Class IQLearnSS
Usage
## S4 method for signature 'IQLearnSS'
print(x, ...)
## S4 method for signature 'IQLearnSS'
show(object)
Class Kernel
Description
Class Kernel
holds information regarding the decision function kernel
Slots
model
An formula. Defines the covariates of the kernel.
X
A matrix. The covariates of the kernel
kparam
ANY. The kernel parameter
Methods Available for Objects of Class Kernel
Description
Methods Available for Objects of Class Kernel
.getKernelX
retrieves the covariates matrix of the kernel.
.kernelNumPars
retrieves the number of covariates of the kernel.
.kernel
calculates the kernel
print
prints kernel model.
show
displays kernel model.
summary
returns a list containing the kernel model.
Usage
## S4 method for signature 'data.frame,Kernel'
.getKernelX(data, object)
## S4 method for signature 'Kernel'
.kernelNumPars(object, ...)
## S4 method for signature 'Kernel,missing,missing'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,data.frame,data.frame'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,vector,vector'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,vector,data.frame'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,data.frame,vector'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,matrix,data.frame'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,data.frame,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,vector,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,matrix,vector'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel,matrix,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'Kernel'
print(x, ...)
## S4 method for signature 'Kernel'
show(object)
## S4 method for signature 'Kernel'
summary(object, ...)
Class KernelObj
Description
Class KernelObj
holds decision function kernel information
under a common name.
Usage
## S4 method for signature 'KernelObj'
.kernelNumPars(object, ...)
Slots
kernel
ANY expected to be
Kernel
orSubsetList
Methods Available for Objects of Class KernelObj
Description
Methods Available for Objects of Class KernelObj
.getKernelX
not allowed.
.kernel
not allowed.
print
prints kernel model. Includes "Kernel" as header.
show
displays kernel model. Includes "Kernel" as header.
summary
not allowed.
Usage
## S4 method for signature 'data.frame,KernelObj'
.getKernelX(data, object)
## S4 method for signature 'KernelObj,ANY,ANY'
.kernel(object, x1, x2, ...)
## S4 method for signature 'KernelObj,missing,missing'
.kernel(object, x1, x2, ...)
## S4 method for signature 'KernelObj,missing,ANY'
.kernel(object, x1, x2, ...)
## S4 method for signature 'KernelObj,ANY,missing'
.kernel(object, x1, x2, ...)
## S4 method for signature 'KernelObj'
print(x, ...)
## S4 method for signature 'KernelObj'
show(object)
## S4 method for signature 'KernelObj'
summary(object, ...)
Class Learning
Description
Class Learning
contains results for a learning analysis with one
regime.
Slots
txInfo
Feasible tx information
propen
Propensity regression analysis
outcome
Outcome regression analysis
optim
Optimization analysis
Methods Available for Objects of Class Learning
Description
Methods Available for Objects of Class Learning
Usage
## S4 method for signature 'Learning'
Call(name, ...)
## S4 method for signature 'Learning'
cvInfo(object, ...)
## S4 method for signature 'Learning'
coef(object, ...)
## S4 method for signature 'Learning'
estimator(x, ...)
## S4 method for signature 'Learning'
fitObject(object, ...)
## S4 method for signature 'Learning'
optimObj(object, ...)
## S4 method for signature 'Learning,data.frame'
optTx(x, newdata)
## S4 method for signature 'Learning,missing'
optTx(x, newdata, ...)
## S4 method for signature 'Learning'
outcome(object, ...)
## S4 method for signature 'Learning,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'Learning'
print(x, ...)
## S4 method for signature 'Learning'
propen(object, ...)
## S4 method for signature 'Learning'
regimeCoef(object, ...)
## S4 method for signature 'Learning'
show(object)
## S4 method for signature 'Learning'
summary(object, ...)
Class LearningMulti
Description
Class LearningMulti
contains results for a learning analysis
with multiple regimes.
Slots
optimResult
ANY containing a list of OptimStep results
Methods Available for Objects of Class LearningMulti
Description
Methods Available for Objects of Class LearningMulti
Usage
## S4 method for signature 'LearningMulti'
Call(name, ...)
## S4 method for signature 'LearningMulti'
cvInfo(object, ...)
## S4 method for signature 'LearningMulti'
coef(object, ...)
## S4 method for signature 'LearningMulti'
estimator(x, ...)
## S4 method for signature 'LearningMulti'
fitObject(object, ...)
## S4 method for signature 'LearningMulti'
optimObj(object, ...)
## S4 method for signature 'LearningMulti,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'LearningMulti,missing'
optTx(x, newdata, ...)
## S4 method for signature 'LearningMulti'
outcome(object, ...)
## S4 method for signature 'LearningMulti,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'LearningMulti'
print(x, ...)
## S4 method for signature 'LearningMulti'
propen(object, ...)
## S4 method for signature 'LearningMulti'
regimeCoef(object, ...)
## S4 method for signature 'LearningMulti'
show(object)
## S4 method for signature 'LearningMulti'
summary(object, ...)
Class LearningObject
Description
Class LearningObject
contains stores parameters required for
weighted learning optimization step
Slots
mu
Matrix of outcome regression
txVec
Vector of treatment coded as -1/1
invPi
Vector of inverse propensity for treatment received
response
Vector of the response
Methods Available for Objects of Class LearningObject
Description
Methods Available for Objects of Class LearningObject
Create LearningObject
Usage
## S4 method for signature 'LearningObject'
.subsetObject(methodObject, subset)
## S4 method for signature 'numeric,LearningObject,Kernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,LearningObject,Kernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'LearningObject'
.valueFunc(methodObject, optTx, ...)
.createLearningObject(
kernel,
surrogate,
mu,
txVec,
response,
prWgt,
guess = NULL,
...
)
Arguments
kernel |
Kernel object |
surrogate |
Surrogate object indicating surrogate loss-function |
mu |
Matrix of predicted outcome on binary tx coding |
txVec |
Tx vector coded as -1/1 |
response |
vector of response |
prWgt |
propensity wgt for tx received |
guess |
Vector of estimated regime parameters |
Value
A LearningObject object
Class LinearKernel
Description
Class LinearKernel
holds information regarding decision function
when kernel is linear
Methods Available for Objects of Class LinearKernel
Description
Methods Available for Objects of Class LinearKernel
Usage
## S4 method for signature 'LinearKernel'
.kernelNumPars(object, ...)
## S4 method for signature 'LinearKernel,matrix,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'LinearKernel'
print(x, ...)
## S4 method for signature 'LinearKernel'
show(object)
## S4 method for signature 'LinearKernel'
summary(object, ...)
Class List
Description
Class List
mimics a list
.
Slots
names
Character vector of names for elements
Class LogitSurrogate
Description
Logistic surrogate for 0/1 loss function.
Methods Available for Objects of Class LogitSurrogate
Description
Methods Available for Objects of Class LogitSurrogate
.phiFunc
calculates logistic surrogate loss-function
.dphiFunc
calculates derivative of logistic surrogate loss-function
Usage
## S4 method for signature 'LogitSurrogate'
.phiFunc(surrogate, u)
## S4 method for signature 'LogitSurrogate'
.dPhiFunc(surrogate, u, du)
Class MethodObject
Description
Class MethodObject
stores parameters required for optimization step
Slots
x
Matrix of covariates for kernel
surrogate
The Surrogate for the loss-function
pars
Vector of regime parameters
kernel
The Kernel defining the decision function
Methods Available for Objects of Class MethodObject
Description
Methods Available for Objects of Class MethodObject
Create method object
Usage
## S4 method for signature 'MethodObject'
.subsetObject(methodObject, subset)
## S4 method for signature 'numeric,MethodObject,Kernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,MethodObject,Kernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'MethodObject'
.valueFunc(methodObject, optTx, ...)
.createMethodObject(kernel, surrogate, guess = NULL, ...)
Arguments
kernel |
Kernel object |
surrogate |
Surrogate object indicating surrogate loss-function |
guess |
Vector of estimated regime parameters |
Value
A MethodObject object
Class ModelObjSubset
Description
Class ModelObjSubset
stores a modelObj object with pertinent subset
information
Slots
decisionPoint
integer indicating the decision point for modelObj
subset
character indicating the subset for modelObj
import modelObj
Methods Available for Objects of Class ModelObjSubset
Description
Methods Available for Objects of Class ModelObjSubset
.getDecisionPoint(object)
retrieves the decision point to which object pertains
.getSubset(object)
retrieves the subset to which object pertains
Usage
## S4 method for signature 'ModelObjSubset'
.getDecisionPoint(object)
## S4 method for signature 'ModelObjSubset'
.getSubset(object)
Class ModelObj_DecisionPointList
Description
Class ModelObj_DecisionPointList
represents a List
for
multiple decision points. Contents can be other modelObj or ModeObj_SubsetList.
Usage
## S4 method for signature 'ModelObj_DecisionPointList'
initialize(.Object, ...)
Class ModelObj_SubsetList
Description
Class ModelObj_SubsetList
represents a List
for subset
modelObj.
Usage
## S4 method for signature 'ModelObj_SubsetList'
initialize(.Object, ...)
Class MultiRadialKernel
Description
Class MultiRadialKernel
holds information regarding decision function
when kernel is radial and multiple kernel parameters
Methods Available for Objects of Class MultiRadialKernel
Description
Methods Available for Objects of Class MultiRadialKernel
.kernel
not allowed.
print
not allowed.
show
not allowed.
summary
not allowed.
Usage
## S4 method for signature 'MultiRadialKernel,matrix,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'MultiRadialKernel'
print(x, ...)
## S4 method for signature 'MultiRadialKernel'
show(object)
## S4 method for signature 'MultiRadialKernel'
summary(object, ...)
Class OWL
Description
Class OWL
contains results for an OWL analysis.
Slots
analysis
Contains a Learning or LearningMulti object.
analysis@txInfo
Feasible tx information.
analysis@propen
Propensity regression analysis.
analysis@outcome
Outcome regression analysis.
analysis@cvInfo
Cross-validation analysis if single regime.
analysis@optim
Optimization analysis if single regime.
analysis@optimResult
list of cross-validation and optimization results if multiple regimes. optimResult[[i]]@cvInfo and optimResult[[i]]@optim.
analysis@optimal
Estimated optimal Tx and value.
analysis@call
Unevaluated call to statistical method.
Methods For Post-Processing of Regression Analysis
- propen
: Retrieve value object returned by propensity regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Post-Processing of Optimization Analysis
- cvInfo
: Retrieve cross-validation results.
- optimObj
: Retrieve value object returned by optimization method(s).
- regimeCoef
: Retrieve estimated parameters for optimal tx regime.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class OWL
Description
Methods Available for Objects of Class OWL
Usage
## S4 method for signature 'OWL'
print(x, ...)
## S4 method for signature 'OWL'
show(object)
Class OptimBasic
Description
Class OptimBasic
holds results of an optimization step when linear
kernel is used for decision function.
Slots
lambda
A numeric, tuning parameter
optim
A list, value object returned by optimization method expected optimization methods are optim and hjk
surrogate
A Surrogate object specifying loss-function surrogate
Methods Available for Objects of Class OptimBasic
Description
Methods Available for Objects of Class OptimBasic
Usage
## S4 method for signature 'OptimBasic'
optimObj(object, ...)
## S4 method for signature 'OptimBasic,matrix'
.predictOptimalTx(x, newdata)
## S4 method for signature 'OptimBasic,data.frame'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimBasic,missing'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimBasic'
print(x, ...)
## S4 method for signature 'OptimBasic'
regimeCoef(object, ...)
## S4 method for signature 'OptimBasic'
show(object)
## S4 method for signature 'OptimBasic'
summary(object, ...)
Class OptimKernel
Description
Class OptimKernel
holds results of an optimization step when non-linear
kernel is used for decision function.
Methods Available for Objects of Class OptimKernel
Description
Methods Available for Objects of Class OptimKernel
Usage
## S4 method for signature 'OptimKernel,matrix'
.predictOptimalTx(x, newdata)
## S4 method for signature 'OptimKernel,data.frame'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimKernel,missing'
.predictOptimalTx(x, newdata, ...)
Class OptimObj
Description
Class OptimObj
stores the optimization results under a common name
for weighted learning methods.
Slots
optim
ANY - expected to be
OptimBasic
orOptimKernel
Methods Available for Objects of Class OptimObj
Description
Methods Available for Objects of Class OptimObj
Usage
## S4 method for signature 'OptimObj'
optimObj(object, ...)
## S4 method for signature 'OptimObj,matrix'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimObj,data.frame'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimObj,missing'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimObj'
print(x, ...)
## S4 method for signature 'OptimObj'
regimeCoef(object, ...)
## S4 method for signature 'OptimObj'
show(object)
## S4 method for signature 'OptimObj'
summary(object, ...)
Complete Cross-Validation Step and Final Optimization
Description
Complete Cross-Validation Step and Final Optimization
Usage
.OptimStep(methodObject, lambdas, cvFolds, txVec, suppress, ...)
Arguments
methodObject |
Object parameters for weighted learning method |
lambdas |
tuning parameter |
cvFolds |
number of cross-validation folds |
suppress |
integer indicating screen printing preferences |
Class OptimStep
Class OptimStep
holds results of a combined cross-validation and final
optimization step for weighted learning methods.
Description
Class OptimStep
Class OptimStep
holds results of a combined cross-validation and final
optimization step for weighted learning methods.
Methods Available for Objects of Class OptimStep
Description
Methods Available for Objects of Class OptimStep
Usage
## S4 method for signature 'OptimStep'
Call(name, ...)
## S4 method for signature 'OptimStep'
cvInfo(object)
## S4 method for signature 'OptimStep'
estimator(x, ...)
## S4 method for signature 'OptimStep'
optimObj(object)
## S4 method for signature 'OptimStep,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimStep,matrix'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimStep,data.frame'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimStep,missing'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'OptimStep'
print(x, ...)
## S4 method for signature 'OptimStep'
regimeCoef(object)
## S4 method for signature 'OptimStep'
show(object)
## S4 method for signature 'OptimStep'
summary(object, ...)
Class OptimalClass
Description
Class OptimalClass
contains results for a single decision point
when estimates are obtained from the classification perspective.
Objects of this class are returned by optimalClass().
Slots
step
Step in the algorithm.
analysis
Analysis results.
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- propen
: Retrieve value object returned by propensity regression methods.
- classif
: Retrieve value object returned by classification regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class OptimalClass
Description
Methods Available for Objects of Class OptimalClass
Usage
## S4 method for signature 'OptimalClass'
print(x, ...)
## S4 method for signature 'OptimalClass'
show(object)
Class OptimalClassObj
Description
Class OptimalClassObj
contains results for a single decision point
when estimates are obtained from the classification perspective.
Objects of this class are returned by optimalClass().
Slots
class
Results of the classification step.
outcome
Results of the outcome regression step.
propen
Results of the propensity step.
optimal
Estimated optimal tx and value
Call
Unevaluated call.
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- propen
: Retrieve value object returned by propensity regression methods.
- classif
: Retrieve value object returned by classification regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Class OptimalInfo
Description
Class OptimalInfo
stores the estimated optimal tx, decision functions,
and estimated value.
Slots
optimalTx
a vector of the estimated optimal tx
estimatedValue
a vector of the estimated value
decisionFunc
a vector or matrix containing the values used to determine @optimalTx (if applicable)
Methods Available for Objects of Class OptimalInfo
Description
Methods Available for Objects of Class OptimalInfo
estimator(x)
defines the estimated value to be the mean of the vector stored in
@estimatedValue
optTx(x)
returns the contents of @optimalTx and @decisionFunc as a list
optTx(x, newdata)
returns an error
print(x)
Prints a summary table of the recommended tx for the training data and the
estimated value
show(object)
Displays a summary table of the recommended tx for the training data and
the estimated value
summary(object)
Returns a list containing a summary table of the recommended tx for the
training data and the estimated value
Usage
## S4 method for signature 'OptimalInfo'
estimator(x)
## S4 method for signature 'OptimalInfo,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalInfo,ANY'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalInfo'
print(x, ...)
## S4 method for signature 'OptimalInfo'
show(object)
## S4 method for signature 'OptimalInfo'
summary(object, ...)
Class OptimalObj
Description
Class OptimalObj
stores the estimated optimal Tx, decision functions
and estimated value under a common name.
Slots
optimal
ANY - must be
OptimalInfo
orDecisionPointList
ofOptimalInfo
Methods Available for Objects of Class OptimalObj
Description
Methods Available for Objects of Class OptimalObj
estimator(x)
retrieves the estimated value obtained by a statistical method.
Method called determined by class of @optimal.
optTx(x)
returns the estimated decision function and/or optimal tx
Method called determined by class of @optimal.
optTx(x, newdata)
returns an error
print(x)
Prints summary information regarding recommended tx and the estimated
value. Method called determined by class of @optimal.
show(object)
Displays summary information regarding recommended tx and the estimated
value. Method called determined by class of @optimal.
summary(object)
Returns a summary of estimated decision functions and/or optimal tx.
Method called determined by class of @optimal.
Usage
## S4 method for signature 'OptimalObj'
estimator(x)
## S4 method for signature 'OptimalObj,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalObj,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalObj'
print(x, ...)
## S4 method for signature 'OptimalObj'
show(object)
## S4 method for signature 'OptimalObj'
summary(object, ...)
Class OptimalSeq
Description
Class OptimalSeq
contains the results for the estimated optimal tx
and value when estimated from a coarsened or missing data perspective.
Slots
genetic
A list containing the results from the genetic algorithm
propen
Results of the propensity regression step
outcome
Results of the outcome regression step
regime
Results for the regime.
optimal
Results for the estimated optimal tx and value
Call
The unevaluated call.
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- propen
: Retrieve value object returned by propensity regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- regimeCoef
: Retrieve the estimated regime parameters.
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class OptimalSeq
Description
Methods Available for Objects of Class OptimalSeq
print(x)
prints main results of a coarsened/missing data analysis
show(object)
displays main results of a coarsened/missing data analysis
Usage
## S4 method for signature 'OptimalSeq'
print(x, ...)
## S4 method for signature 'OptimalSeq'
show(object)
Class Contains Results for the Coarsened Data IPW/AIPW Method
Description
Methods for multiple decision point analyses. Class inherits directly from
OptimalSeq
and all methods defined for objects of class OptimaSeq
are defined for this class.
Methods Available for Objects of Class OptimalSeqCoarsened
Description
Methods Available for Objects of Class OptimalSeqCoarsened
Call(name)
returns the unevaluated call to method
coef(object)
retrieves coefficients of model functions. Calls method defined for
OptimalSeq
.
DTRstep(x)
print statement indicating the coarsened data perspective
estimator(x)
retrieves the estimated value. Calls method defined for
OptimalSeq
.
fitObject(object)
retrieves value objects of model functions. Calls method defined for
OptimalSeq
.
genetic(object)
retrieves genetic algorithm results. Calls method defined for
OptimalSeq
.
optTx(x,newdata)
estimates optimal tx. Calls method defined for OptimalSeq
.
optTx(x)
retrieves the optimal tx. Calls method defined for OptimalSeq
.
outcome(object)
retrieves value object returned by outcome model functions. Calls method
defined for OptimalSeq
.
plot(x,suppress)
generates plot for model functions. Calls method defined for
OptimalSeq
.
print(x)
Extends method defined for OptimalSeq
to include DTRStep()
propen(object)
retrieves value object returned by propensity model functions. Calls method
defined for OptimalSeq
.
regimeCoef(object)
retrieves estimated tx regime parameters. Calls method defined for
OptimalSeq
.
show(object)
Extends method defined for OptimalSeq
to include DTRStep()
summary(object)
retrieves summary information. Calls method defined for OptimalSeq
.
Usage
## S4 method for signature 'OptimalSeqCoarsened'
Call(name, ...)
## S4 method for signature 'OptimalSeqCoarsened'
coef(object, ...)
## S4 method for signature 'OptimalSeqCoarsened'
DTRstep(object)
## S4 method for signature 'OptimalSeqCoarsened'
estimator(x, ...)
## S4 method for signature 'OptimalSeqCoarsened'
fitObject(object, ...)
## S4 method for signature 'OptimalSeqCoarsened'
genetic(object, ...)
## S4 method for signature 'OptimalSeqCoarsened,data.frame'
optTx(x, newdata, ..., dp = 1)
## S4 method for signature 'OptimalSeqCoarsened,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalSeqCoarsened'
outcome(object, ...)
## S4 method for signature 'OptimalSeqCoarsened,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OptimalSeqCoarsened'
print(x, ...)
## S4 method for signature 'OptimalSeqCoarsened'
propen(object, ...)
## S4 method for signature 'OptimalSeqCoarsened'
regimeCoef(object, ...)
## S4 method for signature 'OptimalSeqCoarsened'
show(object)
## S4 method for signature 'OptimalSeqCoarsened'
summary(object, ...)
Class Contains Results for the Missing Data IPW/AIPW Method
Description
Methods for single decision point analyses. Class inherits directly from
OptimalSeq
and all methods defined for objects of class OptimaSeq
are defined for this class.
Methods Available for Objects of Class OptimalSeqMissing
Description
Methods Available for Objects of Class OptimalSeqMissing
Call(name)
returns the unevaluated call to method
Retrieve coefficients of fits
DTRstep(x)
print statement indicating the coarsened data perspective
estimator(x)
retrieves the estimated value. Calls method defined for
OptimalSeq
.
fitObject(object)
retrieves value objects of model functions. Calls method defined for
OptimalSeq
.
genetic(object)
retrieves genetic algorithm results. Calls method defined for
OptimalSeq
.
Predict Optimal Treatment and Decision Function Based on a Missing Data AIPW Analysis
optTx(x)
retrieves the optimal tx. Calls method defined for OptimalSeq
.
outcome(object)
retrieves value object returned by outcome model functions. Calls method
defined for OptimalSeq
.
plot(x,suppress)
generates plot for model functions. Calls method defined for
OptimalSeq
.
print(x)
Extends method defined for OptimalSeq
to include DTRStep()
propen(object)
retrieves value object returned by propensity model functions. Calls method
defined for OptimalSeq
.
regimeCoef(object)
retrieves estimated tx regime parameters. Calls method defined for
OptimalSeq
.
show(object)
Extends method defined for OptimalSeq
to include DTRStep()
summary(object)
retrieves summary information. Calls method defined for OptimalSeq
.
Usage
## S4 method for signature 'OptimalSeqMissing'
Call(name, ...)
## S4 method for signature 'OptimalSeqMissing'
coef(object, ...)
## S4 method for signature 'OptimalSeqMissing'
DTRstep(object)
## S4 method for signature 'OptimalSeqMissing'
estimator(x, ...)
## S4 method for signature 'OptimalSeqMissing'
fitObject(object, ...)
## S4 method for signature 'OptimalSeqMissing'
genetic(object, ...)
## S4 method for signature 'OptimalSeqMissing,data.frame'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalSeqMissing,missing'
optTx(x, newdata, ...)
## S4 method for signature 'OptimalSeqMissing'
outcome(object, ...)
## S4 method for signature 'OptimalSeqMissing,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OptimalSeqMissing'
print(x, ...)
## S4 method for signature 'OptimalSeqMissing'
propen(object, ...)
## S4 method for signature 'OptimalSeqMissing'
regimeCoef(object, ...)
## S4 method for signature 'OptimalSeqMissing'
show(object)
## S4 method for signature 'OptimalSeqMissing'
summary(object, ...)
Class OutcomeIterateFit
Description
Class OutcomeIterateFit
is a an outcome regression step completed
using the iterative algorithm.
Slots
fitObjC
Contrast Result
fitObjM
Main Effects Result
Methods Available for Objects of Class OutcomeIterateFit
Description
Methods call equivalently named methods defined for OutcomeSimpleFit
,
OutcomeSimpleFit_fSet
, or OutcomeSimpleFit_SubsetList
.
Exact method dispatched depends on classes of @fitObjC and @fitObjM.
When a value object is returned, it is a list.
.predictAll(object, newdata)
combines the two components into a
single optimal tx and decision function
Usage
## S4 method for signature 'OutcomeIterateFit'
coef(object, ...)
## S4 method for signature 'OutcomeIterateFit'
fitObject(object, ...)
## S4 method for signature 'OutcomeIterateFit'
outcome(object, ...)
## S4 method for signature 'OutcomeIterateFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OutcomeIterateFit'
predict(object, ...)
## S4 method for signature 'OutcomeIterateFit,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'OutcomeIterateFit'
print(x, ...)
## S4 method for signature 'OutcomeIterateFit'
show(object)
## S4 method for signature 'OutcomeIterateFit'
summary(object, ...)
Class OutcomeNoFit
Description
Class OutcomeNoFit
designates that an outcome regression step
was not performed. This acts as a place holder for IPW based methods.
Methods Available for Objects of Class OutcomeNoFit
Description
Methods return NULL, NA or zero values.
.predictAll(object, newdata)
returns a list containing the optimal
tx as a vector of NA values and the decision function as a matrix of 0
.predictMu(object, newdata)
predicts outcome for all tx options.
Returns the matrix of outcomes predicted for all tx.
Predicted outcomes for tx not available to a pt are NA.
Usage
## S4 method for signature 'OutcomeNoFit,data.frame'
.predictAll(object, newdata)
## S4 method for signature 'OutcomeNoFit,data.frame'
.predictMu(object, data, ...)
## S4 method for signature 'OutcomeNoFit'
outcome(object, ...)
## S4 method for signature 'OutcomeNoFit'
coef(object, ...)
## S4 method for signature 'OutcomeNoFit'
fitObject(object, ...)
## S4 method for signature 'OutcomeNoFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OutcomeNoFit'
predict(object, ...)
## S4 method for signature 'OutcomeNoFit'
print(x, ...)
## S4 method for signature 'OutcomeNoFit'
show(object)
## S4 method for signature 'OutcomeNoFit'
summary(object, ...)
Class OutcomeObj
Description
Class OutcomeObj
groups outcome regression results under a common
name
Slots
outcome
ANY - expected to be
OutcomeNoFit
,OutcomeSimpleFit
,OutcomeSimpleFit_fSet
,OutcomeSimpleFit_SubsetList
,OutcomeIterateFit
, orDecisionPointList
.
Methods Available for Objects of Class OutcomeObj
Description
Most value objects returned are a list with one element 'outcome'. Methods dispatched and objects returned in the element 'outcome' depend on class of @outcome. Exceptions are noted below.
outcome(object)
does not return the overarching list
structure, but only the contents of list[[ outcome ]].
plot(x)
concatenated 'outcome' to the title if suppress = FALSE.
.predictAll(object, newdata)
does not return the overarching list
structure, but only the contents of list[[ outcome ]].
.predictMu(object, newdata)
predicts outcome for all tx options.
Returns the matrix of outcomes predicted for all tx.
Predicted outcomes for tx not available to a pt are NA.
predict(object)
does not return the overarching list
structure, but only the contents of list[[ outcome ]].
Usage
## S4 method for signature 'OutcomeObj'
coef(object, ...)
## S4 method for signature 'OutcomeObj'
fitObject(object, ...)
## S4 method for signature 'OutcomeObj'
outcome(object, ...)
## S4 method for signature 'OutcomeObj,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OutcomeObj,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'OutcomeObj,data.frame'
.predictMu(object, data, ...)
## S4 method for signature 'OutcomeObj'
predict(object, ...)
## S4 method for signature 'OutcomeObj'
print(x, ...)
## S4 method for signature 'OutcomeObj'
show(object)
## S4 method for signature 'OutcomeObj'
summary(object, ...)
Class OutcomeSimpleFit
Description
Class OutcomeSimpleFit
is a TypedFit
identified as being
for an outcome regression step.
Methods Available for Objects of Class OutcomeSimpleFit
Description
Methods call equivalently named methods defined for TypedFit
.predictAll(object, newdata)
predicts outcome for all tx options.
Returns a list containing 'optimalTx' the tx yielding the largest
predicted outcome and 'decisionFunc' the matrix of outcomes predicted
for all tx.
.predictMu(object, newdata)
predicts outcome for all tx options.
Returns the matrix of outcomes predicted for all tx.
Predicted outcomes for tx not available to a pt are NA.
Usage
## S4 method for signature 'OutcomeSimpleFit'
coef(object, ...)
## S4 method for signature 'OutcomeSimpleFit'
fitObject(object, ...)
## S4 method for signature 'OutcomeSimpleFit'
outcome(object, ...)
## S4 method for signature 'OutcomeSimpleFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'OutcomeSimpleFit'
predict(object, ...)
## S4 method for signature 'OutcomeSimpleFit,data.frame'
.predictAll(object, newdata)
## S4 method for signature 'OutcomeSimpleFit,data.frame'
.predictMu(object, data, ...)
## S4 method for signature 'OutcomeSimpleFit'
print(x, ...)
## S4 method for signature 'OutcomeSimpleFit'
show(object)
## S4 method for signature 'OutcomeSimpleFit'
summary(object, ...)
Class OutcomeSimpleFit_SubsetList
Description
Class OutcomeSimpleFit_SubsetList
is a TypedFit_SubsetList
identified as being for an outcome regression step.
Methods Available for Objects of Class OutcomeSimpleFit_SubsetList
Description
Methods call equivalently named methods defined for TypedFit_SubsetList
.predictAll(object, newdata)
predicts outcome for all tx options.
Returns a list containing 'optimalTx' the tx yielding the largest
predicted outcome and 'decisionFunc' the matrix of outcomes predicted
for all tx.
Predicted outcomes for tx not available to a pt are NA.
.predictMu(object, data)
predicts outcome for all tx options.
Returns the matrix of outcomes predicted for all tx.
Predicted outcomes for tx not available to a pt are NA.
Usage
## S4 method for signature 'OutcomeSimpleFit_SubsetList'
outcome(object, ...)
## S4 method for signature 'OutcomeSimpleFit_SubsetList'
predict(object, newdata, ...)
## S4 method for signature 'OutcomeSimpleFit_SubsetList,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'OutcomeSimpleFit_SubsetList,data.frame'
.predictMu(object, data, ...)
Class OutcomeSimpleFit_fSet
Description
Class OutcomeSimpleFit_fSet
is a TypedFit_fSet
identified as
being for an outcome regression step.
Methods Available for Objects of Class OutcomeSimpleFit_fSet
Description
Methods call equivalently named methods defined for TypedFit_fSet
.predictAll(object, newdata)
predicts outcome for all tx options.
Returns a list containing 'optimalTx' the tx yielding the largest
predicted outcome and 'decisionFunc' the matrix of outcomes predicted
for all tx.
Predicted outcomes for tx not available to a pt are NA.
.predictMu(object, newdata)
predicts outcome for all tx options.
Returns the matrix of outcomes predicted for all tx.
Predicted outcomes for tx not available to a pt are NA.
Usage
## S4 method for signature 'OutcomeSimpleFit_fSet'
outcome(object, ...)
## S4 method for signature 'OutcomeSimpleFit_fSet,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'OutcomeSimpleFit_fSet,data.frame'
.predictMu(object, data, ...)
Class PolyKernel
Description
Class PolyKernel
holds information regarding decision function
when kernel is polynomial
Methods Available for Objects of Class PolyKernel
Description
Methods Available for Objects of Class PolyKernel
Usage
## S4 method for signature 'PolyKernel,matrix,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'PolyKernel'
print(x, ...)
## S4 method for signature 'PolyKernel'
show(object)
## S4 method for signature 'PolyKernel'
summary(object, ...)
Class PropensityFit
Description
Class PropensityFit
is a TypedFit
identified as being
for a propensity regression step.
Slots
small
A logical TRUE indicates that the smallest valued tx is missing; FALSE indicates that the largest valued tx is missing
levs
A vector; the set of treatment options included in fit.
Methods Available for Objects of Class PropensityFit
Description
Methods call equivalently named methods defined for TypedFit
.predictAll(object, newdata)
predicts propensity for all tx options.
Returns a matrix of propensities predicted for all tx.
Usage
## S4 method for signature 'PropensityFit'
coef(object, ...)
## S4 method for signature 'PropensityFit'
fitObject(object, ...)
## S4 method for signature 'PropensityFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'PropensityFit'
predict(object, ...)
## S4 method for signature 'PropensityFit,data.frame'
.predictAll(object, newdata, suppress = TRUE)
## S4 method for signature 'PropensityFit'
print(x, ...)
## S4 method for signature 'PropensityFit'
propen(object, ...)
## S4 method for signature 'PropensityFit'
show(object)
## S4 method for signature 'PropensityFit'
summary(object, ...)
Class PropensityFit_SubsetList
Description
Class PropensityFit_SubsetList
is a TypedFit_SubsetList
identified as being for a propensity regression step.
Slots
small
A logical vector TRUE indicates that the smallest valued tx is missing; FALSE indicates that the largest valued tx is missing
levs
A list; the set of treatment options included in each fit.
Methods Available for Objects of Class PropensityFit_SubsetList
Description
Most methods call equivalently named methods defined for
TypedFit_SubsetList
Usage
## S4 method for signature 'PropensityFit_SubsetList'
coef(object, ...)
## S4 method for signature 'PropensityFit_SubsetList'
fitObject(object, ...)
## S4 method for signature 'PropensityFit_SubsetList,data.frame'
.predictAll(object, newdata, suppress = TRUE)
## S4 method for signature 'PropensityFit_SubsetList'
propen(object, ...)
## S4 method for signature 'PropensityFit_SubsetList'
summary(object, ...)
Class PropensityFit_fSet
Description
Class PropensityFit_fSet
is a TypedFit_fSet
identified as being
for a propensity regression step.
Slots
small
A logical TRUE indicates that the smallest valued tx is missing; FALSE indicates that the largest valued tx is missing
levs
A vector; the set of treatment options included in fit.
Methods Available for Objects of Class PropensityFit_fSet
Description
Methods call equivalently named methods defined for TypedFit_fSet
.predictAll(object, newdata)
predicts propensity for all tx options.
Returns a matrix of propensities predicted for all tx.
Tx options not available to a pt are coded as NA.
Usage
## S4 method for signature 'PropensityFit_fSet'
coef(object, ...)
## S4 method for signature 'PropensityFit_fSet'
fitObject(object, ...)
## S4 method for signature 'PropensityFit_fSet,data.frame'
.predictAll(object, newdata, suppress = TRUE)
## S4 method for signature 'PropensityFit_fSet'
propen(object, ...)
## S4 method for signature 'PropensityFit_fSet'
summary(object, ...)
Class PropensityObj
Description
Class PropensityObj
groups Propensity regression results under a
common name.
Slots
Propensity
ANY - expected to be
PropensityFit
,PropensityFit_fSet
,PropensityFit_SubsetList
, orDecisionPointList
.
Methods Available for Objects of Class PropensityObj
Description
Most value objects returned are a list with one element 'propen'. Methods dispatched and objects returned in the element 'propen' depend on class of @propen. Exceptions are noted below.
plot(x)
concatenates 'Propensity' to the title if suppress = FALSE.
.predictAll(object, newdata)
does not return the overarching list
structure, but only the contents of list[[ propen ]].
predict(object)
does not return the overarching list
structure, but only the contents of list[[ propen ]].
propen(object)
does not return the overarching list
structure, but only the contents of list[[ propen ]].
Usage
## S4 method for signature 'PropensityObj'
coef(object, ...)
## S4 method for signature 'PropensityObj'
fitObject(object, ...)
## S4 method for signature 'PropensityObj,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'PropensityObj,data.frame'
.predictAll(object, newdata, ...)
## S4 method for signature 'PropensityObj'
predict(object, ...)
## S4 method for signature 'PropensityObj'
print(x, ...)
## S4 method for signature 'PropensityObj'
propen(object, ...)
## S4 method for signature 'PropensityObj'
show(object)
## S4 method for signature 'PropensityObj'
summary(object, ...)
Class QLearn
Description
Class QLearn
contains the results for a Q-Learning step
Slots
step
An integer indicating the step of the Q-Learning algorithm.
outcome
The outcome regression analysis
txInfo
The feasible tx information
optimal
The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Class QLearnObj
Description
Class QLearnObj
contains the results for a Q-Learning step
Slots
outcome
The outcome regression analysis
txInfo
The feasible tx information
optimal
The estimated optimal tx, decision function, and value
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Class RWL
Description
Class RWL
contains results for an RWL analysis.
Slots
responseType
character indicating type of response
residuals
vector of outcome residuals
beta
vector of regime parameters
analysis
Contains a Learning or LearningMulti object
analysis@txInfo
Feasible tx information
analysis@propen
Propensity regression analysis
analysis@outcome
Outcome regression analysis
analysis@cvInfo
Cross-validation analysis if single regime
analysis@optim
Optimization analysis if single regime
analysis@optimResult
list of cross-validation and optimization results if multiple regimes. optimResult[[i]]@cvInfo and optimResult[[i]]@optim
analysis@optimal
Estimated optimal Tx and value
analysis@Call
Unevaluated Call
Methods For Post-Processing of Regression Analysis
- outcome
: Retrieve value object returned by outcome regression methods.
- propen
: Retrieve value object returned by propensity regression methods.
- coef
: Retrieve parameter estimates for all regression steps.
- fitObject
: Retrieve value object returned by regression methods.
- plot
: Generate plots for regression analyses.
Methods For Post-Processing of Optimization Analysis
- cvInfo
: Retrieve cross-validation results.
- optimObj
: Retrieve value object returned by optimization method(s).
- regimeCoef
: Retrieve estimated parameters for optimal tx regime.
Methods For Accessing Main Results
- DTRstep
: Retrieve description of method used to create object.
- estimator
: Retrieve the estimated value of the estimated optimal regime for the training data set.
- optTx
: Retrieve/predict the estimated decision functions and/or optimal tx.
: Print main results of analysis.
- show
: Show main results of analysis.
- summary
: Retrieve summary information.
Methods Available for Objects of Class RWL
Description
Methods Available for Objects of Class RWL
Usage
## S4 method for signature 'RWL'
print(x, ...)
## S4 method for signature 'RWL'
show(object)
Class RadialKernel
Description
Class RadialKernel
holds information regarding decision function
when kernel is radial
Methods Available for Objects of Class RadialKernel
Description
Methods Available for Objects of Class RadialKernel
Usage
## S4 method for signature 'RadialKernel,matrix,matrix'
.kernel(object, x1, x2, ...)
## S4 method for signature 'RadialKernel'
print(x, ...)
## S4 method for signature 'RadialKernel'
show(object)
## S4 method for signature 'RadialKernel'
summary(object, ...)
Class Regime
Description
Class Regime
holds information regarding regimes communicated
through functions.
Slots
nVars
An integer. The number of parameters to be estimated
vNames
A character. The names of the parameters to be estimated
func
A function. The user specified function that defines the regime
pars
A numeric. The estimated parameters
Methods Available for Objects of Class Regime
Description
Methods Available for Objects of Class Regime
.getNumPars
retrieves the number of parameters in the regime to be estimated.
.getParNames
retrieves the parameter names in the regime.
.getPars
retrieves current estimates for regime parameters.
.getRegimeFunction
retrieves the user specified function definition of the regime.
.predictOptimalTx
executes user specified function using current estimated parameters and
provided data to determine recommended tx.
print
prints the current estimates for the regime parameters.
regimeCoef
retrieves the current estimates for the regime parameters
.setPars
sets the parameter estimates to the provided values.
show
displays the current estimates for the regime parameters.
summary
retrieves the current estimates for the regime parameters
Usage
## S4 method for signature 'Regime'
.getNumPars(object)
## S4 method for signature 'Regime'
.getParNames(object)
## S4 method for signature 'Regime'
.getPars(object)
## S4 method for signature 'Regime'
.getRegimeFunction(object)
## S4 method for signature 'Regime,data.frame'
.predictOptimalTx(x, newdata, ...)
## S4 method for signature 'Regime'
print(x, ...)
## S4 method for signature 'Regime'
regimeCoef(object, ...)
## S4 method for signature 'Regime,numeric'
.setPars(object, pars)
## S4 method for signature 'Regime'
show(object)
## S4 method for signature 'Regime'
summary(object, ...)
Class RegimeObj
Description
Class RegimeObj
holds information regarding regimes communicated
through functions under a common name.
Slots
regime
ANY expected to be
Regime
orDecisionPointList
Methods Available for Objects of Class RegimeObj
Description
Methods dispatch equivalantly named functions defined for Regime or DecisionPointList objects. Method dispatched dictated by object stored in @regime.
Usage
## S4 method for signature 'RegimeObj'
.getNumPars(object)
## S4 method for signature 'RegimeObj'
.getParNames(object)
## S4 method for signature 'RegimeObj'
.getPars(object)
## S4 method for signature 'RegimeObj'
.getRegimeFunction(object)
## S4 method for signature 'RegimeObj,data.frame'
.predictOptimalTx(x, newdata, dp = 1L, ...)
## S4 method for signature 'RegimeObj'
print(x, ...)
## S4 method for signature 'RegimeObj'
regimeCoef(object, ...)
## S4 method for signature 'RegimeObj,numeric'
.setPars(object, pars)
## S4 method for signature 'RegimeObj'
show(object)
## S4 method for signature 'RegimeObj'
summary(object, ...)
Class SmoothRampSurrogate
Description
Components of smoothed ramp surrogate for 0/1 loss function.
Methods Available for Objects of Class SmoothRampSurrogate
Description
Methods Available for Objects of Class SmoothRampSurrogate
.phiFunc
calculates smoothed ramp surrogate loss-function
.dphiFunc
calculates derivative of smoothed ramp surrogate loss-function
Usage
## S4 method for signature 'SmoothRampSurrogate'
.phiFunc(surrogate, u, res)
## S4 method for signature 'SmoothRampSurrogate'
.dPhiFunc(surrogate, u, du, res)
Class SqHingeSurrogate
Description
Squared hinge surrogate for 0/1 loss function
Methods Available for Objects of Class SqHingeSurrogate
Description
Methods Available for Objects of Class SqHingeSurrogate
.phiFunc
calculates squared hinge surrogate loss-function
.dphiFunc
calculates derivative of squared hinge surrogate loss-function
Usage
## S4 method for signature 'SqHingeSurrogate'
.phiFunc(surrogate, u)
## S4 method for signature 'SqHingeSurrogate'
.dPhiFunc(surrogate, u, du)
Class SubsetList
Description
Class SubsetList
represents a List
for subset specifications.
This class extends List
to require non-zero length and named elements.
Methods Available for Objects of Class SubsetList
Description
Methods Available for Objects of Class SubsetList
Usage
## S4 method for signature 'SubsetList,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'SubsetList'
print(x, ...)
## S4 method for signature 'SubsetList'
show(object)
Class Surrogate
Description
General class for surrogate objects.
Slots
we
included to avoid VIRTUAL designation
Methods Available for Objects of Class Surrogate
Description
Utilizes stats::optim to obtain parameter estimates. Requires that the objective function and its derivative are defined by the calling learning method. Returns NULL if optimization is not successful due to problems; a vector of the current parameter estimates if optimization is not successful because it hit the maximum number if iterations; and the list object returned by stats::optim if optimization is successful
Usage
## S4 method for signature 'Surrogate'
.optim(surrogate, par, lambda, fn, gr, suppress, ...)
Class TxInfoBasic
Description
Class TxInfoBasic
stores basic treatment information.
Slots
superset
A vector of all possible tx options.
txName
A character - column header of data.frame that contains tx variable
Methods Available for Objects of Class TxInfoBasic
Description
Methods Available for Objects of Class TxInfoBasic
.compareTx(object, vec1, vec2)
not allowed
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding
.convertToBinary(txObj, data)
converts user specified tx variable to binary -1/1
.convertTx(object, txVec)
not allowed
.getLevels(object, txVec)
not allowed
.getSuperset(object)
retrieves superset information
.getTxName(object)
retrieve tx variable name
.validTx(object, txVec)
ensures all elements in txVec are allowed by superset
Usage
## S4 method for signature 'TxInfoBasic,ANY,ANY'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxInfoBasic'
.convertFromBinary(txObj, txVec, ...)
## S4 method for signature 'TxInfoBasic'
.convertToBinary(txObj, ..., txVec)
## S4 method for signature 'TxInfoBasic'
.convertTx(object, txVec)
## S4 method for signature 'TxInfoBasic,ANY'
.getLevels(object, txVec)
## S4 method for signature 'TxInfoBasic'
.getSuperset(object)
## S4 method for signature 'TxInfoBasic'
.getTxName(object)
## S4 method for signature 'TxInfoBasic'
.validTx(object, txVec)
Class TxInfoFactor
Description
Class TxInfoFactor
extends TxInfoBasic
to identify treatments
as factor
Slots
superset
character of all allowed tx options
Methods Available for Objects of Class TxInfoFactor
Description
Methods Available for Objects of Class TxInfoFactor
.compareTx(object, vec1, vec2)
compares vec1 and vec2 to identify equivalent elements.
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding
.compareTx(object, vec1, vec2)
converts txVec to factor.
.getLevels(object, txVec)
determines tx levels contains in txVec.
Usage
## S4 method for signature 'TxInfoFactor,factor,factor'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxInfoFactor'
.convertFromBinary(txObj, txVec, ...)
## S4 method for signature 'TxInfoFactor'
.convertTx(object, txVec)
## S4 method for signature 'TxInfoFactor,factor'
.getLevels(object, txVec)
Class TxInfoInteger
Description
Class TxInfoInteger
extends TxInfoBasic
to identify treatments
as integer.
Methods Available for Objects of Class TxInfoInteger
Description
Methods Available for Objects of Class TxInfoInteger
.compareTx(object, vec1, vec2)
compares vec1 and vec2 to identify equivalent elements.
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding
.compareTx(object, vec1, vec2)
converts txVec to factor.
.getLevels(object, txVec)
determines tx levels contains in txVec.
Usage
## S4 method for signature 'TxInfoInteger,integer,integer'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxInfoInteger'
.convertFromBinary(txObj, txVec, ...)
## S4 method for signature 'TxInfoInteger'
.convertTx(object, txVec)
## S4 method for signature 'TxInfoInteger,integer'
.getLevels(object, txVec)
Class TxInfoList
Description
Class TxInfoList
extends class TxObj
to indicate that
\@txInfo is of class List
. Each element of that list corresponds
to a decision point. All methods called with this object throw errors.
Slots
txInfo
A List object
Methods Available for Objects of Class TxInfoList
Description
Methods Available for Objects of Class TxInfoList
.getPtsSubset(object)
not allowed.
.getSingleton(object)
not allowed.
.getSubsetRule(object)
not allowed.
.getSubsets(object)
not allowed.
.getSuperset(object)
not allowed.
.getTxName(object)
not allowed.
.validTx(object, txVec)
not allowed.
.compareTx(object, vec1, vec2)
not allowed.
.convertTx(object, txVec)
not allowed.
.getLevels(object, txVec)
not allowed.
Usage
## S4 method for signature 'TxInfoList'
.getPtsSubset(object)
## S4 method for signature 'TxInfoList'
.getSingleton(object)
## S4 method for signature 'TxInfoList'
.getSubsetRule(object)
## S4 method for signature 'TxInfoList'
.getSubsets(object)
## S4 method for signature 'TxInfoList'
.getSuperset(object)
## S4 method for signature 'TxInfoList'
.getTxName(object)
## S4 method for signature 'TxInfoList'
.validTx(object)
## S4 method for signature 'TxInfoList,ANY,ANY'
.compareTx(object)
## S4 method for signature 'TxInfoList'
.convertTx(object)
## S4 method for signature 'TxInfoList,ANY'
.getLevels(object)
Class TxInfoNoSubsets
Description
Class TxInfoNoSubsets
extends class TxObj
to indicate that
\@txInfo is of class TxInfoBasic
and thus no subsets were identified.
Slots
txInfo
A TxInfoBasic object
Methods Available for Objects of Class TxInfoNoSubsets
Description
Methods Available for Objects of Class TxInfoNoSubsets
Class TxInfoWithSubsets
Description
Class TxInfoWithSubsets
extends class TxObj
to indicate that
\@txInfo is of class TxInfoSubset
and thus subsets were identified.
Slots
txInfo
A TxSubset object
Methods Available for Objects of Class TxInfoWithSubsets
Description
Methods Available for Objects of Class TxInfoWithSubsets
.getPtsSubset(object)
retrieves subset name to which each pt is a member. Method dispatched
depends on class of @txInfo.
.getSingleton(object)
retrieves T/F indicating if >1 tx is available to each pt. Method dispatched
depends on class of @txInfo.
.getSubsetRule(object)
retrieves feasible tx function. Method dispatched
depends on class of @txInfo.
.getSubsets(object)
retrieves feasible tx information. Method dispatched
depends on class of @txInfo.
Usage
## S4 method for signature 'TxInfoWithSubsets'
.getPtsSubset(object)
## S4 method for signature 'TxInfoWithSubsets'
.getSingleton(object)
## S4 method for signature 'TxInfoWithSubsets'
.getSubsetRule(object)
## S4 method for signature 'TxInfoWithSubsets'
.getSubsets(object)
Class TxObj
Description
Storage Class to group tx information under a common name.
Slots
txInfo
Any object – expected to be of class TxInfoBasic, TxInfoSubset, or DecisionPointList
Methods Available for Objects of Class TxObj
Description
Methods dispatched depend on class of @txInfo.
Usage
## S4 method for signature 'TxObj,ANY,ANY'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxObj'
.convertFromBinary(txObj, ...)
## S4 method for signature 'TxObj'
.convertToBinary(txObj, ...)
## S4 method for signature 'TxObj'
.convertTx(object, txVec)
## S4 method for signature 'TxObj,ANY'
.getLevels(object, txVec)
## S4 method for signature 'TxObj'
.getSuperset(object)
## S4 method for signature 'TxObj'
.getTxName(object)
## S4 method for signature 'TxObj'
.validTx(object, txVec)
Class TxSubset
Description
Class TxSubset
stores subset information for tx
Slots
ptsSubset
A character vector. The name of the subset of which each patient is a member
subsetRule
A function. The fSet function provided by user.
subsets
A list. The feasible treatments for each subset. The elements must be named and contain tx subsets
singleton
A logical vector. TRUE indicates if 1 tx is available to each patient
Methods Available for Objects of Class TxSubset
Description
Methods Available for Objects of Class TxSubset
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding.
.convertToBinary(txObj, data)
converts user specified tx variable to binary -1/1.
.getPtsSubset(object)
retrieve subset name for which each pt is a member.
.getSingleton(object)
retrieve T/F indicator of only 1 tx option available to each pt.
.getSubsetRule(object)
retrieve feasible set identification rule.
.getSubsets(object)
retrieve subset names and tx options.
.validTx(object, txVec)
ensures all elements in txVec are allowed by superset.
Usage
## S4 method for signature 'TxSubset'
.convertFromBinary(txObj, ..., txVec)
## S4 method for signature 'TxSubset'
.convertToBinary(txObj, ...)
## S4 method for signature 'TxSubset'
.getPtsSubset(object)
## S4 method for signature 'TxSubset'
.getSingleton(object)
## S4 method for signature 'TxSubset'
.getSubsetRule(object)
## S4 method for signature 'TxSubset'
.getSubsets(object)
## S4 method for signature 'TxSubset'
.validTx(object, txVec)
Class TxSubsetFactor
Description
Class TxSubsetFactor
stores subset information for tx when tx is
a factor
Methods Available for Objects of Class TxSubsetFactor
Description
Methods Available for Objects of Class TxSubsetFactor
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding.
Call method defined for TxSubset
.
.convertToBinary(txObj, data)
converts user specified tx variable to binary -1/1.
Call method defined for TxSubset
.
.getPtsSubset(object)
retrieve subset name for which each pt is a member.
Call method defined for TxSubset
.
.getSingleton(object)
retrieve T/F indicator of only 1 tx option available to each pt.
Call method defined for TxSubset
.
.getSubsetRule(object)
retrieve feasible set identification rule.
Call method defined for TxSubset
.
.getSubsets(object)
retrieve subset names and tx options.
Call method defined for TxSubset
.
.compareTx(object, vec1, vec2)
compares vec1 and vec2 to identify equivalent elements.
.compareTx(object, vec1, vec2)
converts txVec to factor.
.getLevels(object, txVec)
determines tx levels contains in txVec.
.getSuperset(object)
retrieves superset. Uses method defined for TxInfoFactor objects.
.getTxName(object)
retrieves tx variable name. Uses method defined for TxInfoFactor objects.
.validTx(object, txVec)
ensures all elements in txVec are allowed by superset.
Usage
## S4 method for signature 'TxSubsetFactor'
.convertFromBinary(txObj, ..., txVec)
## S4 method for signature 'TxSubsetFactor'
.convertToBinary(txObj, ..., txVec, data)
## S4 method for signature 'TxSubsetFactor'
.getPtsSubset(object)
## S4 method for signature 'TxSubsetFactor'
.getSingleton(object)
## S4 method for signature 'TxSubsetFactor'
.getSubsetRule(object)
## S4 method for signature 'TxSubsetFactor'
.getSubsets(object)
## S4 method for signature 'TxSubsetFactor,factor,factor'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxSubsetFactor'
.convertTx(object, txVec)
## S4 method for signature 'TxSubsetFactor,factor'
.getLevels(object, txVec)
## S4 method for signature 'TxSubsetFactor'
.getSuperset(object)
## S4 method for signature 'TxSubsetFactor'
.getTxName(object)
## S4 method for signature 'TxSubsetFactor'
.validTx(object, txVec)
Class TxSubsetInteger
Description
Class TxSubsetInteger
stores subset information for treatment
Methods Available for Objects of Class TxSubsetInteger
Description
Methods Available for Objects of Class TxSubsetInteger
.convertFromBinary(txObj, txVec)
converts a -1/1 Tx to user provided tx coding.
Call method defined for TxSubset
.
.convertToBinary(txObj, data)
converts user specified tx variable to binary -1/1.
Call method defined for TxSubset
.
.getPtsSubset(object)
retrieve subset name for which each pt is a member.
Call method defined for TxSubset
.
.getSingleton(object)
retrieve T/F indicator of only 1 tx option available to each pt.
Call method defined for TxSubset
.
.getSubsetRule(object)
retrieve feasible set identification rule.
Call method defined for TxSubset
.
.getSubsets(object)
retrieve subset names and tx options.
Call method defined for TxSubset
.
.compareTx(object, vec1, vec2)
compares vec1 and vec2 to identify equivalent elements.
.compareTx(object, vec1, vec2)
converts txVec to factor.
.getLevels(object, txVec)
determines tx levels contains in txVec.
.getSuperset(object)
retrieves superset. Uses method defined for TxInfoInteger objects.
.getTxName(object)
retrieves tx variable name. Uses method defined for TxInfoInteger objects.
.validTx(object, txVec)
ensures all elements in txVec are allowed by superset.
Usage
## S4 method for signature 'TxSubsetInteger'
.convertFromBinary(txObj, txVec, ...)
## S4 method for signature 'TxSubsetInteger'
.convertToBinary(txObj, ..., txVec, data)
## S4 method for signature 'TxSubsetInteger'
.getPtsSubset(object)
## S4 method for signature 'TxSubsetInteger'
.getSingleton(object)
## S4 method for signature 'TxSubsetInteger'
.getSubsetRule(object)
## S4 method for signature 'TxSubsetInteger'
.getSubsets(object)
## S4 method for signature 'TxSubsetInteger,integer,integer'
.compareTx(object, vec1, vec2)
## S4 method for signature 'TxSubsetInteger'
.convertTx(object, txVec)
## S4 method for signature 'TxSubsetInteger,integer'
.getLevels(object, txVec)
## S4 method for signature 'TxSubsetInteger'
.getSuperset(object)
## S4 method for signature 'TxSubsetInteger'
.getTxName(object)
## S4 method for signature 'TxSubsetInteger'
.validTx(object, txVec)
Class TypedFit
Description
Class TypedFit
is a modelObjFit
combined with a character
to identify its purpose.
Methods Available for Objects of Class TypedFit
Description
Methods call equivalently named methods defined for modelObjFit
objects.
Usage
## S4 method for signature 'TypedFit'
coef(object, ...)
## S4 method for signature 'TypedFit'
fitObject(object, ...)
## S4 method for signature 'TypedFit,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'TypedFit'
print(x, ...)
## S4 method for signature 'TypedFit'
show(object)
## S4 method for signature 'TypedFit'
summary(object, ...)
Class TypedFitObj
Description
Class TypedFit_SubsetList
allows for TypedFit based objects to be
grouped under a common name.
Slots
fit
ANY - expected to be
TypedFit
,TypedFit_fSet
.TypedFit_SubsetList
orDecisionPointList
of these.
Methods Available for Objects of Class TypedFitObj
Description
Methods call equivalently named methods defined for TypedFit
,
TypedFit_fSet
, TypedFit_SubsetList
or
DecisionPointList
objects.
The methods dispatched and objects returned depend on the class of @fit.
Usage
## S4 method for signature 'TypedFitObj'
coef(object, ...)
## S4 method for signature 'TypedFitObj'
fitObject(object, ...)
## S4 method for signature 'TypedFitObj,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'TypedFitObj'
predict(object, ...)
## S4 method for signature 'TypedFitObj'
print(x, ...)
## S4 method for signature 'TypedFitObj'
show(object)
## S4 method for signature 'TypedFitObj'
summary(object, ...)
Class TypedFit_SubsetList
Description
Class TypedFit_SubsetList
is SubsetList
of TypedFit
used when subsets are identified and modeled independently.
Methods Available for Objects of Class TypedFit_SubsetList
Description
Methods call equivalently named methods defined for TypedFit
objects. When a value object is returned, it is a list. The element
names of the list are the subset names to which the result pertains.
predict(object, ...)
Patients not in subset are NA.
Usage
## S4 method for signature 'TypedFit_SubsetList'
coef(object, ...)
## S4 method for signature 'TypedFit_SubsetList'
fitObject(object, ...)
## S4 method for signature 'TypedFit_SubsetList,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'TypedFit_SubsetList'
predict(object, newdata, ...)
## S4 method for signature 'TypedFit_SubsetList'
print(x, ...)
## S4 method for signature 'TypedFit_SubsetList'
show(object)
## S4 method for signature 'TypedFit_SubsetList'
summary(object, ...)
Class TypedFit_fSet
Description
Class TypedFit_fSet
is a TypedFit
when subsets are identified
but not modeled independently.
Methods Available for Objects of Class TypedFit_fSet
Description
Methods call equivalently named methods defined for TypedFit
objects.
predict(object, ...)
Patients with only 1 tx option are NA.
Usage
## S4 method for signature 'TypedFit_fSet'
coef(object, ...)
## S4 method for signature 'TypedFit_fSet'
fitObject(object, ...)
## S4 method for signature 'TypedFit_fSet,ANY'
plot(x, suppress = FALSE, ...)
## S4 method for signature 'TypedFit_fSet'
predict(object, newdata, ...)
## S4 method for signature 'TypedFit_fSet'
print(x, ...)
## S4 method for signature 'TypedFit_fSet'
show(object)
## S4 method for signature 'TypedFit_fSet'
summary(object, ...)
Adolescent BMI dataset (generated toy example)
Description
A dataset generated to mimic data from a two-stage randomized clinical trial that studied the effect of meal replacement shakes on adolescent obesity. The dataset contains the following covariates collected at the start of the first stage: "gender," "race," "parentBMI," and "baselineBMI." At the second-stage, "month4BMI" was collected. Variables "A1" and "A2" are the randomized treatments at stages one and two, and "month12BMI" is the primary outcome collected at the end of stage two.
Format
A matrix with rows corresponding to patients.
Source
Generated by Kristin A. Linn in R
Backwards Outcome Weighted Learning.
Description
Function performs a single step of the bowl method. Multiple decision points can be analyzed by repeated calls, as is done for qLearn() and optimalClass().
Usage
bowl(
...,
moPropen,
data,
reward,
txName,
regime,
response,
BOWLObj = NULL,
lambdas = 2,
cvFolds = 0L,
kernel = "linear",
kparam = NULL,
fSet = NULL,
surrogate = "hinge",
verbose = 2L
)
Arguments
... |
Used primarily to require named input. However, inputs for the optimization methods can be sent through the ellipsis. If surrogate is hinge, the optimization method is dfoptim::hjk(). For all other surrogates, stats::optim() is used. |
moPropen |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the propensity for tx. See ?moPropen for details. |
data |
A data frame of the covariates and tx histories. |
reward |
The response vector. |
txName |
A character object. The column header of data that corresponds to the tx covariate |
regime |
A formula object or a list of formula objects. The covariates to be included in the decision function/kernel. If a list is provided, this specifies that there is an underlying subset structure – fSet must then be defined. For subsets, the name of each element of the list must correspond to the name of a subset. If a regime is to be estimated using multiple subsets combined, each subset must be included in the name and separated by a comma (no spaces). |
response |
A numeric vector. The same as reward above. Allows for naming convention followed in most DynTxRegime methods. |
BOWLObj |
NULL or |
lambdas |
A numeric object or a numeric vector object giving the penalty tuning parameter(s). If more than 1 is provided, the set of tuning parameter values to be considered in the cross-validation algorithm (note that cvFolds must be positive in this case). |
cvFolds |
If cross-validation is to be used to select the tuning parameters and/or kernel parameters, the number of folds. |
kernel |
A character object. Must be one of {'linear', 'poly', 'radial'} |
kparam |
A numeric object. |
fSet |
A function or NULL defining subset structure. See ?fSet for details. |
surrogate |
The surrogate 0-1 loss function. Must be one of {'logit', 'exp', 'hinge', 'sqhinge', 'huber'}. |
verbose |
An integer or logical. If 0, no screen prints are generated. If 1, screen prints are generated with the exception of optimization results obtained in iterative algorithm. If 2, all screen prints are generated. |
Value
a BOWL-class
object
References
Yingqi Zhao, Donglin Zeng, Eric B. Laber, Michael R. Kosorok (2015) New statistical learning methods for estimating optimal dynamic treatment regimes. Journal of the American Statistical Association, 110:510, 583–598.
See Also
Other statistical methods:
earl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other weighted learning methods:
earl()
,
owl()
,
rwl()
Other multiple decision point methods:
iqLearn
,
optimalClass()
,
optimalSeq()
,
qLearn()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# define the negative 4 month change in BMI from baseline
y4 <- -100*(bmiData[,5L] - bmiData[,4L])/bmiData[,4L]
# reward for second stage
rewardSS <- y12 - y4
#### Second-stage regression
# Constant propensity model
moPropen <- buildModelObj(model = ~1,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
fitSS <- bowl(moPropen = moPropen,
data = bmiData, reward = rewardSS, txName = 'A2',
regime = ~ parentBMI + month4BMI)
##Available methods
# Coefficients of the propensity score regression
coef(fitSS)
# Description of method used to obtain object
DTRstep(fitSS)
# Estimated value of the optimal treatment regime for training set
estimator(fitSS)
# Value object returned by propensity score regression method
fitObject(fitSS)
# Summary of optimization routine
optimObj(fitSS)
# Estimated optimal treatment for training data
optTx(fitSS)
# Estimated optimal treatment for new data
optTx(fitSS, bmiData)
# Plots if defined by propensity regression method
dev.new()
par(mfrow = c(2,4))
plot(fitSS)
plot(fitSS, suppress = TRUE)
# Value object returned by propensity score regression method
propen(fitSS)
# Parameter estimates for decision function
regimeCoef(fitSS)
# Show main results of method
show(fitSS)
# Show summary results of method
summary(fitSS)
#### First-stage regression
# Constant propensity model
fitFS <- bowl(moPropen = moPropen,
data = bmiData, reward = y4, txName = 'A1',
regime = ~ gender + parentBMI,
BOWLObj = fitSS, lambdas = c(0.5, 1.0), cvFolds = 4L)
##Available methods for fitFS are as shown above for fitSS
# Results of the cross-validation
cvInfo(fitFS)
Create Model Objects for Subsets of Data
Description
Extends the buildModelObj() function of package modelObj. Here, the returned model object includes a specification of the decision point and subset of the data to which the model is to be applied.
Usage
buildModelObjSubset(
...,
model,
solver.method,
solver.args = NULL,
predict.method = NULL,
predict.args = NULL,
dp = 1L,
subset = NA
)
Arguments
... |
ignored. Included to require named input. |
model |
An object of class |
solver.method |
An object of class |
solver.args |
An object of class solver.method = "glm" solver.args = list("family"=binomial) See Details section for further information. |
predict.method |
An object of class |
predict.args |
An object of class predict.method = "predict.glm" predict.args = list("type"="response"). See Details section for further information. |
dp |
An object of class |
subset |
An object of class |
Details
In some 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 subset. Specifically, models are specified
in connection with the decision point and subset to which they are to be
applied.
See ?modelObj for further details
Value
An object of class 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.
Examples
# Consider a 2 decision point trial. At the 1st decision point, the subset of
# treatment options available to each patient is always set "set1."
# At the 2nd decision point, some patients are eligible to receive
# treatment from set "set2a" and others from set "set2b." 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 predictions obtained using predict.
#
# The following illustrates how to build these model objects.
model <- list()
model[[1]] <- buildModelObjSubset(dp = 1, subset = "set1",
model = ~ x1 + x2 + x3, solver.method = 'lm')
model[[2]] <- buildModelObjSubset(dp = 2, subset = "set2a",
model = ~ ~ x1 + x2, solver.method = 'lm')
model[[3]] <- buildModelObjSubset(dp = 2, subset = "set2b",
model = ~ x2 + x3, solver.method = 'lm')
Retrieve Classification Regression Analysis
Description
Method retrieves the value object returned by the user specified classification regression modeling object(s). Exact structure of the returned object will vary.
Usage
classif(object, ...)
## S4 method for signature 'OptimalClass'
classif(object, ...)
Arguments
object |
Value object returned from a method that uses classification regression |
... |
Ignored. |
Extract Model Coefficients From Objects Returned by Modeling Functions
Description
A list is returned, one element for each regression step required by the statistical method.
Usage
coef(object, ...)
Arguments
object |
Value object returned by any statistical method implemented in DynTxRegime. |
... |
Optional additional inputs defined by coefficient methods of selected regression functions. |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
The exact structure of the returned list will vary depending on the statistical method. For methods that include a propensity regression, the returned list will include an element named 'propen'. For methods that include an outcome regression, the returned list will include an element named 'outcome'.
Create method object for EARL
Description
Create method object for EARL
Usage
.createearl(kernel, txVec, response, prWgt, surrogate, guess = NULL, mu, ...)
Arguments
kernel |
Kernel object |
txVec |
Vector of tx coded as -1/1 |
response |
Vector of responses |
prWgt |
Vector of propensity for tx received |
surrogate |
Surrogate object indicating surrogate loss-function |
guess |
Vector of estimated regime parameters |
mu |
Matrix of outcome regression (zero/ignored) |
Value
An .earl object
Create method object for Outcome Weighted Learning
Description
Create method object for Outcome Weighted Learning
Usage
.createowl(..., kernel, txVec, response, prWgt, surrogate, guess = NULL, mu)
Arguments
kernel |
Kernel object |
txVec |
Vector of tx coded as -1/1 |
response |
Vector of responses |
prWgt |
Vector of propensity for tx received |
surrogate |
Surrogate object indicating surrogate loss-function |
guess |
Vector of estimated regime parameters |
mu |
Matrix of outcome regression (zero/ignored) |
Value
An .owl object
Create method object for Residual Weighted Learning
Description
Create method object for Residual Weighted Learning
Create method object for Residual Weighted Learning
Usage
.createrwl(kernel, txVec, response, prWgt, surrogate, guess = NULL, mu, ...)
.createrwlcount(
kernel,
txVec,
response,
prWgt,
surrogate,
guess = NULL,
mu,
...
)
Arguments
kernel |
Kernel object |
txVec |
Vector of tx coded as -1/1 |
response |
Vector of responses |
prWgt |
Vector of propensity for tx received |
surrogate |
Surrogate object indicating surrogate loss-function |
guess |
Vector of estimated regime parameters |
mu |
Matrix of outcome regression |
Value
An .rwl
object
An .rwl
object
Extract Cross-Validation Results
Description
Extract cross-validation results from the value object returned by a weighted learning statistical method of DynTxRegime.
Usage
cvInfo(object, ...)
Arguments
object |
A value object returned by a weighted learning statistical method of DynTxRegime |
... |
Ignored. |
Details
Methods are developed for all weighted learning methods implemented in DynTxRegime. Specifically, OWL, RWL, BOWL, and EARL.
Efficient Augmentation and Relaxation Learning
Description
Efficient Augmentation and Relaxation Learning
Usage
earl(
...,
moPropen,
moMain,
moCont,
data,
response,
txName,
regime,
iter = 0L,
fSet = NULL,
lambdas = 0.5,
cvFolds = 0L,
surrogate = "hinge",
kernel = "linear",
kparam = NULL,
verbose = 2L
)
Arguments
... |
Used primarily to require named input. However, inputs for the optimization methods can be sent through the ellipsis. If surrogate is hinge, the optimization method is dfoptim::hjk(). For all other surrogates, stats::optim() is used. |
moPropen |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the propensity for treatment. See ?moPropen for details. |
moMain |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the main effects of the outcome. See ?modelObj for details. |
moCont |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the contrasts of the outcome. See ?modelObj for details. |
data |
A data frame of the covariates and tx histories |
response |
The response variable. |
txName |
A character object. The column header of data that corresponds to the tx covariate |
regime |
A formula object or a list of formula objects. The covariates to be included in classification. If a list is provided, this specifies that there is an underlying subset structure – fSet must then be defined. |
iter |
Maximum number of iterations for outcome regression |
fSet |
A function or NULL defining subset structure |
lambdas |
A numeric object or a numeric vector object giving the penalty tuning parameter. If more than 1 is provided, the finite set of values to be considered in the cross-validation algorithm |
cvFolds |
If cross-validation is to be used to select the tuning parameters, the number of folds. |
surrogate |
The surrogate 0-1 loss function must be one of logit, exp, hinge, sqhinge, huber |
kernel |
A character object. must be one of {"linear", "poly", "radial"} |
kparam |
A numeric object of NULL. If kernel = linear, kparam is ignored. If kernel = poly, kparam is the degree of the polynomial If kernel = radial, kparam is the inverse bandwidth of the kernel. If a vector of bandwidth parameters is given, cross-validation will be used to select the parameter |
verbose |
An integer or logical. If 0, no screen prints are generated. If 1, screen prints are generated with the exception of optimization results obtained in iterative algorithm. If 2, all screen prints are generated. |
Value
an EARL object
References
Ying-Qi Zhao, Eric Laber, Sumona Saha and Bruce E. Sands (2016+) Efficient augmentation and relaxation learning for treatment regimes using observational data
See Also
Other statistical methods:
bowl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other single decision point methods:
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other weighted learning methods:
bowl()
,
owl()
,
rwl()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# propensity model
moPropen <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
# outcome model
moMain <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
fitEARL <- earl(moPropen = moPropen, moMain = moMain, moCont = moCont,
data = bmiData, response = y12, txName = 'A2',
regime = ~ parentBMI + month4BMI,
surrogate = 'logit', kernel = 'poly', kparam = 2)
##Available methods
# Coefficients of the regression objects
coef(fitEARL)
# Description of method used to obtain object
DTRstep(fitEARL)
# Estimated value of the optimal treatment regime for training set
estimator(fitEARL)
# Value object returned by regression methods
fitObject(fitEARL)
# Summary of optimization routine
optimObj(fitEARL)
# Estimated optimal treatment for training data
optTx(fitEARL)
# Estimated optimal treatment for new data
optTx(fitEARL, bmiData)
# Value object returned by outcome regression method
outcome(fitEARL)
# Plots if defined by regression methods
dev.new()
par(mfrow = c(2,4))
plot(fitEARL)
plot(fitEARL, suppress = TRUE)
# Value object returned by propensity score regression method
propen(fitEARL)
# Parameter estimates for decision function
regimeCoef(fitEARL)
# Show main results of method
show(fitEARL)
# Show summary results of method
summary(fitEARL)
Retrieve the Estimated Value
Description
Retrieve the value as estimated by the statistical method.
Usage
estimator(x, ...)
## S4 method for signature 'IQLearnFS'
estimator(x, w = NULL, y = NULL, z = NULL, dens = NULL)
## S4 method for signature 'IQLearnSS'
estimator(x, w = NULL, y = NULL, z = NULL, dens = NULL)
Arguments
x |
a DynTxRegime Object. |
... |
Optional additional input. Ignored. |
w |
If IQ-Learning, object of class IQLearnSS, IQLearnFS_C, IQLearnFS_ME, or IQLearnFS_VHet |
y |
If IQ-Learning, object of class IQLearnSS, IQLearnFS_C, IQLearnFS_ME, or IQLearnFS_VHet |
z |
If IQ-Learning, object of class IQLearnSS, IQLearnFS_C, IQLearnFS_ME, or IQLearnFS_VHet |
dens |
If IQ-Learning, one of {"norm", "nonpar"} |
Defining the fSet Input Variable
Description
Several of the statistical methods implemented in package DynTxRegime allow for subset modeling or limiting of feasible treatment options. This section details how this input is to be defined.
Details
In general, input fSet
is used to define subsets of patients
within an analysis. These subsets can be specified to (1) limit
available treatments, (2) use different models for the propensity
score and/or outcome regressions, and/or
(3) use different decision function models for
each subset of patients. The combination of inputs moPropen
,
moMain
, moCont
, fSet
, and/or regimes
determines which of these scenarios is
being considered. We cover some common situations below.
Regardless of the purpose for specifying fSet
, it must be a
function that returns a list. There are two options for defining the
function. Version 1 is that of the original DynTxRegime package.
In this version, fSet
defines the rules
for determining the subset of treatment options for an INDIVIDUAL.
The first element of the returned list is a character, which we term
the subset 'nickname.' This nickname is for bookkeeping purposes
and is used to link models to subsets. The second element
of the returned list is a vector
of available treatment options for the subset. The formal arguments of
the function must include (i) 'data' or (ii) individual covariate
names as given by the column headers of data
. An example using the
covariate name input form is
fSet <- function(a1) { if (a1 > 1) { subset <- list('subA',c(1,2)) } else { subset <- list('subB',c(3,4) ) } return(subset) }
This function indicates that if an individual has covariate a1 > 1, they are a member of subset 'subA' and their feasible treatment options are {1,2}. If a1 <= 1, they are a member of subset 'subB' and their feasible treatment options are {3,4}.
A more efficient implementation for fSet
is now accepted. In
the second form, fSet
defines the subset of treatment options
for the full DATASET. It is again a function with
formal arguments (i) 'data' or (ii) individual covariate names as
given by the column headers of data
. The function returns a list
containing two elements: 'subsets' and 'txOpts.' Element 'subsets' is
a list comprising all treatment subsets; each element of the list contains
the nickname and treatment options for a single subset. Element
'txOpts' is a character vector indicating the subset of which
each individual is a member. In this new format,
the equivalent definition of fSet
as that given above is:
fSet <- function(a1) { subsets <- list(list('subA', c(1,2)), list('subB', c(3,4))) txOpts <- rep('subB', length(x = a1)) txOpts[a1 > 1] <- 'subA' return(list("subsets" = subsets, "txOpts" = txOpts)) }
Though a bit more complicated, this version is much more efficient as it processes the entire dataset at once rather than each individual separately.
The simplest scenario involving fSet
is to define feasible
treatment options and the rules that dictate how those treatment
options are determined. For example,
responder/non-responder scenarios are often encountered in
multiple-decision-point settings. An example of this scenario is:
patients that respond to the first stage treatment
remain on the original treatment; those that
do not respond to the first stage treatment
have all treatment options available to them at the second stage.
In this case, the
propensity score models for the second stage
are fit using only 'non-responders' for whom
more than 1 treatment option is available.
An example of an appropriate fSet
function for
the second-stage is
fSet <- function(data) { if (data\$responder == 0L) { subset <- list('subA',c(1L,2L)) } else if (data\$tx1 == 1L) { subset <- list('subB',c(1L) ) } else if (data\$tx1 == 2L) { subset <- list('subC',c(2L) ) } return(subset) }
for version 1 or for version 2
fSet <- function(data) { subsets <- list(list('subA', c(1L,2L)), list('subB', c(1L)), list('subC', c(2L))) txOpts <- character(nrow(x = data)) txOpts[data$tx1 == 1L] <- 'subB' txOpts[data$tx1 == 2L] <- 'subC' txOpts[data$responder == 0L] <- 'subA' return(list("subsets" = subsets, "txOpts" = txOpts)) }
The functions above specify that patients with covariate responder = 0
receive treatments from subset 'subA,' which comprises treatments
A = (1,2). Patients with covariate responder = 1 receive treatment
from subset 'subB' or 'subC' depending on the first stage treatment
received. If
fSet
is specified in this way, the form of the model object depends
on the training data. Specifically, if the training data obeys the feasible
treatment rule (here, all individuals with responder = 1 received tx
in accordance with fSet), moPropen
would be a "modelObj"
;
the propensity model will be fit using only those patients with
responder = 0; those with responder = 1 always receive the appropriate
second stage treatment with probability 1.0. However, if the data
are from an observation study and the training data do not obey the
feasible treatment rules (here, some individuals with responder = 1 received
tx = 0; others tx = 1), the responder = 1 data must be modeled and moPropen
must be provided as one or more ModelObjSubset() objects.
If outcome regression is used by the method,
moMain
and moCont
can be either objects
of class "modelObj"
if only responder = 0 patients are to be used
to obtain parameter estimates or as lists of objects of class
"ModelObjSubset"
if subsets are to be analyzed individually or
combined for a single fit of all data.
For a scenario where all patients have the same set of treatment
options available, but subsets of patients are to be analyzed using
different models. We cane define fSet
as
fSet <- function(data) { if (data\$a1 == 1) { subset <- list('subA',c(1L,2L)) } else { subset <- list('subB',c(1L,2L) ) } return(subset) }
for version 1 or in the format of version 2
fSet <- function(data) { subsets <- list(list('subA', c(1L,2L)), list('subB', c(1L,2L))) txOpts <- rep('subB', nrow(x = data)) txOpts[data$a1 == 1L] <- 'subA' return(list("subsets" = subsets, "txOpts" = txOpts)) }
where all patients have the same treatment options available, A = (1,2),
but different regression models will be fit for each subset (case 2 above)
and/or different decision function models (case 3 above) for each
subset. If different propensity score models are used, moPropen
must be a list of objects of class "modelObjSubset."
Perhaps,
propenA <- buildModelObjSubset(model = ~1, solver.method = 'glm', solver.args = list('family'='binomial'), predict.method = 'predict.glm', predict.args = list(type='response'), subset = 'subA') propenB <- buildModelObjSubset(model = ~1, solver.method = 'glm', solver.args = list('family'='binomial'), predict.method = 'predict.glm', predict.args = list(type='response'), subset = 'subB') moPropen <- list(propenA, propenB)
If different decision function models are to be fit, regimes
would take a form similar to
regimes <- list( 'subA' = ~x1 + x2, 'subB' = ~x2 )
Notice that the names of the elements of regimes
and the subsets passed to
buildModelObjSubset() correspond to the names defined by fSet
,
i.e., 'subA' or 'subB.' These nicknames are used for bookkeeping and
link subsets to the appropriate models.
For a single-decision-point analysis, fSet
is a single function. For multiple-decision-point analyses,
fSet
is a list of functions where each element of
the list corresponds to the decision point (1st element <-
1st decision point, etc.)
Objects Returned by Modeling Functions
Description
Returns a list of the objects returned by all modeling functions
Usage
fitObject(object, ...)
Arguments
object |
Value object returned by a statistical method of DynTxRegime |
... |
Optional additional inputs |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
The exact structure of the returned list will vary depending on the statistical method. For methods that include a propensity regression, the returned list will include an element named 'propen'. For methods that include an outcome regression, the returned list will include an element named 'outcome'.
Retrieve the Fitted Contrast Component from Second Stage IQ-Learning
Description
Extracts the contrasts component of the fitted outcome regression the second-stage analysis of the interactive Q-Learning algorithm.
Usage
fittedCont(object, ...)
## S4 method for signature 'IQLearnSS'
fittedCont(object, ...)
Arguments
object |
An object of class IQLearnSS |
... |
Ignored. |
Retrieve the Fitted Main Effects Component from Second Stage IQ-Learning
Description
Extracts the main effects component of the fitted outcome regression for the second-stage analysis of the interactive Q-Learning algorithm.
Usage
fittedMain(object, ...)
## S4 method for signature 'IQLearnSS'
fittedMain(object, ...)
Arguments
object |
An object of class IQLearnSS |
... |
Ignored. |
Retrieve the Genetic Algorithm Results
Description
Retrieve the value object returned by rgenoud() in optimalSeq().
Usage
genetic(object, ...)
## S4 method for signature 'OptimalSeq'
genetic(object, ...)
Arguments
object |
Value object returned by optimalSeq() |
... |
Optional inputs. Ignored. |
Retrieve Outcome for Both Tx Options When Tx is Binary
Description
Retrieve Outcome for Both Tx Options When Tx is Binary
Retrieve Outcome for Both Tx Options When Tx is Binary
Usage
.getOutcome(outcomeObj, txObj, data)
.getOutcome2(outcomeObj, txObj, data)
Arguments
outcomeObj |
a OutcomeObj |
txObj |
a TxObj |
data |
a data.frame |
Value
matrix of outcome under binary tx.
matrix of outcome under binary tx.
Retrieve Propensity for Tx Received
Description
Retrieve Propensity for Tx Received
Usage
.getPrWgt(propenObj, txObj, data)
Arguments
propenObj |
a PropensityObj |
txObj |
a TxObj |
data |
a data.frame |
Value
vector of propensity for tx received.
Class .earl
Description
Class .earl
stores parameters required for EARL optimization step.
Slots
x
Matrix of covariates for kernel
wp
Vector of positive weights
wn
Vector of negative weights
mu
Matrix of outcome regression
txVec
Vector of treatment coded as -1/1
invPi
Vector of inverse propensity for treatment received
response
Vector of the response
surrogate
The Surrogate for the loss-function
par
Vector of regime parameters
kernel
The Kernel defining the decision function
Methods Available for Objects of Class .earl
Description
Methods Available for Objects of Class .earl
.objFn
not allowed for EARL with multiple radial kernels
.dobjFn
not allowed for EARL with multiple radial kernels
Usage
## S4 method for signature '.earl'
.subsetObject(methodObject, subset)
## S4 method for signature 'numeric,.earl,LinearKernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.earl,LinearKernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.earl,Kernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.earl,Kernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.earl,MultiRadialKernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.earl,MultiRadialKernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature '.earl'
.valueFunc(methodObject, optTx, ...)
Class .owl
Description
Class .owl
stores parameters required for OWL optimization step
Slots
x
Matrix of covariates for kernel
txSignR
Vector of tx multiplied by the sign of the response
txVec
Vector of tx coded as -1/1
absRinvPi
Vector of the absolute value of the response weighted by the propensity for the tx received
response
Vector of the response
invPi
Vector of the inverse of the propensity for the tx received
surrogate
The Surrogate for the loss-function
pars
Vector of regime parameters
kernel
The Kernel defining the decision function
Methods Available for Objects of Class .owl
Description
Methods Available for Objects of Class .owl
.objFn
is not allowed for OWL with multiple radial kernels
.dobjFn
is not allowed for OWL with multiple radial kernels
Usage
## S4 method for signature '.owl'
.subsetObject(methodObject, subset)
## S4 method for signature 'numeric,.owl,Kernel'
.objFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature 'numeric,.owl,Kernel'
.dobjFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature 'numeric,.owl,LinearKernel'
.objFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature 'numeric,.owl,LinearKernel'
.dobjFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature 'numeric,.owl,MultiRadialKernel'
.objFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature 'numeric,.owl,MultiRadialKernel'
.dobjFn(par, methodObject, kernel, ..., lambda)
## S4 method for signature '.owl'
.valueFunc(methodObject, ..., optTx)
Class .rwl
Description
Class .rwl
stores parameters required for an RWL optimization step
Slots
x
Matrix of covariates for kernel
txVec
Vector of treatment coded as -1/1
absRinvPi
Vector of the absolute value of the residual weighted by the propensity for the treatment received
residual
Vector of the residuals
response
Vector of the response
beta
Vector of beta parameters
surrogate
The Surrogate for the loss-function
pars
Vector of regime parameters
kernel
The Kernel defining the decision function
Methods Available for Objects of Class .rwl
Description
Methods Available for Objects of Class .rwl
.objFn
not allowed for RWL With multiple radial kernels
.dobjFn
not allowed for RWL With multiple radial kernels
Usage
## S4 method for signature '.rwl'
.subsetObject(methodObject, subset)
## S4 method for signature 'numeric,.rwl,LinearKernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.rwl,LinearKernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.rwl,Kernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.rwl,Kernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.rwl,MultiRadialKernel'
.objFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature 'numeric,.rwl,MultiRadialKernel'
.dobjFn(par, methodObject, kernel, lambda, ...)
## S4 method for signature '.rwl'
.valueFunc(methodObject, optTx, ...)
Interactive Q-Learning
Description
The complete interactive Q-Learning algorithm.
Usage
## Second-Stage Analysis
iqLearnSS(..., moMain, moCont, data, response, txName, iter = 0L,
verbose = TRUE)
## First-Stage Analysis for Fitted Main Effects
iqLearnFSM(..., moMain, moCont, data, response, txName, iter = 0L,
verbose = TRUE)
## First-Stage Analysis for Fitted Contrasts
iqLearnFSC(..., moMain, moCont, data, response, txName, iter = 0L,
verbose = TRUE)
## First-Stage Analysis of Contrast Variance Log-Linear Model
iqLearnFSV(..., object, moMain, moCont, data, iter = 0L, verbose = TRUE)
Arguments
... |
ignored. Provided to require named inputs. |
moMain |
An object of class modelObj or a list of objects of class modelObjSubset, which define the models and R methods to be used to obtain parameter estimates and predictions for the main effects component of the outcome regression. See ?modelObj and/or ?modelObjSubset for details. NULL is an acceptable value if moCont is defined. |
moCont |
An object of class modelObj or a list of objects of class modelObjSubset, which define the models and R methods to be used to obtain parameter estimates and predictions for the contrasts component of the outcome regression. See ?modelObj and/or ?modelObjSubset for details. NULL is an acceptable value if moMain is defined. |
data |
A data frame of covariates and treatment history. |
response |
For the second stage analysis, the response vector. For first stage analyses, the value object returned by iqLearnSS(). |
object |
The value object returned by iqLearFSC() |
txName |
A character string giving column header of treatment variable in data |
iter |
An integer. See ?iter for details |
verbose |
A logical. If TRUE, screen prints are generated. |
References
Laber, EB, Linn, KA, and Stefanski, LA (2014). Interactive model building for Q-Learning. Biometrika, 101, 831–847. PMCID: PMC4274394.
See Also
Other statistical methods:
bowl()
,
earl()
,
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other multiple decision point methods:
bowl()
,
optimalClass()
,
optimalSeq()
,
qLearn()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
#### Full Interactive Q-Learning Algorithm
### Second-Stage Analysis
# outcome model
moMain <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+month4BMI,
solver.method = 'lm')
fitSS <- iqLearnSS(moMain = moMain, moCont = moCont,
data = bmiData, response = y12, txName = 'A2')
### First-Stage Analysis Main Effects Term
# main effects model
moMain <- buildModelObj(model = ~parentBMI+baselineBMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+baselineBMI,
solver.method = 'lm')
fitFSM <- iqLearnFSM(moMain = moMain, moCont = moCont,
data = bmiData, response = fitSS, txName = 'A1')
### First-Stage Analysis Contrasts Term
# contrasts model
moMain <- buildModelObj(model = ~parentBMI+baselineBMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+baselineBMI,
solver.method = 'lm')
fitFSC <- iqLearnFSC(moMain = moMain, moCont = moCont,
data = bmiData, response = fitSS, txName = 'A1')
### First-Stage Analysis Contrasts Variance - Log-linear
# contrasts variance model
moMain <- buildModelObj(model = ~baselineBMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~baselineBMI,
solver.method = 'lm')
fitFSV <- iqLearnFSV(object = fitFSC, moMain = moMain, moCont = moCont,
data = bmiData)
####Available methods
### Estimated value
estimator(x = fitFSC, y = fitFSM, z = fitFSV, w = fitSS, dens = 'nonpar')
## Estimated optimal treatment and decision functions for training data
## Second stage optimal treatments
optTx(x = fitSS)
## First stage optimal treatments when contrast variance is modeled.
optTx(x = fitFSM, y = fitFSC, z = fitFSV, dens = 'nonpar')
## First stage optimal treatments when contrast variance is constant.
optTx(x = fitFSM, y = fitFSC, dens = 'nonpar')
## Estimated optimal treatment and decision functions for new data
## Second stage optimal treatments
optTx(x = fitSS, bmiData)
## First stage optimal treatments when contrast variance is modeled.
optTx(x = fitFSM, y = fitFSC, z = fitFSV, dens = 'nonpar', bmiData)
## First stage optimal treatments when contrast variance is constant.
optTx(x = fitFSM, y = fitFSC, dens = 'nonpar', bmiData)
### The following methods are available for all objects: fitSS, fitFSM,
### fitFSC and fitFSV. We include only one here for illustration.
# Coefficients of the outcome regression objects
coef(object = fitSS)
# Description of method used to obtain object
DTRstep(object = fitFSM)
# Value object returned by outcome regression method
fitObject(object = fitFSC)
# Value object returned by outcome regression method
outcome(object = fitFSV)
# Plots if defined by outcome regression method
dev.new()
par(mfrow = c(2,4))
plot(x = fitSS)
plot(x = fitSS, suppress = TRUE)
# Show main results of method
show(object = fitFSM)
# Show summary results of method
summary(object = fitFSV)
Defining the iter Input Variable
Description
Several of the statistical methods implemented in package DynTxRegime allow for an iterative algorithm when completing an outcome regression. This section details how this input is to be defined.
Details
Outcome regression models are specified by the main effects components
(moMain
) and the contrasts component (moCont
).
Assuming that the
treatment is denoted as binary A, the full regression model is:
moMain + A*moCont. There are two ways to fit this model: (i)
in the full model formulation (moMain + A*moCont) or (ii) each
component, moMain
and moCont
, is fit separately.
iter
specifies
if (i) or (ii) should be used.
iter
>= 1 indicates that moMain
and moCont
are to be
fit separately using an iterative algorithm.
iter
is the maximum number of iterations.
Assume Y = Ymain + Ycont;
the iterative algorithm is as follows:
(1) hat(Ycont) = 0;
(2) Ymain = Y - hat(Ycont);
(3) fit Ymain ~ moMain;
(4) set Ycont = Y - hat(Ymain)
(5) fit Ycont ~ A*moCont;
(6) Repeat steps (2) - (5) until convergence or a maximum of iter iterations.
This choice allows the user to specify, for example, a linear main effects component and a non-linear contrasts component.
iter
<= 0 indicates that the full model formulation is to be
used. The components moMain
and moCont
will be
combined in the package and fit as a single object.
Note that if iter
<= 0, all non-model components of
moMain
and moCont
must be identical. Specifically,
the regression method and any non-default arguments
should be identical.
By default, the specifications in moMain
are used.
Defining the moPropen Input Variable
Description
Several of the statistical methods implemented in package DynTxRegime use propensity score modeling. This section details how this input is to be defined.
Details
For input moPropen
, the method specified to obtain predictions
MUST return the prediction on the scale of the probability,
i.e., predictions must be in the range (0,1). In
addition, moPropen
differs from standard "modelObj"
objects in that an additional element may be required in
predict.args
. Recall, predict.args
is the list of control
parameters passed to the prediction method. An additional control
parameter, propen.missing
can be included. propen.missing
takes value "smallest" or "largest". It will be required if the
prediction method returns predictions for only a subset of the
treatment data; e.g., predict.glm(). propen.missing
indicates if
it is the smallest or the largest treatment value that is missing
from the returned predictions.
For example, fitting a binary treatment (A in {0,1}) using
moPropen <- buildModelObj(model = ~1, solver.method = 'glm', solver.args = list('family'='binomial'), predict.method = 'predict.glm', predict.args = list(type='response'))
returns only P(A=1). P(A=0) is "missing," and thus
moPropen <- buildModelObj(model = ~1, solver.method = 'glm', solver.args = list('family'='binomial'), predict.method = 'predict.glm', predict.args = list(type='response', propen.missing = 'smallest'))
If the dimension of the value returned by the prediction method is
less than the number of treatment options and no value is provided
in propen.missing
, it is assumed that the smallest valued treatment
option is missing. Here, 'smallest' indicates the lowest value
integer if treatment is an integer, or the 'base' level if treatment
is a factor.
Create a BOWL Object
Description
Create a BOWL Object
Usage
.newBOWLStep(
moPropen,
fSet,
data,
response,
txName,
lambdas,
cvFolds,
kernel,
surrogate,
suppress,
guess,
prodPi,
index,
...
)
Arguments
moPropen |
model object for propensity |
fSet |
function specifying subsets or NULL |
data |
data.frame of covariates and tx |
response |
vector of responses |
txName |
character indicating tx column in data |
lambdas |
vector of tuning parameters |
cvFolds |
number of cross-validation folds or NULL |
kernel |
Kernel object |
surrogate |
Surrogate object |
guess |
vector of starting value for regime parameterse |
prodPi |
vector of previous step propensity weights |
index |
vector indicating previous compliance with regime |
... |
additional inputs sent to optimization method |
Value
BOWLBasic object
An n-Fold Cross Validation Step
Description
An n-Fold Cross Validation Step
Usage
.newCVStep(cvObject, methodObject, lambda, suppress, ...)
Arguments
cvObject |
Information regarding folds and treatment groups |
methodObject |
Information needed for method specific objective function |
lambda |
numeric A single tuning parameter value |
suppress |
integer indicating printing preference |
... |
additional inputs. |
Value
The average value across all successfully trained folds
Create Internal Model Objects for Subsets of Data
Description
Create Internal Model Objects for Subsets of Data
Usage
.newModelObjSubset(object)
Arguments
object |
A list of modelObj or ModelObjSubset |
Value
An object of class ModelObj_SubsetList
if a single decision
point or an object of class ModelObj_DecisionPointList
if multiple
decision points.
Extract or Estimate the Optimal Tx and Decision Functions
Description
If newdata is provided, the results of the statistical method are used to estimate the decision functions and/or optimal tx. If newdata is missing, the estimated decision functions and/or optimal tx obtained for the original training data are returned.
Usage
optTx(x, newdata, ...)
## S4 method for signature 'IQLearnFS,data.frame'
optTx(x, newdata, ..., y = NULL, z = NULL, dens = NULL)
## S4 method for signature 'IQLearnFS,missing'
optTx(x, newdata, ..., y = NULL, z = NULL, dens = NULL)
Arguments
x |
a DynTxRegime Object. |
newdata |
Optional data.frame if estimates for new patients are desired. |
... |
Optional additional input. |
y |
Object of class IQLearnFS |
z |
Object of class IQLearnFS |
dens |
one of {norm, nonpar} |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
Extract Optimization Results
Description
Retrieves the value object returned by the optimization method for weighted learning methods.
Usage
optimObj(object, ...)
## S4 method for signature 'OWL'
optimObj(object, ...)
## S4 method for signature 'RWL'
optimObj(object, ...)
## S4 method for signature 'BOWL'
optimObj(object, ...)
## S4 method for signature 'EARL'
optimObj(object, ...)
Arguments
object |
A value object returned by a statistical method of DynTxRegime that uses optimization to estimate regime parameters. |
... |
Ignored. |
Classification Perspective
Description
Classification Perspective
Usage
optimalClass(
...,
moPropen,
moMain,
moCont,
moClass,
data,
response,
txName,
iter = 0L,
fSet = NULL,
verbose = TRUE
)
Arguments
... |
Included to require named inputs |
moPropen |
An object of class modelObj, which defines the models and R methods to be used to obtain parameter estimates and predictions for the propensity for treatment. See ?moPropen for details. |
moMain |
An object of class modelObj, which defines the models and R methods to be used to obtain parameter estimates and predictions for for the main effects component of the outcome regression. See ?modelObj for details. NULL is an appropriate value. |
moCont |
An object of class modelObj, which defines the models and R methods to be used to obtain parameter estimates and predictions for for the contrasts component of the outcome regression. See ?modelObj for details. NULL is an appropriate value. |
moClass |
An object of class modelObj, which defines the models and R methods to be used to obtain parameter estimates and predictions for the classification. See ?modelObj for details. |
data |
A data frame of the covariates and tx histories |
response |
The response vector |
txName |
An character giving the column header of the column in data that contains the tx covariate. |
iter |
An integer See ?iter for details |
fSet |
A function or NULL. This argument allows the user to specify the subset of tx options available to a patient. See ?fSet for details of allowed structure |
verbose |
A logical If FALSE, screen prints are suppressed. |
Value
an object of class OptimalClass
References
Baqun Zhang, Anastasios A. Tsiatis, Marie Davidian, Min Zhang and Eric B. Laber. "Estimating optimal tx regimes from a classification perspective." Stat 2012; 1: 103-114.
Note that this method is a single decision point, binary treatment method. For multiple decision points, can be called repeatedly.
See Also
Other statistical methods:
bowl()
,
earl()
,
iqLearn
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other single decision point methods:
earl()
,
optimalSeq()
,
owl()
,
qLearn()
,
rwl()
Other multiple decision point methods:
bowl()
,
iqLearn
,
optimalSeq()
,
qLearn()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# Define the propensity for treatment model and methods.
moPropen <- buildModelObj(model = ~ 1,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
# classification model
library(rpart)
moClass <- buildModelObj(model = ~parentBMI+month4BMI+race+gender,
solver.method = 'rpart',
solver.args = list(method="class"),
predict.args = list(type='class'))
#### Second-Stage Analysis using IPW
fitSS_IPW <- optimalClass(moPropen = moPropen,
moClass = moClass,
data = bmiData, response = y12, txName = 'A2')
# outcome model
moMain <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+month4BMI,
solver.method = 'lm')
#### Second-Stage Analysis using AIPW
fitSS_AIPW <- optimalClass(moPropen = moPropen,
moMain = moMain, moCont = moCont,
moClass = moClass,
data = bmiData, response = y12, txName = 'A2')
##Available methods
# Retrieve the classification regression object
classif(object = fitSS_AIPW)
# Coefficients of the outcome regression objects
coef(object = fitSS_AIPW)
# Description of method used to obtain object
DTRstep(object = fitSS_AIPW)
# Estimated value of the optimal treatment regime for training set
estimator(x = fitSS_AIPW)
# Value object returned by outcome regression method
fitObject(object = fitSS_AIPW)
# Estimated optimal treatment and decision functions for training data
optTx(x = fitSS_AIPW)
# Estimated optimal treatment and decision functions for new data
optTx(x = fitSS_AIPW, newdata = bmiData)
# Value object returned by outcome regression method
outcome(object = fitSS_AIPW)
outcome(object = fitSS_IPW)
# Plots if defined by outcome regression method
dev.new()
par(mfrow = c(2,4))
plot(x = fitSS_AIPW)
plot(x = fitSS_AIPW, suppress = TRUE)
# Retrieve the value object returned by propensity regression method
propen(object = fitSS_AIPW)
# Show main results of method
show(object = fitSS_AIPW)
# Show summary results of method
summary(object = fitSS_AIPW)
#### First-stage Analysis using AIPW
# Define the propensity for treatment model and methods.
moPropen <- buildModelObj(model = ~ 1,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
# classification model
moClass <- buildModelObj(model = ~parentBMI+baselineBMI+race+gender,
solver.method = 'rpart',
solver.args = list(method="class"),
predict.args = list(type='class'))
# outcome model
moMain <- buildModelObj(model = ~parentBMI+baselineBMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+baselineBMI,
solver.method = 'lm')
fitFS_AIPW <- optimalClass(moPropen = moPropen,
moMain = moMain, moCont = moCont,
moClass = moClass,
data = bmiData, response = fitSS_AIPW,
txName = 'A1')
##Available methods for fitFS_AIPW are as shown above for fitSS_AIPW
Missing or Coarsened Data Perspective - Genetic Algorithm
Description
Missing or Coarsened Data Perspective - Genetic Algorithm
Usage
optimalSeq(
...,
moPropen,
moMain,
moCont,
data,
response,
txName,
regimes,
fSet = NULL,
refit = FALSE,
iter = 0L,
verbose = TRUE
)
Arguments
... |
Additional arguments required by rgenoud. At a minimum this should include Domains, pop.size and starting.values. See ?rgenoud for more information. |
moPropen |
An object of class modelObj, a list of objects of class modelObj, or a list of object of class modelObjSubset, which define the models and R methods to be used to obtain parameter estimates and predictions for the propensity for treatment. See ?moPropen for details. |
moMain |
An object of class modelObj, a list of objects of class modelObj, or a list of object of class modelObjSubset, which define the models and R methods to be used to obtain parameter estimates and predictions for the main effects component of the outcome regression. See ?modelObj and/or ?modelObjSubset for details. NULL is an acceptable input if IPWE is desired or there is no main effects component of the outcome regression model. |
moCont |
An object of class modelObj, a list of objects of class modelObj, or a list of object of class modelObjSubset, which define the models and R methods to be used to obtain parameter estimates and predictions for the contrasts component of the outcome regression. See ?modelObj and/or ?modelObjSubset for details. NULL is an acceptable input if IPWE is desired or there is no contrast component of the outcome regression model. |
data |
A data frame of the covariates and tx history |
response |
The response vector |
txName |
A vector of characters. The column headers of data that correspond to the tx covariate for each decision point. The ordering should be sequential, i.e., the 1st element gives column name for the 1st decision point tx, the 2nd gives column name for the 2nd decision point tx, etc. |
regimes |
A function or a list of functions. For each decision point, a function defining the tx rule. For example, if the tx rule is : I(eta_1 < x1), regimes is defined as regimes <- function(a,data) {as.numeric(a < data$x1)} THE LAST ARGUMENT IS ALWAYS TAKEN TO BE THE DATA.FRAME |
fSet |
A function or a list of functions. This argument allows the user to specify the subset of tx options available to a patient or the subset of patients that will be modeled uniquely. see ?fSet for details |
refit |
No longer used |
iter |
An integer. See ?iter for details |
verbose |
A logical. If FALSE, screen prints are suppressed. |
Value
An object inheriting from class OptimalSeq
References
Baqun Zhang, Anastasios A. Tsiatis, Eric B. Laber & Marie Davidian, "A Robust Method for Estimating Optimal Treatment Regimes", Biometrics, 68, 1010-1018.
Baqun Zhang, Anastasios A. Tsiatis, Eric B. Laber & Marie Davidian, "Robust estimation of optimal treatment regimes for sequential treatment decisions", Biometrika (2013) pp.1-14.
See Also
Other statistical methods:
bowl()
,
earl()
,
iqLearn
,
optimalClass()
,
owl()
,
qLearn()
,
rwl()
Other single decision point methods:
earl()
,
optimalClass()
,
owl()
,
qLearn()
,
rwl()
Other multiple decision point methods:
bowl()
,
iqLearn
,
optimalClass()
,
qLearn()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# Define the propensity for treatment model and methods.
# Will use constant model for both decision points
moPropen <- buildModelObj(model = ~ 1,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
moPropen <- list(moPropen, moPropen)
# outcome model second stage
moMain2 <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
moCont2 <- buildModelObj(model = ~race + parentBMI+month4BMI,
solver.method = 'lm')
# outcome model first stage
moMain1 <- buildModelObj(model = ~parentBMI+baselineBMI,
solver.method = 'lm')
moCont1 <- buildModelObj(model = ~race + parentBMI+baselineBMI,
solver.method = 'lm')
moMain <- list(moMain1, moMain2)
moCont <- list(moCont1, moCont2)
# regime function second stage
regime2 <- function(eta1, eta2, data) {
tst <- {data$parentBMI > eta1} & {data$month4BMI > eta2}
rec <- rep('MR', nrow(x = data))
rec[!tst] <- 'CD'
return( rec )
}
# regime function first stage
regime1 <- function(eta1, eta2, data) {
tst <- {data$parentBMI > eta1} & {data$baselineBMI > eta2}
rec <- rep('MR', nrow(x = data))
rec[!tst] <- 'CD'
return( rec )
}
regimes <- list(regime1, regime2)
#### Analysis using AIPW
## Not run:
fit_AIPW <- optimalSeq(moPropen = moPropen,
moMain = moMain, moCont = moCont,
regimes = regimes,
data = bmiData, response = y12, txName = c('A1','A2'),
Domains = cbind(rep(0,4),rep(100,4)),
pop.size = 100, starting.values = rep(25,4))
##Available methods
# Coefficients of the regression objects
coef(object = fit_AIPW)
# Description of method used to obtain object
DTRstep(object = fit_AIPW)
# Estimated value of the optimal treatment regime for training set
estimator(x = fit_AIPW)
# Value object returned by regression methods
fitObject(object = fit_AIPW)
# Retrieve the results of genetic algorithm
genetic(object = fit_AIPW)
# Estimated optimal treatment and decision functions for training data
optTx(x = fit_AIPW)
# Estimated optimal treatment and decision functions for new data
optTx(x = fit_AIPW, newdata = bmiData)
# Value object returned by outcome regression method
outcome(object = fit_AIPW)
# Plots if defined by regression methods
dev.new()
par(mfrow = c(2,4))
plot(x = fit_AIPW)
plot(x = fit_AIPW, suppress = TRUE)
# Retrieve the value object returned by propensity regression method
propen(object = fit_AIPW)
# Show main results of method
show(object = fit_AIPW)
# Show summary results of method
summary(object = fit_AIPW)
## End(Not run)
#### Single Decision Point Analysis using IPW
# Define the propensity for treatment model and methods.
moPropen <- buildModelObj(model = ~ 1,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
# regime function second stage
regime <- function(eta1, eta2, data) {
tst <- {data$parentBMI > eta1} & {data$month4BMI > eta2}
rec <- rep('MR', nrow(x = data))
rec[!tst] <- 'CD'
return( rec )
}
## Not run:
fit_IPW <- optimalSeq(moPropen = moPropen,
regimes = regime,
data = bmiData, response = y12, txName = 'A2',
Domains = cbind(rep(0,2),rep(100,2)),
pop.size = 100, starting.values = rep(25,2))
##Available methods
# Coefficients of the regression objects
coef(object = fit_IPW)
# Description of method used to obtain object
DTRstep(object = fit_IPW)
# Estimated value of the optimal treatment regime for training set
estimator(x = fit_IPW)
# Value object returned by regression method
fitObject(object = fit_IPW)
# Retrieve the results of genetic algorithm
genetic(object = fit_IPW)
# Estimated optimal treatment and decision functions for training data
optTx(x = fit_IPW)
# Estimated optimal treatment and decision functions for new data
optTx(x = fit_IPW, newdata = bmiData)
# Value object returned by outcome regression method
outcome(object = fit_IPW)
# Plots if defined by outcome regression method
dev.new()
par(mfrow = c(2,4))
plot(x = fit_IPW)
plot(x = fit_IPW, suppress = TRUE)
# Retrieve the value object returned by propensity regression method
propen(object = fit_IPW)
# Show main results of method
show(object = fit_IPW)
# Show summary results of method
summary(object = fit_IPW)
## End(Not run)
Retrieve Outcome Regression Analysis
Description
For statistical methods that require an outcome regression analysis, the value object returned by the modeling function(s) is retrieved.
Usage
outcome(object, ...)
Arguments
object |
A value object returned by a statistical method of DynTxRegime. |
... |
Ignored. |
Details
Methods are defined for all statistical methods implemented in DynTxRegime that use outcome regression.
Outcome Weighted Learning
Description
Outcome Weighted Learning
Usage
owl(
...,
moPropen,
data,
reward,
txName,
regime,
response,
lambdas = 2,
cvFolds = 0L,
kernel = "linear",
kparam = NULL,
surrogate = "hinge",
verbose = 2L
)
Arguments
... |
Used primarily to require named input. However, inputs for the optimization methods can be sent through the ellipsis. If surrogate is hinge, the optimization method is kernlab::ipop(). For all other surrogates, stats::optim() is used. |
moPropen |
An object of class modelObj, which defines the model and R methods to be used to obtain parameter estimates and predictions for the propensity for treatment. See ?moPropen for details. |
data |
A data frame of the covariates and tx histories |
reward |
The response vector |
txName |
A character object. The column header of data that corresponds to the tx covariate |
regime |
A formula object or a character vector. The covariates to be included in classification |
response |
A numeric vector. The reward. Allows for naming convention followed in most DynTxRegime methods. |
lambdas |
A numeric object or a numeric vector object giving the penalty tuning parameter. If more than 1 is provided, the finite set of values to be considered in the cross-validation algorithm |
cvFolds |
If cross-validation is to be used to select the tuning parameters, the number of folds. |
kernel |
A character object. must be one of {"linear", "poly", "radial"} |
kparam |
A numeric object of NULL. If kernel = linear, kparam is ignored. If kernel = poly, kparam is the degree of the polynomial If kernel = radial, kparam is the inverse bandwidth of the kernel. If a vector of bandwidth parameters is given, cross-validation will be used to select the parameter |
surrogate |
The surrogate 0-1 loss function must be one of logit, exp, hinge, sqhinge, huber |
verbose |
An integer or logical. If 0, no screen prints are generated. If 1, screen prints are generated with the exception of optimization results obtained in iterative algorithm. If 2, all screen prints are generated. |
Value
an OWL object
References
Yingqi Zhao, Donglin Zeng, A. John Rush, Michael R. Kosorok (2012) Estimated individualized treatment rules using outcome weighted learning. Journal of the American Statistical Association, 107(409): 1106-1118. PMCID: 3636816
See Also
Other statistical methods:
bowl()
,
earl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
,
qLearn()
,
rwl()
Other weighted learning methods:
bowl()
,
earl()
,
rwl()
Other single decision point methods:
earl()
,
optimalClass()
,
optimalSeq()
,
qLearn()
,
rwl()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# propensity model
moPropen <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
fitOWL <- owl(moPropen = moPropen,
data = bmiData, reward = y12, txName = 'A2',
regime = ~ parentBMI + month4BMI,
surrogate = 'hinge', kernel = 'linear', kparam = NULL)
##Available methods
# Coefficients of the propensity score regression
coef(fitOWL)
# Description of method used to obtain object
DTRstep(fitOWL)
# Estimated value of the optimal treatment regime for training set
estimator(fitOWL)
# Value object returned by propensity score regression method
fitObject(fitOWL)
# Summary of optimization routine
optimObj(fitOWL)
# Estimated optimal treatment for training data
optTx(fitOWL)
# Estimated optimal treatment for new data
optTx(fitOWL, bmiData)
# Plots if defined by propensity regression method
dev.new()
par(mfrow = c(2,4))
plot(fitOWL)
plot(fitOWL, suppress = TRUE)
# Value object returned by propensity score regression method
propen(fitOWL)
# Parameter estimates for decision function
regimeCoef(fitOWL)
# Show main results of method
show(fitOWL)
# Show summary results of method
summary(fitOWL)
Generates Plots as Defined by Modeling Functions
Description
Calls plot() method for all regression steps of a statistical method
Arguments
x |
Value object returned by a statistical method |
y |
Ignored |
suppress |
T/F indicating if titles should be concatenated with information indicating the specific regression step |
... |
Optional additional inputs |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
Retrieve Propensity Regression Analysis
Description
For statistical methods that require a propensity regression analysis, the value object returned by the modeling function(s) is retrieved.
Usage
propen(object, ...)
Arguments
object |
A value object returned by a statistical method of DynTxRegime. |
... |
Ignored. |
Details
Methods are defined for all statistical methods implemented in DynTxRegime that use propensity regression.
A Step of the Q-Learning Algorithm
Description
Performs a single step of the Q-Learning algorithm.
If an object of class QLearn
is passed through input response,
it is assumed that the QLearn
object is the value object returned
from the preceding step of the Q-Learning algorithm, and
the value fit by the regression is taken from the QLearn
object.
If a vector is passed through input response, it is assumed that the
call if for the first step in the Q-Learning algorithm, and
models are fit using the provided response.
Usage
qLearn(
...,
moMain,
moCont,
data,
response,
txName,
fSet = NULL,
iter = 0L,
verbose = TRUE
)
Arguments
... |
ignored. Provided to require named inputs. |
moMain |
An object of class modelObj or a list of objects of class
modelObjSubset, which define the models and R methods to be used to
obtain parameter estimates and predictions for the main effects component
of the outcome regression. |
moCont |
An object of class modelObj or a list of objects of class
modelObjSubset, which define the models and R methods to be used to
obtain parameter estimates and predictions for the contrasts component
of the outcome regression. |
data |
A data frame of covariates and treatment history. |
response |
A response vector or object of class QLearn from a previous Q-Learning step. |
txName |
A character string giving column header of treatment variable in data |
fSet |
NULL or a function. This argument allows the user to specify the subset of treatment options available to a patient. See ?fSet for details of allowed structure |
iter |
An integer. See ?iter for details |
verbose |
A logical. If TRUE, screen prints are generated. |
Value
An object of class QLearn-class
See Also
Other statistical methods:
bowl()
,
earl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
,
owl()
,
rwl()
Other multiple decision point methods:
bowl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
Other single decision point methods:
earl()
,
optimalClass()
,
optimalSeq()
,
owl()
,
rwl()
Examples
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# outcome model
moMain <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+month4BMI,
solver.method = 'lm')
#### Second-Stage Analysis
fitSS <- qLearn(moMain = moMain, moCont = moCont,
data = bmiData, response = y12, txName = 'A2')
##Available methods
# Coefficients of the outcome regression objects
coef(fitSS)
# Description of method used to obtain object
DTRstep(fitSS)
# Estimated value of the optimal treatment regime for training set
estimator(fitSS)
# Value object returned by outcome regression method
fitObject(fitSS)
# Estimated optimal treatment and decision functions for training data
optTx(fitSS)
# Estimated optimal treatment and decision functions for new data
optTx(fitSS, bmiData)
# Value object returned by outcome regression method
outcome(fitSS)
# Plots if defined by outcome regression method
dev.new()
par(mfrow = c(2,4))
plot(fitSS)
plot(fitSS, suppress = TRUE)
# Show main results of method
show(fitSS)
# Show summary results of method
summary(fitSS)
#### First-stage Analysis
# outcome model
moMain <- buildModelObj(model = ~parentBMI+baselineBMI,
solver.method = 'lm')
moCont <- buildModelObj(model = ~race + parentBMI+baselineBMI,
solver.method = 'lm')
fitFS <- qLearn(moMain = moMain, moCont = moCont,
data = bmiData, response = fitSS, txName = 'A1')
##Available methods for fitFS are as shown above for fitSS
Extract Regime Parameters
Description
Extract the estimated regime parameters.
Usage
regimeCoef(object, ...)
Arguments
object |
A value object returned by a statistical method of DynTxRegime. |
... |
Ignored. |
Details
Methods are defined for all statistical methods implemented in DynTxRegime that use a non-regression based regime. Specifically, OptimalSeq, OWL, BOWL, RWL, and EARL.
Extract Model Residuals
Description
Retrieve residuals from an interactive Q-Learning step.
Usage
residuals(object, ...)
## S4 method for signature 'IQLearnFS_C'
residuals(object, ...)
## S4 method for signature 'IQLearnFS_VHet'
residuals(object, ...)
Arguments
object |
A value object returned by iqLearnC() or iqLearnVar() |
... |
Ignored. |
Residual Weighted Learning
Description
Residual Weighted Learning
Usage
rwl(
...,
moPropen,
moMain,
data,
reward,
txName,
regime,
response,
fSet = NULL,
lambdas = 2,
cvFolds = 0L,
kernel = "linear",
kparam = NULL,
responseType = "continuous",
verbose = 2L
)
Arguments
... |
Used primarily to require named input. However, inputs for the optimization methods can be sent through the ellipsis. The optimization method is stats::optim(). |
moPropen |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the propensity for treatment. See ?moPropen for details. |
moMain |
An object of class modelObj or modelObjSubset, which defines the model and R methods to be used to obtain parameter estimates and predictions for the main effects of the outcome. See ?modelObj for details. |
data |
A data frame of the covariates and tx histories |
reward |
The response vector |
txName |
A character object. The column header of data that corresponds to the tx covariate |
regime |
A formula object or a list of formula objects. The covariates to be included in classification. If a list is provided, this specifies that there is an underlying subset structure – fSet must then be defined. |
response |
A numeric vector. The reward. Allows for naming convention followed in most DynTxRegime methods. |
fSet |
A function or NULL defining subset structure |
lambdas |
A numeric object or a numeric vector object giving the penalty tuning parameter. If more than 1 is provided, the finite set of values to be considered in the cross-validation algorithm |
cvFolds |
If cross-validation is to be used to select the tuning parameters, the number of folds. |
kernel |
A character object. must be one of {"linear", "poly", "radial"} |
kparam |
A numeric object of NULL. If kernel = linear, kparam is ignored. If kernel = poly, kparam is the degree of the polynomial If kernel = radial, kparam is the inverse bandwidth of the kernel. If a vector of bandwidth parameters is given, cross-validation will be used to select the parameter |
responseType |
A character indicating if response is continuous, binary or count data. |
verbose |
An integer or logical. If 0, no screen prints are generated. If 1, screen prints are generated with the exception of optimization results obtained in iterative algorithm. If 2, all screen prints are generated. |
Value
an RWL object
References
Xin Zhou, Nicole Mayer-Hamblett, Umer Khan, and Michael R Kosorok (2017) Residual weighted learning for estimating individualized treatment rules. Journal of the American Statistical Association, 112, 169–187.
See Also
Other statistical methods:
bowl()
,
earl()
,
iqLearn
,
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
Other weighted learning methods:
bowl()
,
earl()
,
owl()
Other single decision point methods:
earl()
,
optimalClass()
,
optimalSeq()
,
owl()
,
qLearn()
Examples
## Not run:
# Load and process data set
data(bmiData)
# define the negative 12 month change in BMI from baseline
y12 <- -100*(bmiData[,6L] - bmiData[,4L])/bmiData[,4L]
# propensity model
moPropen <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'glm',
solver.args = list('family'='binomial'),
predict.method = 'predict.glm',
predict.args = list(type='response'))
# outcome model
moMain <- buildModelObj(model = ~parentBMI+month4BMI,
solver.method = 'lm')
fitRWL <- rwl(moPropen = moPropen, moMain = moMain,
data = bmiData, reward = y12, txName = 'A2',
regime = ~ parentBMI + month4BMI,
kernel = 'radial', kparam = 1.5)
##Available methods
# Coefficients of the regression objects
coef(fitRWL)
# Description of method used to obtain object
DTRstep(fitRWL)
# Estimated value of the optimal treatment regime for training set
estimator(fitRWL)
# Value object returned by regression methods
fitObject(fitRWL)
# Summary of optimization routine
optimObj(fitRWL)
# Estimated optimal treatment for training data
optTx(fitRWL)
# Estimated optimal treatment for new data
optTx(fitRWL, bmiData)
# Value object returned by outcome regression method
outcome(fitRWL)
# Plots if defined by regression methods
dev.new()
par(mfrow = c(2,4))
plot(fitRWL)
plot(fitRWL, suppress = TRUE)
# Value object returned by propensity score regression method
propen(fitRWL)
# Parameter estimates for decision function
regimeCoef(fitRWL)
# Show main results of method
show(fitRWL)
# Show summary results of method
summary(fitRWL)
## End(Not run)
Standard Deviation
Description
Retrieve the standard deviation of the residuals for the first-stage contrasts regression in the interactive Q-Learning algorithm.
Usage
sd(x, na.rm=FALSE)
## S4 method for IQLearnFS_C
sd(x, na.rm=FALSE)
Arguments
x |
An object of class |
na.rm |
logical. Should missing values be removed? |
Result Summaries
Description
Returns a list of the primary results, including regression results, optimization results, estimated tx and value, etc.
Usage
summary(object, ...)
Arguments
object |
Value object returned by a statistical method |
... |
Optional additional inputs |
Details
Methods are defined for all statistical methods implemented in DynTxRegime.
The exact structure of the returned list will vary depending on the statistical method.