Skip to content
Count.ie

Linear regression & correlation Calculator

Page updated Published by Count.ieSources & review

Questions you might ask next

Can I predict a result for an X value far outside my data range?

Predictions made outside the range of your entered observations can be unreliable. The calculator is best used for values within the scope of your existing data set.

Does a high R² score mean my variables have a causal relationship?

No. A strong fit or high correlation value does not establish causation. You must consider if other factors are involved, as simple regression does not account for complex underlying dynamics.

What if my data points form a curve instead of a line?

This tool uses an ordinary least squares method for a straight-line model. If your data shows residual patterns or non-linear trends, a simple straight-line regression may not be the appropriate model for your analysis.

Calculation basis, sources and review

Ordinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.

Publisher
Count.ie, operated by K Imports
Page last updated
— explanatory content and transparency information, not a new rules verification.
Documented source check
No dated source check recorded.
Professional review
No named independent professional review is recorded for this tool.

Any dated method notes below apply only to their stated scope. A formula or user-entered rate is not evidence that statutory rules are current.

Uses the stated formula and the assumptions you enter. No external source review is claimed.

Estimates, not financial, tax, legal or accounting advice. How our dates and checks work. Report a correction.

What straight-line prediction follows from my paired x and y observations?

Fit paired values, report slope and R², and calculate a specified prediction. Regression needs paired observations rather than two unrelated lists. The supported fitted slope, intercept and correlation describe the entered data, while predictions outside its range can be unreliable. A strong fit does not establish causation, and residual patterns or influential observations can make a simple straight-line model inappropriate.

How the calculation works

Linear regression & correlation applies one fixed set of rules to the inputs described below, so the same entries always give the same answer. The exact formula is published once, in the Sources, formula and methodology section further down this page.

Paired x values: Equal-length lists, 2–1,000 finite observations. Paired y values is entered as 3; 5; 7; 9; 11 in the illustration. Keep the unit shown on the field when substituting your own measurement or amount. X value to predict is entered as 6 in the illustration. Keep the unit shown on the field when substituting your own measurement or amount.

Worked example

A fixed illustration uses Paired x values: 1; 2; 3; 4; 5; Paired y values: 3; 5; 7; 9; 11; X value to predict: 6. Predicted Y: 13; R Squared: 1. All remaining illustrated settings are listed in the example-input disclosure below. These are reproducible sample figures, not saved visitor inputs; this text does not change when you edit the interactive form.

Read the numerical result alongside the sampling or independence assumptions in the method. More decimal places do not mean better evidence. Check outliers and the observation period before generalising from the entered data to a wider population.

What moves the answer

Each comparison changes one input of the fixed example and re-runs this calculator’s engine. Other assumptions stay unchanged.

  • Raising x value to predict from 6 to 6.6, with everything else unchanged, predicted y moves from 13 to 14.2.

Frequently asked questions

What happens if I increase x value to predict in this example?

Changing x value to predict from 6 to 6.6, with the other example settings unchanged, changes predicted y from 13 to 14.2. This isolates one input using the form's actual calculation. Compare changes separately rather than attributing a difference to several assumptions at once.

What assumptions should I check for Linear regression & correlation?

Editable inputs are planning assumptions; check the method and result notes for scope. This is a formula-based planning tool, not a feed of live quotations or an independent assessment. Its editable amounts, prices and rates are your assumptions, so check them against the records or specifications relevant to your case.

Quick answer

The Linear regression & correlation model returns predicted y and r squared. Regression needs paired observations rather than two unrelated lists.

Outputs and units: Predicted Y (unitless number); R Squared (unitless number).

Formula, assumptions and sources

Fixed worked example results

Linear regression & correlation example — Paired x values: 1; 2; 3; 4; 5; Paired y values: 3; 5; 7; 9; 11; X value to predict: 6. Predicted Y: 13; R Squared: 1.

Illustration only, not your entered figures. Use the complete example inputs below, selected options and stated limitations when quoting these results.

Calculated results for the fixed worked example
Result Example value
Predicted Y 13
R Squared 1
Exact inputs used in the worked example
Paired x values
1; 2; 3; 4; 5
Paired y values
3; 5; 7; 9; 11
X value to predict
6

Cite this calculation example

Count.ie. Linear regression & correlation: fixed worked example. Page updated 2026-10-16. https://count.ie/statistics/linear-regression/#worked-example

This citation describes the fixed example above, not your entered figures. Include the complete assumptions and relevant year when quoting a result. Official sources remain the authority on the underlying rules.

Link to the worked exampleFixed example, assumptions and sources (JSON)AI discovery index

Sources, formula and methodology

Linear regression & correlation: formulae, calculation steps and their conditions
StepFormula or calculationWhen it applies
Published calculation methodOrdinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.Use the stated input units, supported modes and limitations below.

Assumptions and limits

Editable inputs are planning assumptions; check the method and result notes for scope.

Explanation of the implemented calculator, not independent professional review, enactment verification or a promise of AI citation. See the source links and review scope above.

Need more help?

Read the input reference for linear regression & correlation

Input reference and model comparisons

This documentation is assembled from this calculator’s input definitions and model. The comparisons re-run the same model; they are not independent research or a separate accuracy check. How this documentation is produced.

Detailed input reference
Paired x values
Equal-length lists, 2–1,000 finite observations.
Paired y values
X value to predict
Numeric input; minimum -1000000000000; maximum 1000000000000.
Fixed reference scenario and comparisons

This reference scenario uses the inputs listed below, which may differ from the main worked example. Any comparisons change one input while keeping the others unchanged. They are illustrations, not forecasts, eligibility decisions or recommended settings.

Reference inputs

Paired x values
1, 2, 3, 4, 5
Paired y values
3, 5, 7, 9, 11
X value to predict
6

Reference results

Predicted Y
13
R Squared
1

X value to predict: 6 → 7

Predicted Y
13 → 15
All statistics calculators →