Calcolatrice regressione lineare

Trova la linea di miglior adattamento per i tuoi dati con visualizzazione scatter plot

Format: Enter x,y pairs (one per line)

Example: 1, 2 or 1 2 (comma or space separated)

Risultati

Inserisci i valori e clicca Calcola per vedere il risultato.

Linear Regression

Linear regression finds the best-fitting straight line through a set of data points. The line is defined by the equation y = mx + b, where:

  • Slope (m): The rate of change in y for each unit change in x
  • Intercept (b): The value of y when x = 0
  • R² (R-squared): Coefficient of determination (0 to 1), indicates how well the line fits the data
  • Correlation (r): Measures the strength and direction of the linear relationship (-1 to 1)

The regression line minimizes the sum of squared differences between observed and predicted values (least squares method). An R² value close to 1 indicates a strong linear relationship, while a value close to 0 suggests a weak relationship.

\(y = mx + b, m = \frac{n\sum xy - \sum x \sum y}{n\sum x^2 - (\sum x)^2}, b = \bar{y} - m\bar{x}\)

Worked Examples

Example 1

\(\text{Points: } (1,2), (2,4), (3,5), (4,4), (5,5) \rightarrow y = 0.6x + 2.2, R^2 = 0.64\)

Example 2

\(\text{Study hours vs test scores} \rightarrow \text{Find relationship and predict outcomes}\)
Linear Regression Calculator | MathCalcLab | MathCalcLab