|
Simulations and script to assess confidence intervals |
|
|
Meaning of 95% confidence When you fit a curve with nonlinear regression, one of the most important set of results are the 95% confidence intervals of the parameters. These intervals are computed from the standard errors which are based on some mathematical simplifications. They are called "asymptotic" or "approximate" standard errors. They are calculated assuming that the equation is linear, but are applied to nonlinear equations. This simplification means that the intervals can be too optimistic. How can you know whether the intervals really do have 95% confidence? There is no general way to answer this. But for any particular situation, you can get an answer using simulations. Combining simulations and scripting: Monte Carlo analyses
Table Prism 1 Clear ForEach 1000 GoTo R 1 Regenerate GoTo R 2 Wtable "lowerKM", 14,1 Wtable "uperKM", 19,1 Next
<A>Y=IF(Y<TrueValue, 0,1) <B>Y=IF(Y>TrueValue,0,1)
The results table records whether the confidence intervals include the true value. Each row is from one simulated data set. Column A is 0 when that confidence interval started below the real value, and otherwise is 1. Column B is 0 when the confidence interval ended above the true value, and otherwise is 1. The number of 1's in both columns is the number of confidence intervals that do not include the true value. If the 95% confidence intervals are correct, and you ran 1000 simulations then you expect about 25 1 values in column A (the confidence interval started too high) and about 25 1 values in column B (the confidence interval ended too low) for a total of 50 intervals that did not include the true value (5%, leaving 95% that did include the true value). If the value is far from 5%, then you should distrust the confidence interval for that parameter. Of course, you can obtain more precise answers by using more simulated data sets. Change the value in the second line of the script from 1000 to some larger value.
|