Linear Regression (Slope + Intercept)
y = mx + b via least squares. Returns m, b, r², SE.
Result
y = mx + b
y = 0.6000x + 2.2000
r² = 0.6000 · SE(slope) = 0.2828.
- n5
- Slope (m)0.600000
- Intercept (b)2.200000
- r (correlation)0.774597
- r² (var explained)0.600000
- SE of slope0.282843
- SSE (residuals)2.4000
Step-by-step
- Slope m = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)² = 0.6000.
- Intercept b = ȳ − m × x̄ = 2.2000.
- r² = 0.6000 (% variance explained).
How to use this calculator
- Enter paired x, y values.
About this calculator
Linear regression via least squares: minimizes sum of squared residuals. Slope m = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)². r² = % variance in y explained by x. SE of slope used to test if slope is significantly non-zero (slope/SE = t-statistic). Foundation of predictive modeling. Source: Wolfram MathWorld - Least Squares Fitting.
Frequently asked
Fraction of y's variation explained by linear fit with x. r²=1: perfect. r²=0: no linear relationship.
Related calculators
Pearson Correlation Coefficient
r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √(Σ(xᵢ−x̄)² Σ(yᵢ−ȳ)²). Linear correlation [−1, 1].
Two-Sample t-Test (Welch's)
Test whether two means differ. t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂).
One-Sample z-Test
z = (x̄ − μ) / (σ/√n). Compare sample mean to known population.
P-Value Calculator (z to p)
Convert a z-score to one-tail or two-tail p-value via the standard normal CDF.
Confidence Interval Calculator
CI = mean ± z × (σ/√n). 90 / 95 / 99 % standard intervals.
Normal Distribution Calculator (PDF + CDF)
Compute probability density and cumulative probability at x for given μ, σ.