getR2.Rd
Calculates an R-squared value. Vectors for observed and predicted values must be the same length. Missing values are allowed. Any observed-predicted pairs with missing values are removed before computations are done.
getR2(obs, pred)
The R-squared value.
Returned R-squared might be negative. This indicates that the prediction is worse than using the mean. This function specifically computes: $$R^2=1-SS_{err}/SS_{y}$$ which is equivalent to $$R^2=1-MSE/Var_{y}$$