Fitted line plot through the origin

This macro creates a fitted line plot that goes through the origin.

Download the Macro

Be sure that Minitab knows where to find your downloaded macro. Choose File > Options > General. Under Macro location 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

  • One column that contains the dependent variable, Y
  • One column that contains the independent variable, X

Optional Inputs

CI
Use to show the confidence intervals around the fitted regression line.
PI
Use to show the prediction intervals around the fitted regression line.
CONF K
The default confidence value is 95%, but you can change the default by using the subcommand CONF followed by the confidence level, such as 90 or 97.5.
TITLE “text”
Use to specify a custom title for the graph.
QUADRATIC
Use to fit the quadratic regression model through the origin instead of the default linear regression model.
CUBIC
Use to fit the cubic regression model through the origin instead of the default linear regression model. If the analysis includes QUADRATIC and CUBIC, then the analysis uses the cubic model.
RESIDS C
Use to store the residuals of the regression through the origin in the specified column.
Note

It is strongly suggested that the residuals from any regression model be examined for randomness and normality.

Running the Macro

Suppose your dependent variable, Y, is in C1 and your independent variable, X, is in C2. You want to change the confidence level to 90% and store the residuals in column C3. To run the macro choose View > Command Line/History and type:
%ORIGIN C1 C2;
CONF 90; 
RESIDS C3.

Click Run.

More Information

You can create this graph manually with Minitab commands. The manual graph has no option to include the confidence interval or the prediction interval.

  1. Choose Graph > Scatterplot > With Regression.
  2. Under Y variables enter C1. Under X variables enter C2.
  3. Click Data View, then click the Regression tab.
  4. Uncheck Fit intercept. Click OK in each dialog box.