r2 {mapsRinteractive} | R Documentation |
r2
Description
Calculates the coefficient of determination (r2) for a linear regression model between predicted values and observed values.
Usage
r2(observed, predicted)
Arguments
observed |
Numeric vector of observed values |
predicted |
Numeric vector of predicted values. The length shall be the same as for observed. |
Value
Coefficient of determination (r2) for a linear regression model between predicted values and observed values.
Examples
o<-1:5
p<-c(2,2,4,3,5)
r2(observed=o, predicted=p)
[Package mapsRinteractive version 2.0.1 Index]