Learn R Programming

DynTxRegime (version 3.01)

.newOWLOptim: Optimization Routine - Outcome Weighted Learning.

Description

Optimizes OWL for given lambda and kparam. Method is not exported.

Usage

.newOWLOptim(x, ...)
# S4 method for matrix
.newOWLOptim(x, subset, lambda, txVec, prWgt, response, suppress, kernel, kparam)

Arguments

x
"matrix" of covariates for kernel.
...
Used to pass arguments that are required but the class of which does not determine the method that is selected.
subset
Vector of patients to include in training.
lambda
Tuning parameter.
txVec
Vector of treatments coded as +/-1.
prWgt
Vector of propensity valued according to tx received.
response
Outcome of interest.
suppress
T/F indicating if prints to screen are executed.
kernel
"character" description of kernel to be used.
kparam
"numeric" object, value of parameter in kernel.

Examples

Run this code

data(bmiData)

y <- -(bmiData$month12BMI - bmiData$month4BMI) / bmiData$month4BMI * 100
y <- y - min(y)

regime <- ~ parentBMI + baselineBMI + gender
x <- model.matrix(regime, bmiData)

txVec <- numeric(nrow(bmiData)) - 1L
txVec[bmiData$A2 == "MR"] <- 1L
bmiData$A2 <- as.factor(bmiData$A2)

obj <- DynTxRegime:::.newOWLOptim(x = x,
                                  subset = 1L:nrow(bmiData),
                                  lambda = 0.1,
                                  txVec = txVec,
                                  prWgt = numeric(nrow(bmiData)) + 0.5,
                                  response = y,
                                  suppress = TRUE,
                                  kernel = 'linear',
                                  kparam = NULL)
is(obj)

Run the code above in your browser using DataLab