How do you plot points and find a line of best fit?
Enter at least two pairs of x and y observations. The calculator draws a scatter plot and fits a straight line by minimizing the squared vertical differences between the data and the line. It shows the fitted slope and intercept and reports R² when the y observations vary.
Pair observations before drawing the chart
Each x and y pair should come from the same observation. If x is the number of hours a machine operated and y is the fuel used, copy both from the same run. Sorting a column on its own can create mismatched pairs and produce a pattern that is absent from the original data.
You may enter up to five pairs and leave additional rows empty. A partially filled row needs its missing coordinate before it can be plotted. The order of correctly paired rows does not affect the fitted line. Repeated x values can appear, as long as there are at least two distinct x values across all rows.
Read the slope and intercept
The slope is the estimated change in y for one additional unit of x. An intercept estimates y when x is zero. If your x values start far from zero, the intercept is an extrapolation and may not describe a real observation. For instance, a line fitted to sales between two and five years of operation may say little about a company’s first day.
In the default data, (0, 2), (1, 4), (2, 5), and (3, 8), the fitted equation is y = 1.9x + 1.9. At x = 2, the predicted y is 5.7, compared with the observed 5. The difference between each observation and its fitted value is a residual.
Understand what R² measures
For an ordinary least-squares line with an intercept, R² describes the fraction of the observed variability in y represented by the line. A value near one indicates a close linear fit to the entered points. It does not establish that changes in x caused changes in y, or that the line predicts accurately outside the observed range.
If all y values are equal, the fitted line is horizontal and passes through every observation. R² is undefined here because there is no variability to divide by. The page labels that case separately. Two observations with distinct x values and unequal y values can produce a perfect fit because a line can pass through both. More observations are needed to assess how stable that pattern is.
Examine unusual observations in context
An unusual point can pull the fitted line, especially when its x value sits far from the other observations. Compare the result with and without a point only if you have a clear reason to examine that scenario. Keep the original record, and do not omit valid entries solely to increase the reported fit.
A curved shape in the scatter plot can make a straight-line estimate misleading even when an upward relationship is visible. Consider whether the observed pattern appears linear before using the fitted equation for an estimate. This tool fits one straight line and does not select another model for the data.
Frequently asked questions
What if every x value is the same?
The observations line up vertically and cannot define a single-valued linear fit of y on x. Use an x variable that actually varies, or describe the vertical pattern instead. This limitation follows from dividing by the variability in x to obtain the regression slope.
Can I put the same observation into the form twice?
Two identical points are treated as two observations, which gives that location more weight in the fit. Enter duplicate rows only if both observations genuinely belong in the dataset. Repeated data can be valid, but accidental duplication changes how much each pair contributes to the calculation.
Does R² indicate whether the slope goes up or down?
The slope’s sign indicates direction. R² is based on how well the line represents the y values and does not preserve the sign of the association. A steep downward fit and an upward fit can both have large R² values.
Why use a scatter plot instead of linking the points in input order?
A scatter plot shows the relationship between the selected coordinates without implying a path from one entry to the next. Connecting points can make sense for a time series with sequential observations. In a scatter plot of unrelated runs or subjects, such a path could imply an order that is not part of the data.
Can I plot an equation directly instead of entering points?
Use the linked Graphing Calculator to enter a formula such as x² or sin(x). That page samples the expression across an axis range. This one starts from measured or chosen observations and estimates an equation from those inputs.