58
$\begingroup$

I am currently writing a paper with several multiple regression analyses. While visualizing univariate linear regression is easy via scatter plots, I was wondering whether there is any good way to visualize multiple linear regressions?

I am currently just plotting scatter plots like dependent variable vs. 1st independent variable, then vs. 2nd independent variable, etc. I would really appreciate any suggestions.

$\endgroup$
4
  • 7
    $\begingroup$ One possibility: Added variable plots $\endgroup$
    – Glen_b
    Oct 20, 2013 at 21:49
  • 1
    $\begingroup$ Of possible interest as well: Predicted by residual plot in R. $\endgroup$
    – chl
    Oct 20, 2013 at 22:00
  • 1
    $\begingroup$ See the effects package in R $\endgroup$
    – Peter Flom
    Oct 20, 2013 at 22:09
  • 3
    $\begingroup$ I guess I should have asked for this clarification first: do you mean linear regression with multiple predictors (x's, IVs) - that is multiple regression, or do you mean linear regression with multiple responses (y's, DVs) - that is, multivariate regression? $\endgroup$
    – Glen_b
    Oct 21, 2013 at 3:07

4 Answers 4

34
$\begingroup$

There is nothing wrong with your current strategy. If you have a multiple regression model with only two explanatory variables then you could try to make a 3D-ish plot that displays the predicted regression plane, but most software don't make this easy to do. Another possibility is to use a coplot (see also: coplot in R or this pdf), which can represent three or even four variables, but many people don't know how to read them. Essentially however, if you don't have any interactions, then the predicted marginal relationship between $x_j$ and $y$ will be the same as predicted conditional relationship (plus or minus some vertical shift) at any specific level of your other $x$ variables. Thus, you can simply set all other $x$ variables at their means and find the predicted line $\hat y = \hat\beta_0 + \cdots + \hat\beta_j x_j + \cdots + \hat\beta_p \bar x_p$ and plot that line on a scatterplot of $(x_j, y)$ pairs. Moreover, you will end up with $p$ such plots, although you might not include some of them if you think they are not important. (For example, it is common to have a multiple regression model with a single variable of interest and some control variables, and only present the first such plot).

On the other hand, if you do have interactions, then you should figure out which of the interacting variables you are most interested in and plot the predicted relationship between that variable and the response variable, but with several lines on the same plot. The other interacting variable is set to different levels for each of those lines. Typical values would be the mean and $\pm$ 1 SD of the interacting variable. To make this clearer, imagine you have only two variables, $x_1$ and $x_2$, and you have an interaction between them, and that $x_1$ is the focus of your study, then you might make a single plot with these three lines:
\begin{align} \hat y &= \hat\beta_0 + \hat\beta_1 x_1 + \hat\beta_2 (\bar x_2 - s_{x_2}) + \hat\beta_3 x_1(\bar x_2 - s_{x_2}) \\ \hat y &= \hat\beta_0 + \hat\beta_1 x_1 + \hat\beta_2 \bar x_2 \quad\quad\quad\ + \hat\beta_3 x_1\bar x_2 \\ \hat y &= \hat\beta_0 + \hat\beta_1 x_1 + \hat\beta_2 (\bar x_2 + s_{x_2}) + \hat\beta_3 x_1(\bar x_2 + s_{x_2}) \end{align}

An example plot that's similar (albeit with a binary moderator) can be seen in my answer to Plot regression with interaction in R.

$\endgroup$
0
12
$\begingroup$

Here is a web-based, interactive tool for plotting regression results in three dimensions.

This 3-D plot works with one dependent variable and two explanatory variables. You can also set the intercept to zero (i.e., remove the intercept from the regression equation).

This page shows a 3D scatter plot without the fitted regression model.

MiaBella AI 3D Multiple Regression

$\endgroup$
3
  • $\begingroup$ Site is down now -- I get a GoDaddy landing page $\endgroup$ Oct 15, 2019 at 18:29
  • $\begingroup$ Thanks for mentioning this. I've updated the URLs. $\endgroup$
    – Mountains
    Jul 31, 2020 at 19:50
  • $\begingroup$ That's beautiful $\endgroup$
    – gilzero
    Aug 14, 2021 at 17:33
6
$\begingroup$

To visualize the model, rather than the data, JMP uses an interactive "profiler" plot. Here's a static view.

enter image description here

And here's a link to a dynamic view.

It's similar to your scatter plot idea and can be combined with it. The idea is that each frame shows a slice of the model for the corresponding X and Y variables with the other X variables held constant at their indicated values. In the interactive version, the X values can be changed by dragging the red vertical lines.

Disclosure: I'm a JMP developer, so don't take this as an unbiased endorsement.

$\endgroup$
2
  • 2
    $\begingroup$ Is not crucial that you plot the residuals of the dependent variable with the residuals of the predictors? I thought it should be, as those represent the real relationships between your variables, but that seems rarely reccommended. $\endgroup$ Sep 1, 2017 at 15:19
  • 1
    $\begingroup$ @AgusCamacho, if you are still interested in that, you should ask a new question. $\endgroup$ Feb 6, 2019 at 1:31
1
$\begingroup$

See the R rms package and the RMS course notes, in particular the nomogram and Predict functions to obtain nomograms and partial effect plots. The summary.rms function computes one-number effect summaries of each predictor (inter-quartile range effects). Nomograms provide the most complete single representation of regression models, if there are not too many interaction terms.

$\endgroup$
3
  • $\begingroup$ This doesn't quite seem like a complete answer. Could you say what nomograms are & how they work? Could you show an example? This seems mostly to point towards your materials elsewhere, which is better suited to a comment. $\endgroup$ Aug 7, 2021 at 12:00
  • $\begingroup$ When I've put a lot of work into completely describing things in a different web resource I feel that it's not useful to duplicate effort by copying material here. But to your question see stats.stackexchange.com/questions/155430 $\endgroup$ Aug 7, 2021 at 19:44
  • $\begingroup$ That's reasonable, but then this should probably be a comment. $\endgroup$ Aug 7, 2021 at 21:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.