## Recipe 8.8. Computing Confidence Intervals## ProblemYou want to compute confidence intervals along with your curve fits. ## SolutionSee the following discussion. ## DiscussionYou can compute confidence intervals for the estimated values from your curve fit, or you can compute confidence intervals for the parameters in the model itself. ## Confidence intervals for estimated valuesYou can readily compute confidence intervals for the values predicted by a regression equation. In this case, you'd report estimated values as y ± y Let's reconsider the example from Recipe 8.6. Figure 8-12 shows the result of a nonlinear curve fit, along with upper and lower confidence limits. Figure 8-11 shows the original data along with the fit parameters. It also shows several other statistics I computed for this example. The ones of interest here are t-value and Confidence Interval, shown in cells M13 and M14. Before computing these values, you must set up some auxiliary calculations. First you must compute the sum of squared residuals as shown in cell M5. The formula used in this example is Next you need to compute the residual standard deviation. This value is computed in cell M6 using the formula Now you can compute the t-statistic using the formula Finally, the confidence limits are found by multiplying the t-statistic by the residual standard deviation. Cell M14 contains this result, using the formula ## Confidence intervals for curve parametersSometimes it's the parameters of a curve fit that are of scientific interest, instead of the estimated values predicted from the fit line. For example, you may compute a best-fit straight line through a set of experimental data where the slope of the best-fit line represents some aspect of the underlying physical process, such as reaction rate or spring constant. Curve fitting to estimate the model parameters yields statistical estimates of those parameters given the sample, which we assume represents the entire population. We can use statistical techniques to estimate confidence intervals for these parameters just as we did when estimating confidence intervals for predicted values. Figure 8-16 shows some experimental data that has been the subject of a linear least-squares curve fit. In this case, the parameters of the curve fit (the slope and intercept) are of scientific importance and we'll compute confidence limits for each of these corresponding to a 95% degree of confidence. To begin with, you must fit a straight line through the data, using any of the linear curve-fitting techniques discussed in this chapter. Then you need to compute the standard error for the estimate by using Excel's built-in function
The t-statistic is computed in a manner similar to that discussed earlier. In this case, cell F13 computes the t-statistic using the formula Now you need to set up a column computing the x - x Finally, the confidence limits for the slope and intercept are computed in cells F15 and F16, respectively. Cell F15 contains the formula ## Figure 8-16. Parameter confidence intervals exampleyields a confidence limit of ± 0.0110 for the slope. Cell F16 contains the formula The results of this exercise would be reported as follows: slope m = 0.1107 ± 0.0110; intercept b = 0.0016 ± 0.0691. ## See AlsoSee Recipes 5.3 and 5.6 for more information on Excel's support for the Student's t-distribution. |

# Recipe8.8.Computing Confidence Intervals

Similar products