Prediction intervals, confidence intervals for the mean response, and confidence intervals for the regression line

For a univariate regression, this function can plot prediction intervals, confidence intervals for the mean response, and/or confidence intervals for the regression line. This function will create a plot analogous 7.11 (p. 189) in Sleuth. You can select which lines you want to plot.

The script file is regline.bands.s. To run it, follow these directions:
  1. Save the script file to your computer.
  2. Open Splus and go to "File" and "Open" and select the file. A script file window will open.
  3. Make sure your cursor is on the top half of the script window. Press F10. This will load the function into Splus. The function is called "regplot.confbands.fun".
  4. Now go to the command line. You will type the name of the function and a couple of arguments, and the plot will be automatically produced.
  5. The arguments to the function are:
  6. To produce a plot with 90% CIs for the mean and PIs for the regression of species on ph levels in the "acidfish" dataset, you would type the following into the command line (after loading the function as above):

    > regplot.confbands.fun(acidfish$ph,acidfish$species,.90,T,T,F)