Linear Correlation and Regression

Values for x:
Values for y:

example
Values for curve y=ax+b
a = 3.03
b = -0.67
Regresion (r) = 0.999
Example: the number of apples per kilograms are counted in plastic boxes in order to get a formula to calculate this parameter when a new box arrives to the restaurant, so that we may decide the number of menus with apples we may offer to our clients.

When a box with 35 kilos arrives, by applying the formula y=ax+b, number of apples in the box may easily calculated:

y= 3.03 *35 + -0.67 = 105 apples

As regresion is good (r = 0.999), the number of apples we have calculated will be a good stimation.


Source code available at biophp.org