`validate.subgroup.Rd`

Validates subgroup treatment effects for fitted subgroup identification model class of Chen, et al (2017)

validate.subgroup(model, B = 50L, method = c("training_test_replication", "boot_bias_correction"), train.fraction = 0.75, benefit.score.quantiles = c(0.1666667, 0.3333333, 0.5, 0.6666667, 0.8333333), parallel = FALSE)

model | fitted model object returned by |
---|---|

B | integer. number of bootstrap replications or refitting replications. |

method | validation method. |

train.fraction | fraction (between 0 and 1) of samples to be used for training in
training/test replication. Only used for |

benefit.score.quantiles | a vector of quantiles (between 0 and 1) of the benefit score values for which to return bootstrapped information about the subgroups. ie if one of the quantile values is 0.5, the median value of the benefit scores will be used as a cutoff to determine subgroups and summary statistics will be returned about these subgroups |

parallel | Should the loop over replications be parallelized? If |

An object of class `"subgroup_validated"`

Estimates of average conditional treatment effects when
subgroups are determined based on the provided cutoff value for the benefit score. For example,
if `cutoff = 0`

and there is a treatment and control only, then the treatment is
recommended if the benefit score is greater than 0.

Standard errors of the estimates from `avg.estimates`

Contains the individual results for each replication. `avg.results`

is comprised
of averages of the values from `boot.results`

Estimates of average conditional treatment effects when
subgroups are determined based on different quntile cutoff values for the benefit score. For example,
if `benefit.score.quantiles = 0.75`

and there is a treatment and control only, then the treatment is
recommended if the benefit score is greater than the 75th upper quantile of all benefit scores. If multiple quantile
values are provided, e.g. `benefit.score.quantiles = c(0.15, 0.5, 0.85)`

, then results will be provided
for all quantile levels.

Standard errors corresponding to `avg.quantile.results`

Contains the individual results for each replication. `avg.quantile.results`

is comprised
of averages of the values from `boot.results.quantiles`

Family of the outcome. For example, `"gaussian"`

for continuous outcomes

Method used for subgroup identification model. Weighting or A-learning

The number of treatment levels

All treatment levels other than the reference level

The reference level for the treatment. This should usually be the control group/level

If larger outcomes are preferred for this model

Benefit score cutoff value used for determining subgroups

Method used for validation

Number of replications used in the validation process

Number of observations in `x`

provided to `fit.subgroup`

Number of variables in `x`

provided to `fit.subgroup`

Estimates of various quantities conditional on subgroups and treatment statuses are provided and displayed
via the `print.subgroup_validated`

function:

"Conditional expected outcomes" The first results shown when printing a

`subgroup_validated`

object are estimates of the expected outcomes conditional on the estimated subgroups (i.e. which subgroup is 'recommended' by the model) and conditional on treatment/intervention status. If there are two total treatment options, this results in a 2x2 table of expected conditional outcomes."Treatment effects conditional on subgroups" The second results shown when printing a

`subgroup_validated`

object are estimates of the expected outcomes conditional on the estimated subgroups. If the treatment takes levels \(j \in \{1, \dots, K\}\), a total of \(K\) conditional treatment effects will be shown. For example, of the outcome is continuous, the \(j\)th conditional treatment effect is defined as \(E(Y|Trt = j, Subgroup=j) - E(Y|Trt = j, Subgroup =/= j)\), where \(Subgroup=j\) if treatment \(j\) is recommended, i.e. treatment \(j\) results in the largest/best expected potential outcomes given the fitted model."Overall treatment effect conditional on subgroups " The third quantity displayed shows the overall improvement in outcomes resulting from all treatment recommendations. This is essentially an average over all of the conditional treatment effects weighted by the proportion of the population recommended each respective treatment level.

Chen, S., Tian, L., Cai, T. and Yu, M. (2017), A general statistical framework for subgroup identification and comparative treatment scoring. Biometrics. doi:10.1111/biom.12676

Harrell, F. E., Lee, K. L., and Mark, D. B. (1996). Tutorial in biostatistics multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors. Statistics in medicine, 15, 361-387. doi:10.1002/(SICI)1097-0258(19960229)15:4<361::AID-SIM168>3.0.CO;2-4

`fit.subgroup`

for function which fits subgroup identification models,
`plot.subgroup_validated`

for plotting of validation results, and
`print.subgroup_validated`

for arguments for printing options for `validate.subgroup()`

.

