Learn R Programming

DynTxRegime (version 3.2)

iqLearnSS: IQ-Learning: Second-Stage Regression

Description

Estimate an optimal dynamic treatment regime using the Interactive Q-learning (IQ-learning) algorithm when the data has been collected from a two-stage randomized trial with binary treatments. iqLearnSS implements the second-stage regression step of the IQ-Learning algorithm (IQ1).

Usage

iqLearnSS(..., moMain, moCont, data, response, txName, iter = 0L, verbose = TRUE)

Arguments

ignored. Included to require named input.

moMain

An object of class "modelObj." This object specifies the main effects component of the model for the outcome regression and the R methods to be used to obtain parameter estimates and predictions. The method specified to obtain predictions must return the prediction on the scale of the response variable.

moCont

An object of class "modelObj." This object specifies the contrasts component of the model for the outcome regression and the R methods to be used to obtain parameter estimates and predictions. The method specified to obtain predictions must return the prediction on the scale of the response variable.

data

An object of class "data.frame." The covariates and treatment histories.

response

An object of class "vector." The outcome of interest.

txName

An object of class "character." The column header of the stage treatment variable as given in input data. The treatment variable must be binary and will be recoded as -1/+1 if not provided as such.

iter

An object of class "integer." If >0, the iterative method will be used to obtain parameter estimates in the outcome regression step. See iter for further information.

verbose

An object of class "logical." If FALSE, screen prints will be suppressed.

Value

Returns an object of class "IQLearnSS" that inherits directly from class "DynTxRegime."

Methods

coef

signature(object = "IQLearnSS"): Retrieve parameter estimates for all regression steps.

DTRstep

signature(object = "IQLearnSS"): Retrieve description of method used to create object.

estimator

signature(x = "IQLearnSS"): Retrieve the estimated value of the estimated optimal regime for the training data set.

fitObject

signature(object = "IQLearnSS"): Retrieve value object returned by regression methods.

fittedCont

signature(object = "IQLearnSS"): Retrieve estimated contrast component of outcome regression.

fittedMain

signature(object = "IQLearnSS"): Retrieve estimated main effects component of outcome regression.

optTx

signature(x = "IQLearnSS", newdata = "missing"): Retrieve the estimated optimal treatment regime for training data set.

optTx

signature(x = "IQLearnSS", newdata = "data.frame"): Estimate the optimal treatment regime for newdata.

outcome

signature(x = "IQLearnSS"): Retrieve value object returned by outcome regression methods.

plot

signature(x = "IQLearnSS"): Generate plots for regression analyses.

print

signature(object = "IQLearnSS"): Print main results of analysis.

show

signature(object = "IQLearnSS"): Show main results of analysis.

summary

signature(object = "IQLearnSS"): Retrieve summary information from regression analyses.

References

Laber, E. B., Linn, K. A., and Stefanski, L.A. (2014). Interactive model building for Q-learning. Biometrika, 101, 831--847.

See Also

iqLearnFSM, iqLearnFSC, iqLearnFSV

Examples

Run this code
# NOT RUN {
# Load and process data set
  data(bmiData)

  # define response y to be the negative 12 month
  # change in BMI from baseline
  bmiData$y <- -100*(bmiData[,6] - bmiData[,4])/bmiData[,4]

# Second-stage regression - Single Regression Analysis
  # Create modelObj object for main effect component
  moMain <- buildModelObj(model = ~ gender + parentBMI + month4BMI,
                          solver.method = 'lm')

  # Create modelObj object for contrast component
  moCont <- buildModelObj(model = ~ parentBMI + month4BMI,
                          solver.method = 'lm')

  iqSS <- iqLearnSS(moMain = moMain, moCont = moCont, 
                    data = bmiData, response = bmiData$y, txName = "A2", 
                    iter = 0L)

## Available methods for second stage step

  # Coefficients of the outcome regression
  coef(iqSS)

  # Description of method used to obtain object
  DTRstep(iqSS)

  # Value object returned by outcome regression method
  fitObject(iqSS)

  # Contrast component of outcome regression
  fittedCont(iqSS)

  # Main effects component of outcome regression
  fittedMain(iqSS)

  # Value object returned by outcome regression method
  outcome(iqSS)

  # Plots if defined by outcome regression method
  dev.new()
  par(mfrow = c(2,4))
  plot(iqSS)
  plot(iqSS, suppress = TRUE)

  # Show main results of method
  show(iqSS)

  # Show summary results of method
  summary(iqSS)

# }

Run the code above in your browser using DataLab