r-square
v1.2.0
Published
Calculate r square.
Downloads
5
Readme
R Squared
R-squared (R2) is a statistical measure that represents the proportion of the variance for a dependent variable that's explained by an independent variable or variables in a regression model. Whereas correlation explains the strength of the relationship between an independent and dependent variable, R-squared explains to what extent the variance of one variable explains the variance of the second variable. (https://www.investopedia.com/terms/r/r-squared.asp)
Installing
Using npm:
$ npm i r-square
Usage
const x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const y = [1, 2, 3, 3, 4, 6, 7];
rSquare(x, y); // 0.94921875