Regression & Correlation Calculator

Fit linear and transformed models from your dataset. See r, R², p-values, and charts instantly. Download results, validate inputs, and learn each step clearly.

Calculator
Enter paired data and choose options

Log/power need x>0; exp/power need y>0.
Used for confidence intervals in transformed regression.
Comma, space, or semicolon separated.
Useful when theory requires zero intercept.
Displays ŷ and residuals for each row.
First two columns are treated as x and y.
Lines starting with # are ignored.
Reset page
Example dataset

Try this sample (x,y) table

#xy
Use “Load Example” to copy these pairs into the calculator.
Formula used

Core equations

  • Pearson correlation: r = cov(x,y) / (sx sy)
  • Linear regression (with intercept): b = Sxy/Sxx, a = ȳ − b x̄
  • Through origin: b = Σ(xy) / Σ(x²), a = 0
  • R²: R² = 1 − SSE/SST, where SSE=Σ(y−ŷ)², SST=Σ(y−ȳ)²
  • Model transforms: log: y=a+b ln(x), exp: ln(y)=a+bx, power: ln(y)=a+b ln(x)
  • Inference (transformed): SE(b)=s/√Sxx, t=b/SE(b), CI uses Student‑t critical value.
  • Spearman rho: Pearson correlation computed on ranks (ties use average ranks).
How to use

Steps

  1. Paste your paired data as two columns (x,y), one row per line.
  2. Or upload a CSV file where the first two columns are x and y.
  3. Select a regression model that matches your data behavior.
  4. Optionally force the fit through the origin if required.
  5. Click compute to view r, rho, R², and parameter tests.
  6. Use download buttons to export CSV or PDF reports.
FAQs

Common questions

1) What does correlation measure?

Correlation measures the strength and direction of association between variables. Pearson targets linear patterns, while Spearman targets monotonic patterns using ranked data.

2) Does high correlation mean causation?

No. Correlation and good fit can occur due to confounders, coincidence, or selection effects. Use domain knowledge, experimental design, and diagnostics before claiming causality.

3) Which regression model should I pick?

Start with linear. If growth is multiplicative, try exponential. If proportional scaling fits, try power. If change slows with larger x, try logarithmic. Compare residuals and R².

4) Why do some models reject my data?

Log and power models need positive x values. Exponential and power models need positive y values. These constraints come from using logarithms in the model transformation.

5) What is R² telling me?

R² is the fraction of variance in y explained by the fitted curve, computed on original y values. Higher values mean a tighter fit, but do not guarantee a correct model.

6) How are p-values computed here?

The slope test uses a Student‑t statistic computed in the model’s transformed regression space. This aligns with least‑squares estimation for the chosen transformation and helps assess trend significance.

7) How do outliers affect results?

Outliers can strongly change Pearson r and least‑squares slopes. Consider plotting residuals, trying Spearman rho, using robust methods, or validating measurements before final conclusions.

8) Can I export my full dataset?

Yes. The CSV export includes x, y, fitted ŷ, and residuals for every row. The PDF export includes the summary and the first rows for quick sharing.

Related Calculators

regression line equation calculatormultiple linear regression calculatorleast squares regression calculatorregression prediction interval calculatorregression residual calculatorlinear regression coefficient calculatorlinear regression prediction calculatorregression confidence interval calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.