MECHOWL QUALITY ANALYSIS AI

Scatter Diagram Maker with Correlation Coefficient and Regression Line (Stratified Plot)

Paste two columns to get a scatter diagram with the correlation coefficient r, r², the test of no correlation and the regression line, by stratum too.

Last updated

Your data is not sent. Everything is computed in your browser

Data

Column names in the first row. Tabs or commas, full-width digits, thousands separators and blanks are read.

Read 40 rows and 3 columns.

What each column means

Guessed from the column names. Choose again if a guess is wrong.

The numbers on the horizontal axis, such as a condition or a setting.

The numbers on the vertical axis, such as a quality characteristic.

Line, part, machine, period … Select it to look at one value at a time.

More settings (Also fit a line through the origin, Chart title, Period, Stratum)

Empty: Scatter diagram.

e.g. 1–31 Oct 2026. Written on the chart and the report.

Empty: all rows. A value: only the rows with that value.

Judgement rules

The defaults are shown with their sources. You can change them to match your company's or your industry's rules; a change is written on the report.

Used for the test of no correlation and the confidence interval of the slope (1 − significance level).

The default is a common guideline (see —).

Result

r −0.891: Correlated (significance level 5 %)

Result of the sample data

Scatter diagramn = 40 r = −0.891 r² = 0.794 Period: Nov 2026Scatter diagramn = 40 r = −0.891 r² = 0.794 Period: Nov 2026Furnace 1Furnace 2Regression line y = 71.57 − 0.03249x50.052.054.056.058.060.0400450500550600650y: Hardnessx: Tempering temperature

Correlated (significance level 5 %)

Correlation coefficient r = −0.891, p-value < 0.001 (n = 40)

Correlation coefficient r
−0.891
Slope of the regression line b
−0.03249

How to read it

What the chart shows

  • The correlation coefficient is r = −0.891 (negative correlation) and the coefficient of determination r² = 0.794: 79.4 % of the variation of y is explained by the straight-line relation with x.
  • The regression line is y = 71.57 − 0.03249x. When x increases by 1, y changes by −0.03249 on average (95 % confidence interval of the slope: −0.03792 to −0.02706).
  • Correlation coefficient by stratum: Furnace 1 −0.966 (n = 20), Furnace 2 −0.908 (n = 20).

Common misreadings

  • A correlation does not mean that x causes y (another factor may move both).
  • The correlation coefficient measures straight-line relations only; a curved relation gives a small r. Look at the shape of the plot too.
  • Do not use the regression line outside the range of x in the data (402 to 593).

Next steps

  • If x may be a cause, check it by changing the condition (an experiment) and add it to the cause-and-effect diagram.

Numbers

Number of pairs n40
Correlation coefficient r−0.891
Coefficient of determination r²0.794
p-value of the test of no correlation< 0.001
Slope of the regression line b−0.03249
Intercept of the regression line a71.57
Confidence interval of the slope (95 %)−0.03792 to −0.02706
Residual standard deviation sₑ0.933

Calculation steps
  1. Meansx̄ = Σxᵢ / n, ȳ = Σyᵢ / nx̄ = 496.98, ȳ = 55.420
  2. Correlation coefficientr = Sxy / √(Sxx · Syy) (Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ) and so on)r = −0.8913
  3. Test of no correlationt = r√(n − 2) / √(1 − r²); two-sided p-value from the t distribution with n − 2 degrees of freedomt = −12.118, df = 38 → p = < 0.001
  4. Regression lineb = Sxy / Sxx, a = ȳ − b x̄b = −0.03249, a = 71.57
  5. Confidence interval of the slopeb ± t(α/2, n − 2) × sₑ / √Sxx (sₑ = √(residual sum of squares / (n − 2)))−0.03792 to −0.02706
Correlation coefficient by stratum
MachinenCorrelation coefficient r
Furnace 120−0.966
Furnace 220−0.908

The results are reference values based on the data you entered and the formulas and criteria shown. They are not a quality guarantee or a pass/fail decision. The final decision rests with you.

Next tool: Decide the vital few with a Pareto chart

References

  • NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.3.26 Scatter Plot · NIST · Open
  • NIST/SEMATECH e-Handbook of Statistical Methods, 4.1.4.1 Linear Least Squares Regression · NIST · Open
  • JIS Z 8101-2:2015 Statistics — Vocabulary and symbols — Part 2: Applied statistics (in Japanese) · Japanese Standards Association (JSA)

