Skip to main content
Module

x/simplestatistic/src/r_squared.js>default

simple statistics for node & browser javascript
function default
import { default } from "https://deno.land/x/simplestatistic@v7.7.1/src/r_squared.js";

The R Squared value of data compared with a function f is the sum of the squared differences between the prediction and the actual value.

Examples

var samples = [[0, 0], [1, 1]]; var regressionLine = linearRegressionLine(linearRegression(samples)); rSquared(samples, regressionLine); // = 1 this line is a perfect fit

Parameters

x

input data: this should be doubly-nested

func

function called on [i][0] values within the dataset