Description Usage Arguments Value Author(s) Examples
this function calculates prediction performance statistics between vectors of predicted and observed values, namely coefficient of determination (Rsq), root mean squared error (RMSE), mean error (ME), mean absolute error (MAE).
1 | regressionStats(prd, obs, adj.rsq = TRUE, method = "pearson")
|
prd |
numeric vector of predicted values |
obs |
numeric vector of observed values |
adj.rsq |
logical, whether to return adjusted r-squared. Defaults to TRUE |
method |
character. Method to use for correlation. See |
a data frame.
Tim Appelhans, Hanna Meyer
1 2 3 4 5 6 7 | ## create predictions with high accuracy (identical mean),
## but low precision (sd double that of observations). Hence,
## ME should be close to zero and RMSE close to ten.
pred_vals <- sort(rnorm(1000, 200, 20)) # sorting ensures high Rsq
obs_vals <- sort(rnorm(1000, 200, 10))
result <- regressionStats(pred_vals, obs_vals, adj.rsq = FALSE)
result
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.