← All examples

03 / 06 · Linear regression

Teaching example. Synthetic data.

How are sensor readings related to a reference input?

Compare a sensor signal with a known reference input. How does the signal change, and what is the fitted slope?

Open a copy and recalculate A separate copy of the example opens in a new tab. Changes there won’t affect your current project.

Theory: Regression and correlation →

10 levels · XY data

Points show observations; the line represents the fitted model.
Fitted slope
1.989
95% confidence interval
1.934 … 2.044
Inspect the original observations
Reference inputSignal
15.1
26.8
39.3
410.9
513.2
614.7
717.1
818.9
921.2
1022.8

Calculated by the Linza engine from this example’s data. Opening it in the editor runs a fresh calculation.

Why this method

Linear regression describes the mean signal Y at a given X. It estimates a slope and an intercept. Correlation alone supplies neither a calibration equation nor evidence of agreement with a reference. Independent errors and residual checks are needed.

Explore the theory: Regression and correlation →

Work through it in Linza

In Data, inspect the X and Y pairs, then open Analyses. Substitute X = 5 into Y = intercept + slope × X. Compare with the line and inspect deviations of the points. Predictions far beyond the observed X range need separate justification.

Open a copy and recalculate

Try changing one condition

Add 3 to every Y value. Which changes: the slope or the intercept?

Show the explanation

The intercept increases by 3 while the slope stays the same. This illustrates a constant signal offset. A strong linear relationship does not rule out systematic sensor error.

Data and reproducibility

Teaching studies with synthetic data. The scenarios reflect practical questions, but do not report real experimental findings.

Next exampleAt what concentration is the response halfway between the plateaus? →