estimateTreatment: Estimate Treatment Mechanisms

Description Usage Arguments Value

View source: R/treatment_estimate.R

Description

This function computes the conditional probability of having trt for each specified level either using glm or SuperLearner. Currently only two unique values of treatment are acceptable. By default the function will compute estimates of the conditional probability of trt == max(trt) and compute the probability of trt == min(trt) as one minus this probability.

Usage

1
2
estimateTreatment(dat, adjustVars, glm.trt = NULL, SL.trt = NULL,
  returnModels = FALSE, verbose = FALSE, gtol = 0.001, ...)

Arguments

dat

An object of class data.frame. Must have named column trt.

adjustVars

An object of class data.frame that will be used either as the data argument in a call to glm or as the X object in a call to SuperLearner.

glm.trt

A character formula for the right-hand side of formula in a call to glm. See ?survtmle for more documentation. Alternatively, this could be an object of class glm (as in calls to this function via timepoints), in which case predictions are obtained using this object with no new fitting.

SL.trt

A valid specification of the SL.library option of a call to SuperLearner. See ?survtmle for more documentation. Alternatively, this could be an object of class SuperLearner (as in calls to this function via timepoints), in which case predictions are obtained using this object with no new fitting.

returnModels

A boolean indicating whether fitted model objects should be returned.

verbose

A boolean passed to the verbose option of the call to SuperLearner.

gtol

The truncation level of predicted trt probabilities to handle positivity violations.

...

Other arguments. Not currently used

Value

dat The input data.frame object with two added columns corresponding with the conditional probability (given adjustVars) of trt==max(trt) and trt==min(trt).

trtMod If returnModels = TRUE, the fitted glm or SuperLearner object. Otherwise, NULL


survtmle documentation built on May 2, 2019, 9:44 a.m.