Learn R Programming

lmap (version 0.2.4)

oos.comparison: This function compares the predictive performance of several models fitted on the same data

Description

The number of bootstraps should be the same for each model Ideally, the seed used in bootstrapping should also be the same

Usage

oos.comparison(objectlist, xlabel = "Model")

Value

plot A boxplot with prediction errors for each model

pe A data frame with average prediction error for each bootstrap

fit A matrix with prediction error statistics for each model

Arguments

objectlist

An list with output objects from the bootstrap functions in lmap

xlabel

A character object, specifying the label on the horizontal axis. Default is "Model"

Examples

Run this code
if (FALSE) {
data(dataExample_mru)
y = as.matrix(dataExample_mru[ , 1])
X = as.matrix(dataExample_mru[ , 2:6])
output2 = mrrr(y = y, X = X, S = 2)
b2 = bootstrap.mrrr(output2)
output3 = mrrr(y = y, X = X, S = 3)
b3 = bootstrap.mrrr(output3)
myobjects = list(b2, b3)
comparison = oos.comparison(myobjects)
comparison$plot
comparison$fit
}

Run the code above in your browser using DataLab