R/est_subgroup_effects.R
subgroup.effects.RdComputes treatment effects within various subgroups to estimate subgroup treatment effects
subgroup.effects(
benefit.scores,
y,
trt,
pi.x,
cutpoint = 0,
larger.outcome.better = TRUE,
reference.trt = NULL
)vector of estimated benefit scores
The response vector
treatment vector with each element equal to a 0 or a 1, with 1 indicating treatment status is active.
The propensity score for each observation
numeric value for patients with benefit scores above which
(or below which if larger.outcome.better = FALSE)
will be recommended to be in the treatment group. Can also set cutpoint = "median", which will
use the median value of the benefit scores as the cutpoint or can set specific quantile values via "quantx"
where "x" is a number between 0 and 100 representing the quantile value; e.g. cutpoint = "quant75"
will use the 75th perent upper quantile of the benefit scores as the quantile.
boolean value of whether a larger outcome is better. Set to TRUE
if a larger outcome is better and set to FALSE if a smaller outcome is better. Defaults to TRUE.
index of which treatment is the reference (in the case of multiple treatments).
This should be known already, as for a trt with K-levels, there will be K-1 benefit scores (1 per column)
of benefit.scores, where each column is a comparison of each K-1 treatments with the reference treatment.
The default is the last level of trt if it is a factor.
fit.subgroup for function which fits subgroup identification models which generate
benefit scores.