# NOT RUN {
# This example explains 90% of the variance
response <- matrix(c(rep(0, 100), rep(10, 100)))
predictions <-
matrix(nrow = 200, ncol = 3,
data = c(rep(1, 100), rep(8, 100), rep(1, 100), rep(8, 100),
rep(1, 100), rep(8, 100)))
compute.r2(response, predictions)
# }
Run the code above in your browser using DataLab