Linear or Quadratic Regression with Predicted Values

Use this macro to plot a simple linear or quadratic regression line and display the predicted values on the plot. If the predicted values are for future values of X, then the predicted line and confidence bands are extended into the future.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose File > Options > General. Under Macro location and browse to the location where you save macro files.

Important

If you use an older web browser, when you click the Download button, the file may open in Quicktime, which shares the .mac file extension with Minitab macros. To save the macro, right-click the Download button and choose Save target as.

Required Inputs

  • A column of response data (Y)
  • A corresponding column of predictor values (X)
  • A column containing predicted values for future values of X.

Optional Inputs

QUADRATIC
Use to specify the quadratic model.
CONFLEV K
The default confidence level is 95%, but you can modify the default by using the subcommand CONFLEV followed by the percentage you want to use (1-99).

Running the Macro

Suppose that C1 contains X and that C2 contains the Response or Y. New values for X are in C4. You want to use the quadratic model, and a confidence level of 98%. To run the macro, choose View > Command Line/History and enter:
%EXTEND C2 C1 C4;
QUADRATIC;
CONFLEV 98.

Click Run.