In statistics, a linear regression is an approach to model the relationship between a scalar dependent variable y and one or more explanatory variables denoted x, and the correlation is a statistical measurement that describes the dependence between both variables. .

This tool retrieves for the linear relationship between x and y values (the formula y= ax+b) and the Pearson correlation coefficient (r) that describes the degree that linear dependence.

To use this tool, just include in the form x values and the dependent variables y. Each value for x and y must be separated by a line break, and the same number of values for x and y are required.

Often, non-linear relationships between two variables are linealized by applying to x or y values their logaritm or squares. You may do it when required by checking the corresponding checkboxes.


Values for x

Apply to x values
Log x
x2

Computed x

Values for y

Apply to y values
Log y
y2

Experimental y

Linear Regression
and Correlation

Fill the form with your x and y values to compute Pearson correlation coefficient (r) and regression line (y=ax+b).

Compute linear correlation and regression curve y=ax+b
Add the experimental y values to compute x values.

example


Values for curve y=ax+b
a = 3.03
b = -0.67
Correlation (r) = 0.999

Example: The number of apples arriving to the restaurant per box and their weight in kilograms were registered. Data is shown in the form above.

We want to estimate the kilograms of apples per box when a new box arrives to the restaurant.

We have computed the linear regresión between both parameters and we have obtained the value a=3.03 and b=-0.67 to be used in the formula y=ax+b.

When a box with 105 apples arrives to the restaurant, by applying the formula the number of kilos in the box is easily estimated:

105= 3.03 *x + -0.67 => x = 35 kilos

As correlation coefficient is good (r = 0.999), the number of kilos computed will be a good estimation.


Adapted from original version available at biophp.org