Squared coefficient of correlation (R2)

rsq(x, y)

Arguments

x

variable x

y

variable y

Value

Squared coefficient of correlation (R2) or coefficient of determination.

Examples

rsq(runif(10), runif(10))
#> [1] 0.07033953