library(personalized) set.seed(123) n.obs <- 500 n.vars <- 20 x <- matrix(rnorm(n.obs * n.vars, sd = 3), n.obs, n.vars) # simulate non-randomized treatment xbetat <- 0.5 + 0.5 * x[,11] - 0.5 * x[,13] trt.prob <- exp(xbetat) / (1 + exp(xbetat)) trt01 <- rbinom(n.obs, 1, prob = trt.prob) trt <- 2 * trt01 - 1 # simulate response delta <- 2 * (0.5 + x[,2] - x[,3] - x[,11] + x[,1] * x[,12]) xbeta <- x[,1] + x[,11] - 2 * x[,12]^2 + x[,13] xbeta <- xbeta + delta * trt # continuous outcomes y <- drop(xbeta) + rnorm(n.obs, sd = 2) # create function for fitting propensity score model prop.func <- function(x, trt) { # fit propensity score model propens.model <- cv.glmnet(y = trt, x = x, family = "binomial") pi.x <- predict(propens.model, s = "lambda.min", newx = x, type = "response")[,1] pi.x } subgrp.model <- fit.subgroup(x = x, y = y, trt = trt01, propensity.func = prop.func, loss = "sq_loss_lasso", nfolds = 5) # option for cv.glmnet x.test <- matrix(rnorm(10 * n.obs * n.vars, sd = 3), 10 * n.obs, n.vars) # simulate non-randomized treatment xbetat.test <- 0.5 + 0.5 * x.test[,11] - 0.5 * x.test[,13] trt.prob.test <- exp(xbetat.test) / (1 + exp(xbetat.test)) trt01.test <- rbinom(10 * n.obs, 1, prob = trt.prob.test) trt.test <- 2 * trt01.test - 1 # simulate response delta.test <- 2 * (0.5 + x.test[,2] - x.test[,3] - x.test[,11] + x.test[,1] * x.test[,12]) xbeta.test <- x.test[,1] + x.test[,11] - 2 * x.test[,12]^2 + x.test[,13] xbeta.test <- xbeta.test + delta.test * trt.test y.test <- drop(xbeta.test) + rnorm(10 * n.obs, sd = 2) valmod <- validate.subgroup(subgrp.model, B = 3, method = "training_test", train.fraction = 0.75) valmod#> family: gaussian #> loss: sq_loss_lasso #> method: weighting #> #> validation method: training_test_replication #> cutpoint: 0 #> replications: 3 #> #> benefit score: f(x), #> Trt recom = 1*I(f(x)>c)+0*I(f(x)<=c) where c is 'cutpoint' #> #> Average Test Set Outcomes: #> Recommended 0 #> Received 0 -14.925 (SE = 13.5505, n = 12.6667) #> Received 1 -18.6798 (SE = 2.02, n = 40) #> Recommended 1 #> Received 0 -19.1219 (SE = 10.6593, n = 41) #> Received 1 -11.4523 (SE = 3.3954, n = 31.3333) #> #> Treatment effects conditional on subgroups: #> Est of E[Y|T=0,Recom=0]-E[Y|T=/=0,Recom=0] #> 3.7548 (SE = 15.5211, n = 52.6667) #> Est of E[Y|T=1,Recom=1]-E[Y|T=/=1,Recom=1] #> 7.6696 (SE = 8.0796, n = 72.3333) #> #> Est of #> E[Y|Trt received = Trt recom] - E[Y|Trt received =/= Trt recom]: #> 5.9962 (SE = 1.3495)#> family: gaussian #> loss: sq_loss_lasso #> method: weighting #> #> validation method: training_test_replication #> cutpoint: Quant_67 #> replications: 3 #> #> benefit score: f(x), #> Trt recom = 1*I(f(x)>c)+0*I(f(x)<=c) where c is 'cutpoint' #> #> Average Test Set Outcomes: #> Recommended 0 Recommended 1 #> Received 0 -12.0424 (SE = 13.3332, n = 26) -31.4333 (SE = 7.6003, n = 27.6667) #> Received 1 -16.8643 (SE = 0.9889, n = 58) -8.8913 (SE = 4.8159, n = 13.3333) #> #> Treatment effects conditional on subgroups: #> Est of E[Y|T=0,Recom=0]-E[Y|T=/=0,Recom=0] #> 4.8219 (SE = 12.7916, n = 84) #> Est of E[Y|T=1,Recom=1]-E[Y|T=/=1,Recom=1] #> 22.5419 (SE = 11.7745, n = 41) #> #> Est of E[Y|Trt received = Trt recom] - E[Y|Trt received =/= Trt recom]: #> 10.5675 (SE = 9.0892) #> #> <===============================================> #> #> family: gaussian #> loss: sq_loss_lasso #> method: weighting #> #> validation method: training_test_replication #> cutpoint: Quant_83 #> replications: 3 #> #> benefit score: f(x), #> Trt recom = 1*I(f(x)>c)+0*I(f(x)<=c) where c is 'cutpoint' #> #> Average Test Set Outcomes: #> Recommended 0 Recommended 1 #> Received 0 -14.0302 (SE = 10.6136, n = 37) -32.4616 (SE = 6.5468, n = 16.6667) #> Received 1 -16.3633 (SE = 0.9549, n = 66) -9.1074 (SE = 15.3114, n = 5.3333) #> #> Treatment effects conditional on subgroups: #> Est of E[Y|T=0,Recom=0]-E[Y|T=/=0,Recom=0] #> 2.3331 (SE = 10.4042, n = 103) #> Est of E[Y|T=1,Recom=1]-E[Y|T=/=1,Recom=1] #> 23.3541 (SE = 11.457, n = 22) #> #> Est of E[Y|Trt received = Trt recom] - E[Y|Trt received =/= Trt recom]: #> 6.3183 (SE = 8.4968)