 Dataplot Vol 1 Vol 2

# PARTIAL REGRESSION PLOT

Name:
PARTIAL REGRESSION PLOT
Type:
Graphics Command
Purpose:
Generate a partial regression plot. Note that partial regression plots are also referred to as added variable plots, adjusted variable plots, and individual coefficient plots.
Description:
When performing a linear regression with a single independent variable, a scatter plot of the response variable against the independent variable provides a good indication of the nature of the relationship. If there is more than one independent variable, things become more complicated. Although it can still be useful to generate scatter plots of the response variable against each of the independent variables, this does not take into account the effect of the other independent variables in the model.

Partial regression plots attempt to show the effect of adding an additional variable to the model (given that one or more indpendent variables are already in the model). Partial regression plots are formed by:

1. Compute the residuals of regressing the response variable against the indpendent variables but omitting Xi

2. Compute the residuals from regressing Xi against the remaining indpendent variables.

3. Plot the residuals from (1) against the residuals from (2).

Velleman and Welsch (see References below) express this mathematically as:

Y.[i] versus Xi.[i]

where

Y.[i] = residuals from regressing Y (the response variable) against all the indpendent variables except Xi
Xi.[i] = residuals from regressing Xi against the remaining indpependent variables.

Velleman and Welsch list the following useful properties for this plot:

1. The least squares linear fit to this plot has the slope i and intercept zero.

2. The residuals from the least squares linear fit to this plot are identical to the residuals from the least squares fit of the original model (Y against all the independent variables including Xi).

3. The influences of individual data values on the estimation of a coefficient are easy to see in this plot.

4. It is easy to see many kinds of failures of the model or violations of the underlying assumptions (nonlinearity, heteroscedasticity, unusual patterns).

Partial regression plots are widely discussed in the regression diagnostics literature (e.g., see the References section below). Since the strengths and weaknesses of partial regression plots are widely discussed in the literature, we will not discuss that in any detail here.

Partial regression plots are related to, but distinct from, partial residual plots. Partial regression plots are most commonly used to identify leverage points and influential data points that might not be leverage points. Partial residual plots are most commonly used to identify the nature of the relationship between Y and Xi (given the effect of the other indpendent variables in the model). Note that since the simple correlation betweeen the two sets of residuals plotted is equal to the partial correlation between the response variable and Xi partial regression plots will show the correct strength of the linear relationship between the response variable and Xi This is not true for partial residual plots. On the other hand, for the partial regression plot, the x axis is not Xi. This limits its usefulness in determining the need for a transformation (which is the primary purpose of the partial residual plot).

Dataplot provides two forms for the partial regression plot. You can generate either a single partial regression plot or you can generate a matrix of partial regression plots (one plot for each independent variable in the model).

For the matrix form of the command, a number of SET FACTOR PLOT options can be used to control the appearance of the plot (not all of the SET FACTOR PLOT options apply). These are discussed in the Notes section below. Syntax 1:

