Coefficients of the CATE estimated with boosting, naive Poisson, two regression, contrast regression, negative binomial
Usage
intxcount(
y,
trt,
x.cate,
x.ps,
time,
score.method = c("boosting", "poisson", "twoReg", "contrastReg", "negBin"),
ps.method = "glm",
minPS = 0.01,
maxPS = 0.99,
initial.predictor.method = "boosting",
xvar.smooth = NULL,
tree.depth = 2,
n.trees.boosting = 200,
B = 3,
Kfold = 6,
plot.gbmperf = FALSE,
error.maxNR = 0.001,
max.iterNR = 150,
tune = c(0.5, 2),
contrast.control = list(),
ps.control = list(),
x.init = x.cate,
x.benefit = x.cate,
initial.methods = NULL,
...
)Arguments
- y
Observed outcome; vector of size
n(observations)- trt
Treatment received; vector of size
nunits with treatment coded as 0/1- x.cate
Matrix of
p.catebaseline covariates; dimensionnbyp.cate(covariates in the outcome model)- x.ps
Matrix of
p.psbaseline covariates (plus a leading column of 1 for the intercept); dimensionnbyp.ps + 1(covariates in the treatment model plus intercept)- time
Log-transformed person-years of follow-up; vector of size
n- 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.- 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.modelhas 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 number above which estimated propensity scores should be trimmed; scalar
- initial.predictor.method
A character vector for the method used to get initial outcome predictions conditional on the covariates in
x.initinscore.method = 'twoReg'and'contrastReg'. Allowed values include one of'poisson'(fastest),'boosting'(default) and'gam'.- xvar.smooth
A vector of characters indicating the name of the variables used as the smooth terms if
initial.predictor.method = 'gam'. The variables must be selected from the variables listed inx.init. Default isNULL, which uses all variables inx.init.- 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.boosting
A positive integer specifying the maximum number of trees in boosting (usually 100-1000). Used only if
score.method = 'boosting'or ifscore.method = 'twoReg'or'contrastReg'andinitial.predictor.method = 'boosting'. Default is200.- 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 isFALSE.- 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).- contrast.control
A named list of options for count or survival contrast regression. Supported names are
solver("C", the default, or"R"),error.maxNR,max.iterNR,tune, andoptim.control(a named list passed tostats::optimon fallback). List entries override the corresponding top-level NR arguments. Options are kept separate from..., which is forwarded to boosting. Count and survival outcomes support this list; continuous outcomes retain their existing solver.- ps.control
Named options for LASSO propensity-score interaction screening. Supported entry:
solver = "C"(default) orsolver = "R". Only affects screening whenps.method = "lasso"; the LASSO fit and interaction selection rule are unchanged. Kept separate from boosting's...and other numerical controls.- x.init
Initial outcome-model covariate matrix; defaults to
x.cate.- x.benefit
Benefit-score covariate matrix; defaults to
x.cate.- initial.methods
Named initial outcome methods for the doubly robust scores;
NULLusesinitial.predictor.methodfor both.- ...
Additional boosting arguments; see
boosting-control.
Value
Depending on what score.method is, the outputs is a combination of the following:
result.boosting: Results of boosting fit and best iteration, for trt = 0 and trt = 1 separately
result.poisson: Naive Poisson estimator (beta1 - beta0); vector of length p.cate + 1
result.twoReg: Two regression estimator (beta1 - beta0); vector of length p.cate + 1
result.contrastReg: A list of the contrast regression results with 3 elements:
$delta.contrastReg: Contrast regression DR estimator; vector of length p.cate + 1
$sigma.contrastReg: Variance covariance matrix for delta.contrastReg; matrix of size p.cate + 1 by p.cate + 1
$converge.contrastReg: Indicator that the Newton Raphson algorithm converged for delta_0; boolean
result.negBin: Negative binomial estimator (beta1 - beta0); vector of length p.cate + 1
best.iter: Largest best iterations for boosting (if used)
fgam: Formula applied in GAM (if used)

