Chapter 11 – Appendix 2: Least squares analysis