Linear regression#
Use Linear when the points are reasonably described by a straight line over the range you intend to analyse. GraphX displays the model as
where is the gradient (slope) and is the Y-intercept. The relationship is evaluated in the original calibrated graph coordinates, regardless of whether the source image used linear or logarithmic axes.
When it represents the data#
A linear model changes by a constant amount in Y for each unit change in X. It is often a useful first model when a scatter of points follows an approximately straight trend and there is no clear curvature. Inspect the plotted points as well as the equation: a straight line can be numerically calculable even when a curved or piecewise relationship is more appropriate.
Fitting#
With Fix Y-intercept off, GraphX uses ordinary least squares. For observed points , it chooses and to minimise the sum of squared vertical residuals:
This is the usual line-of-best-fit criterion: points farther vertically from the line contribute more strongly than points close to it. The calculation requires at least two points with non-identical X values. If every selected X value is identical, a unique slope cannot be calculated.
Fix Y-intercept#
Select Fix Y-intercept when the fitted line must pass through a known value at . Enter that value in the adjacent input. GraphX then fits only the slope, using constrained least squares:
The intercept is part of the fit constraint; GraphX does not fit an unconstrained line and overwrite its displayed constant afterwards. This can be useful where an intercept is independently known, but it can worsen agreement with the measured points when the constraint is not justified. The result identifies the method as Constrained least squares and states the fixed intercept.
The fixed-intercept slope is not identifiable if the selected X values provide no non-zero X variation for this calculation. GraphX reports that condition rather than producing a misleading line.
Fit and display ranges#
The Fit range determines the points used to calculate and . The Display range determines where the already-fitted line is drawn. Changing only the display range does not change the coefficients, fitted-point count, or R². See Fit and display ranges for examples and extrapolation behaviour.
Assessing the result#
Read the equation with the Points fitted and Fitted data X range values. A line based on only a small subset of the dataset can be valid, but it should not be mistaken for a fit to every visible point. Use Understanding R² to interpret the reported R², and inspect the graph for systematic departures from a straight line.

