A method for merging the results of separate least-squares fits and testing for systematic errors