Comparison of linear fits to Pearson's data
Pearson's data (K. Pearson, Philosophical Magazine, 2, 559 (1901)) is often used for testing the accuracy of a linear fit. This is a worst-case set of data with errors in both x and y coordinates.
The data is as follows:
| x | dx | y | dy |
|---|---|---|---|
| 0.0 | 0.03 | 5.9 | 1.0 |
| 0.9 | 0.03 | 5.4 | 0.74 |
| 1.8 | 0.044 | 4.4 | 0.5 |
| 2.6 | 0.035 | 4.6 | 0.35 |
| 3.3 | 0.07 | 3.5 | 0.22 |
| 4.4 | 0.11 | 3.7 | 0.22 |
| 5.2 | 0.13 | 2.8 | 0.12 |
| 6.1 | 0.22 | 2.8 | 0.12 |
| 6.5 | 0.74 | 2.4 | 0.1 |
| 7.4 | 1.0 | 1.5 | 0.044 |
When plotted, the data looks like this:
One test of a fitting algorithm is to swap the x and y data and their respective errors. The slope of the two fits should be reciprocal. The Chixy2 value should in theory be exactly the same as the Chiyx2 value.
Below is a comparison of the results of a linear fit of Pearson's data from several sources. As can be seen from the results, Glove gives the correct answer and is the only one that we could find that does so. (FFIT, which comes close, is the precursor of Glove.)
| Program | Bxy | sigmaBxy | Byx | 1/Byx | Chi2xy/(N-2) | Chi2yx/(N-2) | Bxy/(1/Byx) |
| Williamson Paper3 | -0.4805 | 0.05766 | -2.0810 | -0.48054 | 0.999921 | ||
| Glove | -0.47957 | 0.05487 | -2.08519 | -0.47957 | 1.508611 | 1.508611 | 1.000002 |
| Glove Eff.Variance | -0.46239 | 0.05956 | -1.81673 | -0.55044 | 1.427261 | 1.760126 | 0.840032 |
| FFIT Add'l Opt Q | -0.479913 | 0.04315 | -2.082678 | 0.48015 | 1.508765 | 1.508773 | 0.999504 |
| FFIT Eff. Variance | -0.46281 | 0.0574 | -1.81764 | -0.55016 | 1.51966 | 1.684587 | 0.841228 |
| FFIT Linear2 | -0.615241 | 0.029215 | -1.568851 | -0.63741 | 4.397548 | 75.41002 | 0.965221 |
| Origin y-weighted2 | -0.61524 | 0.06126 | -1.56885 | -0.63741 | 0.965219 | ||
| Origin unweighted | -0.53958 | 0.04213 | -1.76713 | -0.56589 | 0.953508 | ||
| Excel Linest fcn1 | -0.53958 | 0.042127 | -1.76713 | -0.56589 | 0.800664 | 2.622196 | 0.953508 |
| Sigmaplot1 | -0.5396 | 0.0421 | -1.7671 | -0.5659 | 0.8007 | 2.6222 | 0.953527 |
| Sigmaplot weight2 | -0.5503 | 0.0454 | -1.6092 | -0.62143 | 0.2156 | 0.3782 | 0.885543 |
| Lin. Reg. www site1 | -0.54 | 0.04 | -1.77 | -0.56 | 0.8 | 2.6 | 0.96 |
| Axum 4.01 | -0.54 | 0.04 | -1.77 | -0.56 | 0.8 | 2.62 | 0.96 |
| Kaleidegraph 3.01 | -0.53958 | 0.042127 | -1.7671 | -0.5659 | 0.10008 | 0.327775 | 0.953492 |
| Kaleidegraph 3.02 | -0.615241 | 0.029215 | -1.56885 | -0.63741 | 4.39755 | 75.41 | 0.965221 |
| Kaleidegraph EV | -0.4624 | 0.05956 | -1.8167 | -0.550449 | 1.427375 | 1.76025 | 0.840042 |
Notes:
1. unweighted
2. y-weighting only
3. J. H. Williamson, Can. J. Phys., 46, 1845 (1968).
![[logo]](/nps/image/logo_small.gif)