Learn R Programming

stremr (version 0.4)

set_all_stremr_options: Setting stremr Options

Description

Options that control stremr package. Will reset all unspecified options (omitted arguments) to their default values. The preferred way to set options for stremr is to use stremrOptions, which allows specifying individual options without having to reset all other options. To reset all options to their defaults simply run set_all_stremr_options() without any parameters/arguments.

Usage

set_all_stremr_options(fit.package = c("speedglm", "glm", "h2o"), fit.algorithm = c("glm", "gbm", "randomForest", "deeplearning", "SuperLearner"), bin.method = c("equal.mass", "equal.len", "dhist"), nbins = 10, maxncats = 20, maxNperBin = 500, lower_bound_zero_Q = TRUE, skip_update_zero_Q = TRUE)

Arguments

fit.package
Specify the default package for performing model fitting: c("speedglm", "glm", "h2o")
fit.algorithm
Specify the default fitting algorithm: c("glm", "gbm", "randomForest", "deeplearning", "SuperLearner")
bin.method
The method for choosing bins when discretizing and fitting the conditional continuous summary exposure variable sA. The default method is "equal.len", which partitions the range of sA into equal length nbins intervals. Method "equal.mass" results in a data-adaptive selection of the bins based on equal mass (equal number of observations), i.e., each bin is defined so that it contains an approximately the same number of observations across all bins. The maximum number of observations in each bin is controlled by parameter maxNperBin. Method "dhist" uses a mix of the above two approaches, see Denby and Mallows "Variations on the Histogram" (2009) for more detail.
nbins
Set the default number of bins when discretizing a continous outcome variable under setting bin.method = "equal.len". If left as NA the total number of equal intervals (bins) is determined by the nearest integer of nobs/maxNperBin, where nobs is the total number of observations in the input data.
maxncats
Max number of unique categories a categorical variable sA[j] can have. If sA[j] has more it is automatically considered continuous.
maxNperBin
Max number of observations per 1 bin for a continuous outcome (applies directly when bin.method="equal.mass" and indirectly when bin.method="equal.len", but nbins = NA).
lower_bound_zero_Q
Set to TRUE to bound the observation-specific Qs during the TMLE update step away from zero (with minimum value set at 10^-4). Can help numerically stabilize the TMLE intercept estimates in some small-sample cases. Has no effect when TMLE = FALSE.
skip_update_zero_Q
Set to FALSE to perform TMLE update with glm even when all of the Q's are zero. When set to TRUE the TMLE update step is skipped if the predicted Q's are either all 0 or near 0, with TMLE intercept being set to 0.

Value

Invisibly returns a list with old option settings.

See Also

stremrOptions, print_stremr_opts