{
  "schemaVersion": 1,
  "kind": "Fixed calculator reference example",
  "id": "linear-regression",
  "name": "Linear regression & correlation",
  "canonicalUrl": "https://count.ie/statistics/linear-regression/",
  "referenceUrl": "https://count.ie/calculator-reference/linear-regression.json",
  "audienceLocale": "en-IE",
  "siteFocus": "Ireland",
  "question": "What straight-line prediction follows from my paired x and y observations?",
  "answerSummary": "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.",
  "method": "Ordinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.",
  "methodology": "Ordinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.",
  "calculationSteps": {
    "explanation": "Ordinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.",
    "coverage": "published-catalogue-method",
    "steps": [
      {
        "step": "Published calculation method",
        "formula": "Ordinary least squares: slope = covariance sum / x deviation sum; intercept = mean y − slope × mean x; R² = squared Pearson correlation.",
        "scope": "Use the stated input units, supported modes and limitations below."
      }
    ],
    "limitations": "Editable inputs are planning assumptions; check the method and result notes for scope.",
    "authority": "Explanation of the implemented calculator, not independent professional review, enactment verification or a promise of AI citation."
  },
  "relatedCalculators": [
    {
      "id": "independent-event-probability",
      "name": "Independent event probabilities",
      "url": "https://count.ie/statistics/independent-event-probability/",
      "purpose": "Explore another calculator in the same topic."
    },
    {
      "id": "known-sd-confidence-interval",
      "name": "Mean confidence interval, known SD",
      "url": "https://count.ie/statistics/known-sd-confidence-interval/",
      "purpose": "Explore another calculator in the same topic."
    },
    {
      "id": "statistics",
      "name": "Mean, median & variation",
      "url": "https://count.ie/statistics/mean-median-variance/",
      "purpose": "Explore another calculator in the same topic."
    },
    {
      "id": "survey-sample-size",
      "name": "Survey response sample size",
      "url": "https://count.ie/statistics/survey-sample-size/",
      "purpose": "Explore another calculator in the same topic."
    }
  ],
  "relatedControls": [],
  "assumptionsAndLimitations": "Editable inputs are planning assumptions; check the method and result notes for scope.",
  "interpretation": "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.",
  "example": {
    "kind": "Illustrative, not personalised",
    "values": {
      "xValues": "1, 2, 3, 4, 5",
      "yValues": "3, 5, 7, 9, 11",
      "predictX": 6
    },
    "inputs": [
      {
        "label": "Paired x values",
        "value": "1;  2;  3;  4;  5"
      },
      {
        "label": "Paired y values",
        "value": "3;  5;  7;  9;  11"
      },
      {
        "label": "X value to predict",
        "value": "6"
      }
    ],
    "outputs": [
      {
        "key": "predictedY",
        "label": "Predicted Y",
        "value": 13,
        "displayValue": "13"
      },
      {
        "key": "rSquared",
        "label": "R Squared",
        "value": 1,
        "displayValue": "1"
      }
    ],
    "displayValuesMayBeRounded": true,
    "scopeNote": "Only this fixed case is described. Other modes, dates and eligibility choices can give different results. Values include all public model settings, including dormant options; inputs list the active settings. Use the full input list, method and limitations together."
  },
  "provenance": {
    "publisher": "Count.ie",
    "publisherUrl": "https://count.ie/about/#publisher-profile",
    "pageUpdatedOn": "2026-10-16",
    "sourceCheckedOn": null,
    "reviewScope": "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.",
    "sourceBasis": "Uses the stated formula and the assumptions you enter. No external source review is claimed.",
    "authorityNote": "Count.ie publishes the calculated example. The linked official sources, where present, remain authoritative for the underlying rules. No official endorsement or professional review is implied."
  },
  "sources": [],
  "frequentlyAskedQuestions": [
    {
      "question": "What happens if I increase x value to predict in this example?",
      "answer": "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."
    },
    {
      "question": "What assumptions should I check for Linear regression & correlation?",
      "answer": "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."
    },
    {
      "answer": "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.",
      "question": "Can I predict a result for an X value far outside my data range?"
    },
    {
      "answer": "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.",
      "question": "Does a high R² score mean my variables have a causal relationship?"
    },
    {
      "answer": "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.",
      "question": "What if my data points form a curve instead of a line?"
    }
  ],
  "citation": {
    "publisher": "Count.ie",
    "title": "Linear regression & correlation: fixed worked example",
    "url": "https://count.ie/statistics/linear-regression/#worked-example",
    "pageUpdatedOn": "2026-10-16",
    "text": "Count.ie. Linear regression & correlation: fixed worked example. Page updated 2026-10-16. https://count.ie/statistics/linear-regression/#worked-example"
  },
  "relatedGuideUrl": "https://count.ie/statistics/linear-regression/#calculator-reference",
  "privacyNote": "Generated at build time from public example settings. No visitor inputs, saved profiles or chat messages are included. Query parameters do not recalculate this file."
}