PARTIAL REGRESSION PLOT <y> <x1> ... <xk> <xi>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<x1> ... <xk> are the independent variables;
<xi> is the independent variable for which the partial regression plot is being generated
(note that <xi> must be one of the variables listed in <x1> ... <xk>;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is the syntax for generating a single partial regression plot.

Syntax 2:
MATRIX PARTIAL REGRESSION PLOT <y> <x1> ... <xk>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<x1> ... <xk> are the independent variables;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax is used to generate a matrix of partial regression plots.

Examples:
PARTIAL REGRESSION PLOT Y X1 X2 X3 X4 X2

MATRIX PARTIAL REGRESSION PLOT Y X1 X2 X3 X4

PARTIAL REGRESSION PLOT Y X1 X2 X3 X4 X2 SUBSET TAG > 2
MATRIX PARTIAL REGRESSION PLOT Y X1 X2 X3 X4 SUBSET TAG > 2

Note:
The following option controls which axis tic marks, tic mark labels, and axis labels are plotted.

SET FACTOR PLOT LABELS <ON/OFF/XON/YON/BOX>

OFF means that all axis labels are suppressed (this can be useful if a large number of variables are being plotted). ON means that both X and Y axis labels are printed. XON only plots the x axis labels and YON only plots the y axis labels.

BOX is a special option that creates an extra column on the left and an extra row on the bottom. The axis label is printed in this box. BOX is typically reserved for the plot types that plot the variable names in the axes labels.

The default is ON (both x and y axis labels are printed).

Note:
The following option controls where the x axis tic marks, tic mark labels, and axis label are printed.

SET FACTOR PLOT X AXIS <BOTTOM/TOP/ALTERNATE>

BOTTOM specifies that the x axis labels are printed on the bottom axis (on the last row only). TOP specifies that the x axis labels are printed on the top axis (first row only). ALTERNATE specifies that the x axis labels alternate between the top (first row) and bottom axis (last row). We recommend using the TIC OFFSET command to avoid overlap of axis labels and tic marks.

The default is ALTERNATE.

Note:
The following option controls where the y axis tic marks, tic mark labels, and axis label are printed.

SET FACTOR PLOT Y AXIS <LEFT/RIGHT/ALTERNATE>

LEFT specifies that the y axis labels are printed on the left axis (on the first column only). RIGHT specifies that the y axis labels are printed on the right axis (last column only). ALTERNATE specifies that the y axis labels alternate between the left (first column) and right axis (last column). We recommend using the TIC OFFSET command to avoid overlap of axis labels and tic marks.

The default is ALTERNATE.

Note:
Users have different preferences in terms of whether the plot frames for neighboring plots are connected or not. This is controlled with the following option.

SET FACTOR PLOT FRAME <DEFAULT/CONNECTED/USER>

DEFAULT connects neighboring frames (i.e., the FRAME CORNER COORDINATES are set to 0 0 100 100). USER uses whatever frame coordinates are currently set (15 20 85 90 by default) and makes no special provisions for axis labels and tic marks (i.e., you set them as you normally would, each plot uses whatever you have set). CONNECTED uses whatever frame coordinates have been set by the user, but it draws the axis labels and tic marks as if DEFAULT were being used (that is, as determined by the SET FACTOR PLOT commands described above). Typically, CONNECTED is used to put a small bit of space between plots. For example, you might use FRAME CORNER COORDINATES 3 3 97 97 before the PARTIAL RESIDUAL PLOT command.

Since the plots can often have different limits for the axes, the default is USER.

Note:
When the tic marks and tic mark labels are all plotted on the same side (i.e., SET FACTOR PLOT Y AXIS is set to LEFT or RIGHT or SET PARTIAL RESIDUAL PLOT X AXIS is set to BOTTOM or TOP), then overlap between plots is possible. The TIC OFFSET command can be used to avoid this. In addition, you can stagger the tic labels with the following command:

SET FACTOR PLOT LABEL DISPLACEMENT <NORMAL/STAGGERED/VALUE>

NORMAL means that all tic labels are plotted at a distance determined by the TIC LABEL DISPLACEMENT command. STAGGERED means that alternating plots will be staggered. That is, one will use the standard displacement while the next uses a staggered value. Entering this command with a numeric value specifies the amount of the displacement for the staggered tic labels. For example,

TIC MARK LABEL DISPLACEMENT 10
SET FACTOR PLOT LABEL DISPLACEMENT STAGGERED
SET FACTOR PLOT LABEL DISPLACEMENT 25

These commands specify that the default tic label displacement is 10 and the staggered tic mark label displacement is 25.

Note:
It is often helpful on scatter plot matrices to overlay a fitted line on the plots. The following command is used to specify the type of fit.

NONE means that no fitted line is plotted. LOWESS means that a locally weighted least squares line will be overlaid. LINE means that a linear fit (Y = A0 + A1*X) will be overlaid. QUAD means that a quadratic fit (Y = A0 + A1*X + A2*X**2) will be overlaid. SMOOTH means that a least squares smoothing will be overlaid.

For LOWESS, it is recommended that the lowess fraction be set fairly high (e.g., LOWESS FRACTION 0.6).

The fitted line is currently only generated if the factor plot type is PLOT.

The default is for no fitted line to be overlaid on the plot. If a overlaid fit is desired, the most common choice is to use LOWESS.

Note:
Dataplot allows you to set axis limits with the LIMITS command. For the factor plot, it is often desirable to set the axis limits for each plot. This can be done with the command

SET FACTOR PLOT YLIMITS <LOW1> <UPP1> <LOW2> <UPP2> ...
SET FACTOR PLOT XLIMITS <LOW1> <UPP1> <LOW2> <UPP2> ...

The default is to allow the axis limits to float with the data.

Note:
You can use standard plot control commands to control the appearance of the factor plot.

For example,

MULTIPLOT CORNER COORDINATES 5 5 95 95
MULTIPLOT SCALE FACTOR 3
TIC OFFSET UNITS SCREEN
TIC OFFSET 5 5
Default:
None
Synonyms:
None
Related Commands:
 FIT = Perform a multi-linear fit. PARTIAL RESIDUAL PLOT = Generates a partial residual plot. PARTIAL LEVERAGE PLOT = Generates a partial leverage plot. CCPR PLOT = Generates a CCPR plot. VIF = Compute variance inflation factors for a multi-linear fit. CONDITION INDICES = Compute condition indices for a design matrix. SCATTER PLOT MATIRX = Generate a factor plot. FACTOR PLOT = Generate a plot for a response against a number of different independent variables. CONDITIONAL PLOT = Generate a conditional (subset) plot.
Reference:
Tom Ryan (1997), "Modern Regression Methods", John Wiley.

Neter, Wasserman, and Kunter (1990), "Applied Linear Statistical Models", 3rd ed., Irwin.

Draper and Smith (1998), "Applied Regression Analysis", 3rd. ed., John Wiley.

Cook and Weisberg (1982), "Residuals and Influence in Regression", Chapman and Hall.

Belsley, Kuh, and Welsch (1980), "Regression Diagnostics", John Wiley.

Velleman and Welsch (1981), "Efficient Computing of Regression Diagnostiocs", The American Statistician, Vol. 35, No. 4, pp. 234-242.

Applications:
Multi-linear Regression
Implementation Date:
2002/6
Program:
```SKIP 25
READ HALD647.DAT Y X1 X2 X3 X4
.
MULTIPLOT CORNER COORDINATES 5 5 95 95
MULTIPLOT SCALE FACTOR 2
LINE BLANK
CHARACTER X
X1LABEL DISPLACEMENT 12
Y1LABEL DISPLACEMENT 12
TIC OFFSET UNITS SCREEN
TIC OFFSET 5 5
.
MATRIX PARTIAL REGRESSION PLOT Y X1 X2 X3 X4
``` NIST is an agency of the U.S. Commerce Department.

Date created: 8/19/2002
Last updated: 10/14/2015