Learn R Programming

DynTxRegime (version 3.01)

Regime_DecisionPointList-class: Class

Description

A list of objects of class "Regime" for multiple-decision-point methods.

Arguments

Objects from the Class

Objects can be created by calls of the form new("Regime_DecisionPointList", ...). These objects are for convenience in package development and should not be created by users.

Extends

Classes "RegimeObject-class" and "DecisionPointList-class" directly.

Classes "List-class" and "MultipleDecisionPoint-class" by class "DecisionPointList-class", distance 2.

Methods

.getNumPars
signature(object = "Regime_DecisionPointList"): Retrieve a list, ith element contains the number of parameters in the ith decision rule. Method not exported.

.getParNames
signature(object = "Regime_DecisionPointList"): Retrieve a list, ith element contains the names of the parameters for the ith decision rule. Method not exported.

.getPars
signature(object = "Regime_DecisionPointList"): Retrieve a list, ith element contains the parameter estimates for the ith decision rule. Method not exported.

.getRegimeFunction
signature(object = "Regime_DecisionPointList"): Retrieve a list, ith element contains the decision rule function for the ith decision point. Method not exported.

.predictOptimalTx
signature(x = "Regime", newdata = "data.frame", dp="integer"): Estimate the optimal treatment for newdata at dp decision point. Method not exported.

.setPars
signature(object = "Regime"): Set the parameter estimates for all decision rules. Method not exported.

regimeCoef
signature(object = "Regime_DecisionPointList"): Retrieve regime parameter estimates.

Examples

Run this code
showClass("Regime_DecisionPointList")

data <- data.frame(x1 = rnorm(10), x2 = rnorm(10))

regime <- list()
regime[[1L]] <- function(a,data){
                  return(data$x1 < a)
                }

regime[[2L]] <- function(a,data){
                  return(data$x2 < a)
                }

regObj <- list()
regObj[[1L]] <- new("Regime",
                    nVars = 1L,
                    vNames = c("a"),
                    func = regime[[1L]],
                    pars = c(0.1))
regObj[[2L]] <- new("Regime",
                    nVars = 1L,
                    vNames = c("a"),
                    func = regime[[2L]],
                    pars = c(0.1))

regObj <- new("DecisionPointList", loo = regObj)
regObj <- new("Regime_DecisionPointList", regObj)

is(regObj)

DynTxRegime:::.getNumPars(object = regObj)
DynTxRegime:::.getParNames(object = regObj)
DynTxRegime:::.getPars(object = regObj)
DynTxRegime:::.getRegimeFunction(object = regObj)
DynTxRegime:::.predictOptimalTx(x = regObj, newdata = data, dp=1)
DynTxRegime:::.predictOptimalTx(x = regObj, newdata = data, dp=2)
regObj <- DynTxRegime:::.setPars(object = regObj, pars = c(0.2,0.2))
DynTxRegime:::.getPars(object = regObj)
regimeCoef(object = regObj)

Run the code above in your browser using DataLab