Standards are shown by number and title only.

Scatter diagram explained

A scatter diagram plots pairs of values of two characteristics (for example, tempering temperature and hardness) as points against a horizontal and a vertical axis. The pattern of the points shows whether the two are related (correlated), in which direction and how strongly. The strength is given by the correlation coefficient r (−1 to 1); the closer it is to 0, the weaker the straight-line relation. It is one of the seven basic quality tools.

Scatter diagram by hand: step by step

  1. Collect 30 or more pairs of the two characteristics, each pair from the same part or the same time.
  2. Put the possible cause on the horizontal axis x and the result on the vertical axis y, and plot the points.
  3. Compute the correlation coefficient r = Sxy / √(Sxx·Syy), and check with the test of no correlation whether it could be chance.
  4. If there is a relation, draw the regression line y = a + bx and read how much y changes when x changes.
  5. Stratify by machine, material or operator, and redraw with a different mark for each stratum.

Worked examples

  1. Example 1: Five pairs (no evidence of correlation)

    x	y
    1	2
    2	4
    3	5
    4	4
    5	5

    x̄ = 3, ȳ = 4. Sxx = 10, Syy = 6, Sxy = (−2)(−2) + (−1)(0) + 0·1 + 1·0 + 2·1 = 6. r = 6/√(10 × 6) = 0.7746, r² = 0.60. t = 0.7746 × √3 / √0.4 = 2.1213; the two-sided p with 3 degrees of freedom = 0.124 (above 5 %, so no evidence of correlation). b = 6/10 = 0.6, a = 4 − 0.6 × 3 = 2.2. Residual sum of squares = 6 × (1 − 0.6) = 2.4 → sₑ = √(2.4/3) = 0.8944; standard error of the slope 0.8944/√10 = 0.2828; t(0.025, 3) = 3.1824 → 0.6 ± 0.9001 = −0.3001 to 1.5001.

  2. Example 2: Three pairs (the fewest that can be computed)

    x	y
    1	1
    2	3
    3	2

    x̄ = 2, ȳ = 2. Sxx = 2, Syy = 2, Sxy = (−1)(−1) + 0·1 + 1·0 = 1. r = 1/√4 = 0.5. t = 0.5 × 1 / √0.75 = 0.5774; the two-sided p with 1 degree of freedom = 1 − (2/π)·arctan(0.5774) = 1 − (2/π)(π/6) = 2/3. b = 1/2, a = 2 − 0.5 × 2 = 1.

  3. Example 3: Exactly proportional (r = 1, with the line through the origin)

    x	y
    1	2
    2	4
    3	6
    4	8

    Settings: Also fit a line through the origin = On

    Every point lies on y = 2x. r = 1 and the residuals are 0, so p = 0 (t is infinite) and the confidence interval of the slope is 2 to 2. The line through the origin: b₀ = Σxy/Σx² = 60/30 = 2, with an uncentred R² of 1.

  4. Example 4: All x equal

    x	y
    1	2
    1	3
    1	4

    Sxx = 0, so r = Sxy/√(Sxx·Syy) cannot be computed. The reason is shown and no result is given.

Common mistakes

  • Taking a correlation for a relation of cause and effect.
  • Plotting data of different strata together (each stratum has no relation, yet the whole shows a correlation, or the other way round).
  • Using the regression line beyond the range of the data.

FAQ

What value of r means correlated?
It depends on the number of pairs. This page shows the result of the test of no correlation (significance level 5 % by default). With many pairs even a small r is correlated, so look at the size of r (the coefficient of determination r²) as well.
What is r²?
The square of r: the share of the variation of y that the straight-line relation with x explains.
Is my data sent anywhere?
No. The calculation and the chart are made in your browser only.

Scope

The straight-line relation of two numeric characteristics (Pearson correlation coefficient and the least-squares line).

Not covered by this tool:

  • Curve fitting and multiple regression.
  • Rank correlation (Spearman and others).

Excel template: Scatter diagram

A template with the column names and sample values only (no formulas). Enter your values, then copy the range and paste it into the box above.

Download the template (scatter-template.xlsx)

Related tools

Request a tool (contact page of the official site)

Report

The company name and the other fields are kept on this device only.

Contact

We take enquiries on the contact page of the MechOwl official site. Requests for tools you would like are welcome there too.

To the contact page(opens in a new tab)