Routine RLINE fits a line to a set of (x, y) data points using the method of least squares. Draper and Smith (1981, pages 1‑69) discuss the method. The fitted model is
where (stored in B0) is the estimated intercept and (stored in B1) is the estimated slope. In addition to the fit, RLINE produces some summary statistics, including the means, sample variances, correlation, and the error (residual) sum of squares. The estimated standard errors of are computed under the simple linear regression model. The errors in the model are assumed to be uncorrelated and with constant variance.
If the x values are all equal, the model is degenerate. In this case, RLINE sets to zero and to the mean of the y values.
Comments
Informational error
Type
Code
Description
4
1
Each (x, y) point contains NaN (not a number). There are no valid data.
Example
This example fits a line to a set of data discussed by Draper and Smith (1981, Table 1.1, pages 9‑33). The response y is the amount of steam used per month (in pounds), and the independent variable x is the average atmospheric temperature (in degrees Fahrenheit).