# Graphs of the Model I and Model II regressions

Here are the figures for my MATLAB® shell-script routines for fitting a line to the example dataset (data.txt) using the various linear regression models:

Model I Regressions |
M-file | Single line plots | Combined plots |
---|---|---|---|

Y-on-X | Lsqfity.m | ||

X-on-Y | Lsqfitx.m | ||

Weighted Y-on-X | Lsqfityw.m | ||

Weighted Y-on-X | Lsqfityz.m |

Model II Regressions |
M-file | Single line plots | Combined plots |
---|---|---|---|

Major axis | Lsqfitma.m | ||

Geometric mean | Lsqfitgm.m | ||

Least-squares-bisector | Lsqbisec.m | ||

Least-squares-cubic | Lsqcubic.m |

**Footnotes to table:**

- All parameters were calculated with equations from Bevington and Robinson (1992). Their standard deviations for the slope and intercept seem very small when compared to the uncertainties calculated with the other regression equations.
- Revised weighted model I regression: equations for the slope and intercept were again taken from Bevington and Robinson (1992), however, the standard deviations in these parameters are calculated according to equations derived by York (1966). The uncertainties calculated this way seem more in line with those calculated by the other regressions.
- The least-squares-bisector algorithm follows the suggestion of Sprent and Dolby (1980) that in the case of model II regressions, an equally strong case can be made for the line that bisects the minor angle between the two model I regressions: Y-on-X and X-on-Y. The uncertainties in the slope and intercept are calculated according to the equations derived by York (1966) in a manner analogous to that used for the geometric mean regression.

**Also, please note that:**

- The answers in the table have not been rounded-off to the proper number of significant figures. Instead, I have choosen to list the results obtained with Matlab in standard precision mode so that one can compare these results to those from other programs without an undue emphasis on data truncation and round-off errors.
- Equations for the
*Y-on-X*,*X-on-Y*,*major axis*,*geometric mean*and*least-squares-bisector*regressions all run through the centroid: (mean-x,mean-y). - Likewise, the correlation coefficients for the
*Y-on-X*,*X-on-Y*,*major axis*and*geometric mean*regressions are all the same. Thus, the correlation coefficient is properly interpreted as a measure of the linearity of the data and not how well the line fits the data. - For the
*weighted linear regressions*and the*least squares cubic*the correlation coefficients are different owing to the varying weights applied to each data point.

**References:**

- Bevington & Robinson (1992). Data Reduction and Error Analysis for the Physical Sciences, Second Edition, McGraw-Hill, Inc., New York.
- Sprent and Dolby (1980). The geometric mean functional relationship. Biometrics 36: 547-550.
- York (1966). Least-squares fitting of a straight line. Canad. J. Phys. 44: 1079-1086.