Linear Regression (OLS) & Pearson Correlation (r) Calculator

Fit y = mx + b and compute R² from summary covariance or paired coordinates.

Predicted Value Ŷ at Target X
33.5
Regression Slope (m) 2.125
Y-Intercept (b) 3.75
Coefficient of Determination (R²) 72.25 %
Inputs
Mean of independent variable X (x̄).
Mean of dependent variable Y (ȳ).
Standard deviation of X (s_x).
Standard deviation of Y (s_y).
Pearson correlation coefficient r (−1 to +1).
Target X value to predict Ŷ.
Results & Graph
Predicted Value Ŷ at Target X
33.5
Regression Slope (m)
2.125
Y-Intercept (b)
3.75
Coefficient of Determination (R²)
72.25 %

Predicted Value Ŷ at Target X

Graph 1 • Mean X Sensitivity Recalculates the domain equation across 50% to 150% of the primary input while holding other parameters constant.
0 23.8 47.7 50%: 44.125 44.1 50% 75%: 38.813 38.8 75% 100%: 33.5 33.5 100% 125%: 28.188 28.2 125% 150%: 22.875 22.9 150%
Graph 2 • Primary & Supporting Metric Comparison Compares the primary output alongside supporting domain benchmarks.
Predicted Value Ŷ at Target X 33.5 Regression Slope (m) 2.125 Y-Intercept (b) 3.75 Coefficient of Determination (R²) 72.25 %
Graph 3 • Exact Output Table & Units Displays each calculated output in its exact domain unit.
Predicted Value Ŷ at Target X33.5Regression Slope (m)2.125Y-Intercept (b)3.75Coefficient of Determination (R²)72.25 %
Summary: OLS regression line is y = 2.125x + 3.75 with R² = 72.25% variance explained.
Summary: OLS regression line is y = 2.125x + 3.75 with R² = 72.25% variance explained.

Formula & Mathematical Methodology: Linear Regression Mathematical Identity

m = r × (sy / sx)
b = ȳ − m × x̄
R² = r²
m = r × (s_y / s_x); b = ȳ − m × x̄; R² = r²
  • meanX: Mean X (numeric parameter)
  • meanY: Mean Y (numeric parameter)
  • stdX: Std X (numeric parameter)
  • stdY: Std Y (numeric parameter)
  • correlationR: Correlation R (numeric parameter)
  • predictX: Predict X (numeric parameter)

Rounding: All calculations run in double-precision IEEE-754 arithmetic; displayed outputs round to up to 4 decimal places.

Worked Example: Worked Mathematical Verification: Linear Regression

Fit y = mx + b and compute R² from summary covariance or paired coordinates.

  1. Verify the domain constraints of the input parameters.
  2. Apply the governing mathematical identity: m = r × (s_y / s_x); b = ȳ − m × x̄; R² = r².
  3. Cross-check the primary value against the supporting invariants and coordinate graph.
Result: Evaluates Linear Regression via m = r × (s_y / s_x); b = ȳ − m × x̄; R² = r².

Frequently Asked Questions

What mathematical formula does the Linear Regression (OLS) & Pearson Correlation (r) Calculator use?

It directly evaluates m = r × (s_y / s_x); b = ȳ − m × x̄; R² = r² in double-precision floating-point arithmetic and updates all supporting invariants and graphs live.

How can I compare different parameter sets?

Click Compare in the results toolbar to pin up to three parameter combinations side by side.

Can I export the mathematical report or share a link?

Yes. Use the Share Link, Copy Summary, or Markdown/JSON export buttons in the results panel.

Mathematics & Statistics • Regression & Correlation Guide

How to Use the Linear Regression (OLS) & Pearson Correlation (r) Calculator: Practical Guide & Visual Analysis

Calculate Ordinary Least Squares (OLS) slope, y-intercept, Pearson correlation r, and R² coefficient of determination. Includes textbook mathematical notation, step-by-step verification, and three custom SVG visualizations. Whether you are researching linear regression (ols) & pearson correlation (r) calculator, linear regression, linear regression correlation, regression & correlation calculator, this interactive tool helps you calculate Ordinary Least Squares (OLS) slope, y-intercept, Pearson correlation r, and R² coefficient of determination.

Interpreting the 3 Custom Visual Graphs & Key Outputs

As you adjust Mean X, Mean Y, Std X, Std Y, the calculator immediately computes Primary exact or numerical solution, Supporting identities & invariants, 3-Panel mathematical SVG plots and updates all three domain-specific SVG charts in real time. Instead of relying on a single static figure, you can inspect the primary domain diagram, component breakdown, and multi-point trajectory curve to see how changing your inputs shifts the final result. Use the Compare (up to 3 scenarios) button to evaluate side-by-side variations before making a decision.

Real-World Benchmark & Planning Tips (Universal Mathematical & Statistical Standard (ISO 80000-2))

In our benchmark scenario (Worked Mathematical Verification: Linear Regression), Evaluates Linear Regression via m = r × (s_y / s_x); b = ȳ − m × x̄; R² = r². Keep in mind that uses standard Euclidean geometry, real/complex algebra, and NIST statistical definitions. For related calculations in Mathematics & Statistics, explore Scientific Calculator, Statistics & Standard Deviation Calculator, Geometry Calculator (Right Triangle, Circle & Cylinder).