Utility function for determining the optimal values of the number of subpopulations and the corresponding r1 and r2 values for creating subpopulations with the sliding window approach. The optimal values are those that make the subpopulations more balanced by minimizing the variance of the subpopulation sizes.
balance_patients(range.r1, range.r2, maxnsubpops, covar, verbose = FALSE,
plot = FALSE, contour = FALSE, nlevels = 5, showstatus = TRUE)
The balance_patients()
function returns a list with the following items:
length-one numeric vector with overall best value of the r1 parameter
length-one numeric vector with overall best value of the r2 parameter
length-one numeric vector with overall minimum value of the sizes variance
length-one numeric vector with overall best value for the number of subpopulations
numeric matrix with the details of all the calculations
numeric vector with two elements providing the range of values for the r1 parameter
numeric vector with two elements providing the range of values for the r2 parameter
length-one numeric vector providing the maximum number of subpopulations to consider
numeric vector containing the covariate values to use for generating the subpopulations
length-one logical vector; if TRUE
prints a summary of the results in the console
length-one logical vector; if TRUE
produces a diagram showing the results of the calculations
length-one logical vector; if TRUE
adds to the plot the variance contour lines for each
subpopulation number
length-one numeric vector providing the number of contour lines to plot
length-one logical vector; if TRUE
displays a bar showing the progress of the calculations; default is TRUE
Marco Bonetti, Sergio Venturini
Bonetti M, Gelber RD. Patterns of treatment effects in subsets of patients in clinical trials. Biostatistics 2004; 5(3):465-481.
Bonetti M, Zahrieh D, Cole BF, Gelber RD. A small sample study of the STEPP approach to assessing treatment-covariate interactions in survival data. Statistics in Medicine 2009; 28(8):1255-68.
Lazar AA, Cole BF, Bonetti M, Gelber RD. Evaluation of treatment-effect heterogeneity using biomarkers measured on a continuous scale: subpopulation treatment effect pattern plot. Journal of Clinical Oncology, 2010; 28(29): 4539-4544.
stwin
, stsubpop
,
stepp.win
, stepp.subpop
, stepp.KM
if (FALSE) {
data(balance_example, package = "stepp")
ranger2 <- c(950, 1050)
ranger1 <- c(300, 500)
maxnsubpops <- 50
res_bal <- balance_patients(ranger1, ranger2, maxnsubpops, balance_example$covar,
plot = TRUE, verbose = TRUE, contour = TRUE, nlevels = 6)
}
Run the code above in your browser using DataLab