PredictionTest {REEMtree}R Documentation

Tests which vector of predictions is closer to the true values

Description

This function uses two vectors of predictions and one vector of true values to determine which predictor is best in terms of squared errors. To do this, it finds the squared errors at each point and uses a Wilcoxon rank test to test which has smaller squared errors (and therefore is a better predictor).

Usage

PredictionTest(pred1, pred2, truth, subsetVec = rep(TRUE, length(pred1)))

Arguments

pred1 First vector of predictions
pred2 Second vector of predictions
truth True values of the variable being predicted
subsetVec an optional logical vector indicating the subset of the elements of the vecor that should be used in the fit. All elements are included by default.

Value

the results of the wilcox.test

Author(s)

Rebecca Sela rsela@stern.nyu.edu

References

Sela, Rebecca J., and Simonoff, Jeffrey S., “RE-EM Trees: A New Data Mining Approach for Longitudinal Data”.

See Also

wilcox.test, RMSE

Examples

x <- rnorm(10)
y <- 3*x + rnorm(10)

pred1 <- 3*x
pred2 <- rep(mean(y), 10)
PredictionTest(pred1, pred2, y)

[Package REEMtree version 1.0 Index]