Check arguments Catered to all types of outcome Apply at the beginning of pmcount()
, cvcount()
, drcount.inference()
, catefitsurv()
, catecvsurv()
, and drsurv.inference()
Source: R/utility.R
arg.checks.Rd
Check arguments
Catered to all types of outcome
Apply at the beginning of pmcount()
, cvcount()
, drcount.inference()
, catefitsurv()
, catecvsurv()
, and drsurv.inference()
Usage
arg.checks(
fun,
response,
data,
followup.time = NULL,
tau0 = NULL,
surv.min = NULL,
ipcw.method = NULL,
ps.method,
minPS,
maxPS,
higher.y = NULL,
score.method = NULL,
abc = NULL,
prop.cutoff = NULL,
prop.multi = NULL,
train.prop = NULL,
cv.n = NULL,
error.max = NULL,
max.iter = NULL,
initial.predictor.method = NULL,
tree.depth = NULL,
n.trees.rf = NULL,
n.trees.boosting = NULL,
B = NULL,
Kfold = NULL,
plot.gbmperf = NULL,
error.maxNR = NULL,
max.iterNR = NULL,
tune = NULL,
n.boot = NULL,
plot.boot = NULL,
interactions = NULL
)
Arguments
- fun
A function for which argument check is needed; "catefit" for
catefitcount()
andcatefitsurv()
, "crossv" forcatecvcount()
andcatecvsurv()
, and "drinf" fordrcount.inference()
anddrsurv.inference()
. No default.- response
The type of response. Always 'survival' for this function.
- data
A data frame containing the variables in the outcome and propensity score models; a data frame with
n
rows (1 row per observation).- followup.time
Follow-up time, interpreted as the potential censoring time. If the potential censoring time is known, followup.time is the name of a corresponding column in the data. Otherwise, set
followup.time == NULL
.- tau0
The truncation time for defining restricted mean time lost.
- surv.min
Lower truncation limit for probability of being censored (positive and very close to 0).
- ipcw.method
The censoring model. Allowed values are:
'breslow'
(Cox regression with Breslow estimator of the baseline survivor function),'aft (exponential)'
,'aft (weibull)'
,'aft (lognormal)'
or'aft (loglogistic)'
. Default is'breslow'
.- ps.method
A character value for the method to estimate the propensity score. Allowed values include one of:
'glm'
for logistic regression with main effects only (default), or'lasso'
for a logistic regression with main effects and LASSO penalization on two-way interactions (added to the model if interactions are not specified inps.model
). Relevant only whenps.model
has more than one variable.- minPS
A numerical value (in `[0, 1]`) below which estimated propensity scores should be truncated. Default is
0.01
.- maxPS
A numerical value (in `(0, 1]`) above which estimated propensity scores should be truncated. Must be strictly greater than
minPS
. Default is0.99
.- higher.y
A logical value indicating whether higher (
TRUE
) or lower (FALSE
) values of the outcome are more desirable. Default isTRUE
.- score.method
A vector of one or multiple methods to estimate the CATE score. Allowed values are:
'boosting'
,'poisson'
,'twoReg'
,'contrastReg'
,'negBin'
. Default specifies all 5 methods.- abc
A logical value indicating whether the area between curves (ABC) should be calculated at each cross-validation iterations, for each
score.method
. Default isTRUE
.- prop.cutoff
A vector of numerical values (in `(0, 1]`) specifying percentiles of the estimated log CATE scores to define nested subgroups. Each element represents the cutoff to separate observations in nested subgroups (below vs above cutoff). The length of
prop.cutoff
is the number of nested subgroups. An equally-spaced sequence of proportions ending with 1 is recommended. Default isseq(0.5, 1, length = 6)
.- prop.multi
A vector of numerical values (in `[0, 1]`) specifying percentiles of the estimated log CATE scores to define mutually exclusive subgroups. It should start with 0, end with 1, and be of
length(prop.multi) > 2
. Each element represents the cutoff to separate the observations intolength(prop.multi) - 1
mutually exclusive subgroups. Default isc(0, 1/3, 2/3, 1)
.- train.prop
A numerical value (in `(0, 1)`) indicating the proportion of total data used for training. Default is
3/4
.- cv.n
A positive integer value indicating the number of cross-validation iterations. Default is
10
.- error.max
A numerical value > 0 indicating the tolerance (maximum value of error) for the largest standardized absolute difference in the covariate distributions or in the doubly robust estimated rate ratios between the training and validation sets. This is used to define a balanced training-validation splitting. Default is
0.1
.- max.iter
A positive integer value indicating the maximum number of iterations when searching for a balanced training-validation split. Default is
5,000
.- initial.predictor.method
A character vector for the method used to get initial outcome predictions conditional on the covariates in
cate.model
inscore.method = 'twoReg'
and'contrastReg'
. Allowed values include one of'randomForest'
,'boosting'
and'logistic'
(fastest). Default is'randomForest'
.- tree.depth
A positive integer specifying the depth of individual trees in boosting (usually 2-3). Used only if
score.method = 'boosting'
or ifscore.method = 'twoReg'
or'contrastReg'
andinitial.predictor.method = 'boosting'
. Default is2
.- n.trees.rf
A positive integer specifying the maximum number of trees in random forest. Used if
score.method = 'ranfomForest'
or ifinitial.predictor.method = 'randomForest'
withscore.method = 'twoReg'
or'contrastReg'
. Default is1000
.- n.trees.boosting
A positive integer specifying the maximum number of trees in boosting (usually 100-1000). Used if
score.method = 'boosting'
or ifinitial.predictor.method = 'boosting'
withscore.method = 'twoReg'
or'contrastReg'
. Default is150
.- B
A positive integer specifying the number of time cross-fitting is repeated in
score.method = 'twoReg'
and'contrastReg'
. Default is3
.- Kfold
A positive integer specifying the number of folds (parts) used in cross-fitting to partition the data in
score.method = 'twoReg'
and'contrastReg'
. Default is6
.- plot.gbmperf
A logical value indicating whether to plot the performance measures in boosting. Used only if
score.method = 'boosting'
or ifscore.method = 'twoReg'
or'contrastReg'
andinitial.predictor.method = 'boosting'
. Default isTRUE
.- error.maxNR
A numerical value > 0 indicating the minimum value of the mean absolute error in Newton Raphson algorithm. Used only if
score.method = 'contrastReg'
. Default is0.001
.- max.iterNR
A positive integer indicating the maximum number of iterations in the Newton Raphson algorithm. Used only if
score.method = 'contrastReg'
. Default is150
.- tune
A vector of 2 numerical values > 0 specifying tuning parameters for the Newton Raphson algorithm.
tune[1]
is the step size,tune[2]
specifies a quantity to be added to diagonal of the slope matrix to prevent singularity. Used only ifscore.method = 'contrastReg'
. Default isc(0.5, 2)
.- n.boot
A numeric value indicating the number of bootstrap samples used. This is only relevant if
inference = TRUE
. Default is500
.- plot.boot
A logic value indicating whether histograms of the bootstrapped log(rate ratio) should be produced at every
n.boot/10
-th iteration and whether the final histogram should be outputted. Default isFALSE
.- interactions
A logical value indicating whether the outcome model should assume interactions between
x
andtrt
. IfTRUE
, interactions will be assumed only if at least 10 patients received each treatment option. Default isTRUE
.