PredictionTest {REEMtree} | R Documentation |
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).
PredictionTest(pred1, pred2, truth, subsetVec = rep(TRUE, length(pred1)))
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. |
the results of the wilcox.test
Rebecca Sela rsela@stern.nyu.edu
Sela, Rebecca J., and Simonoff, Jeffrey S., “RE-EM Trees: A New Data Mining Approach for Longitudinal Data”.
x <- rnorm(10) y <- 3*x + rnorm(10) pred1 <- 3*x pred2 <- rep(mean(y), 10) PredictionTest(pred1, pred2, y)