Please enable JavaScript to view this site.

 Nonlinear regression with unequal weights

How Prism implements weighting

Prism 5 and later weight by the Y value of the curve. Prism 4 and earlier weighted by the Y value of the data. The distinction is subtle and rarely matters much, but our simulations show that the results are sometimes more accurate when weights are based on the value of the curve rather than the data.

The situation is a bit tricky. The goal is to adjust the values of the parameters to minimize the weighted sum-of-squares. But the values of the weights depend on the values of those parameters. Here is how Prism resolves this issue:

1.Perform the first iteration without any weights. If the initial parameter values are not very accurate, weighted regression can cause problems on the first iteration. This step was introduced in Prism 5.02 and 5.0b. Without it, some fits with bad initial values simply won't converge.

2.Compute Ycurve at all values of X based on the curve generated by this first iteration of nonlinear regression, and use those values to compute weights for each points.

3.Keeping those weights constant, use nonlinear regression to minimize the weighted sum-of-squares.

4.Recompute Ycurve based on the results of that curve fit and generate a new set of weights.

5.Keeping those new weights constant, use nonlinear regression again to minimize the weighted sum-of-squares.

6.Repeat steps 4 and 5 until the weighted sum-of-squares no longer changes.

If you enter data as mean, n and SD or SEM, Prism obtains the same results as if you had entered raw data, even with unequal weighting. This document explains how. The only exception is robust regression, which only "sees" the means and ignores the n and SD or SEM values you entered.

Weighting with robust regression or automatic outlier removal

As we explain in reference 1, it doesn't make sense to perform robust regression using unequal weights. The problem is that outliers can get too much weight.

If you choose both unequal weighting and robust fitting, therefore, Prism does the fitting assuming equal weights. However it uses your weighting choice when creating a table of residuals, and when counting the number of outliers (a choice you can make in the preferences tab).

If you choose both unequal weighting and automatic outlier removal, Prism first fits using robust regression (ignoring your weighting choice), and then uses the weighting factors in identifying the outliers, as explained in reference 1.

Reference

1.Motulsky HM and Brown RE, Detecting outliers when fitting data with nonlinear regression – a new method based on robust nonlinear regression and the false discovery rate, BMC Bioinformatics 2006, 7:123. Download as pdf.