# 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)
Run the code above in your browser using DataLab