
Last chance! 50% off unlimited learning
Sale ends in
bootstrapValidation_Bin(fraction = 1,
loops = 200,
model.formula,
Outcome,
data,
type = c("LM", "LOGIT", "COX"),
plots = TRUE)
formula
with the formula to be useddata
that stores the variable to be predicted by the modelTRUE
, density distribution plots are displayedroc
containing the AUC in the bootstrap blind test setroc
containing the AUC using the mean of the bootstrapped coefficientslm
, glm
, or coxph
containing a model whose coefficients are the median of the coefficients of the bootstrapped modelslm
, glm
, or coxph
containing a model whose coefficients are the IDI-weighted mean of the coefficients of the bootstrapped modelsmboot.model
modelmboot.model
modelmboot.model
modelplots
is set to TRUE.
The plot shows the train and blind test ROC.
The density distribution of the train accuracy, sensitivity, and specificity are also shown, with the blind test results drawn along the y-axis.bootstrapValidation_Res,
plot.bootstrapValidation_Bin,
summary.bootstrapValidation_Bin
# Start the graphics device driver to save all plots in a pdf format
pdf(file = "Example.pdf")
# Get the stage C prostate cancer data from the rpart package
library(rpart)
data(stagec)
# Split the stages into several columns
dataCancer <- cbind(stagec[,c(1:3,5:6)],
gleason4 = 1*(stagec[,7] == 4),
gleason5 = 1*(stagec[,7] == 5),
gleason6 = 1*(stagec[,7] == 6),
gleason7 = 1*(stagec[,7] == 7),
gleason8 = 1*(stagec[,7] == 8),
gleason910 = 1*(stagec[,7] >= 9),
eet = 1*(stagec[,4] == 2),
diploid = 1*(stagec[,8] == "diploid"),
tetraploid = 1*(stagec[,8] == "tetraploid"),
notAneuploid = 1-1*(stagec[,8] == "aneuploid"))
# Remove the incomplete cases
dataCancer <- dataCancer[complete.cases(dataCancer),]
# Load a pre-stablished data frame with the names and descriptions of all variables
data(cancerVarNames)
# Get a Cox proportional hazards model using:
# - 10 bootstrap loops
# - Age as a covariate
# - zIDI as the feature inclusion criterion
cancerModel <- ForwardSelection.Model.Bin(loops = 10,
covariates = "1 + age",
Outcome = "pgstat",
variableList = cancerVarNames,
data = dataCancer,
type = "COX",
timeOutcome = "pgtime",
selectionType = "zIDI")
# Validate the previous model:
# - Using 50 bootstrap loops
bootCancerModel <- bootstrapValidation_Bin(loops = 50,
model.formula = cancerModel$formula,
Outcome = "pgstat",
data = dataCancer,
type = "COX")
# Shut down the graphics device driver
dev.off()
Run the code above in your browser using DataLab