I am running a multiple regression with 2 continuous independent variables and one continuous dependent variable and a categorical moderator. I am doing this in SPSS. I am not sure how to proceed. Please help!! My question is how do (1st continuous variable) and (2nd continuous variable) differentially predict (Continuous Dv) for (categorical variable split into it's 2 categories.
Solved – Multiple regression with 2 IVs and a moderator in SPSS
multiple regression
Related Solutions
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.
It's a little unclear what your objectives are, so other methods might be preferable depending on those. Polynomial regression may suit continuous variables, but wouldn't make sense for categorical ones. You can add higher-order terms for the continuous variables alongside categorical predictors though.
Nominal predictors can be added to a multiple regression model using dummy codes. In your case, you could enter lithology as two dummy variables: using clastic rocks as the reference group (for example; not necessarily the one you want to choose), you could create one binary variable indicating whether a case involves carbonate rocks (1
if so, 0
if not), and another equivalent one for metamorphic/igneous rocks. The same process of dummy coding can work for any number of levels, and won't be too much harder to interpret for vegetation. Here's an example dataset:
$$\begin{array}{c|cccccc}\rm Case&\rm Carbonate&\rm Metamorphic/Igneous&\rm Farm&\rm Grass&\rm Forest&...\\\hline\small\rm Clastic\ bare&0&0&0&0&0&...\\\small\rm Carbonate\ bare&1&0&0&0&0&...\\\small\rm Igneous\ bare&0&1&0&0&0&...\\\small\rm Clastic\ farm&0&0&1&0&0&...\\\small\rm Carbonate\ farm&1&0&1&0&0&...\\\small\rm Igneous\ forest&0&1&0&0&1&...\\...&...&...&...&...&...&... \end{array}$$See how that works? (I can elaborate if not.) Just enter these binary predictors like any other. The corresponding $\beta$s represent the differences between given groups and the reference group.
E.g., $\beta_{\rm Carbonate}$ represents the difference between carbonate and clastic in the above example.
Best Answer
Likely what you want to do is to test whether the 'interaction term' is significant. This will test whether the slopes are significantly different from each other in the two groups.
In SPSS go to Analyze-->General Linear Model-->Univariate.
Put your DV in the DV slot. Put your continuous variables in the 'Covariates' box and put your categorical variable in the 'fixed factor' box. Click on the 'Model' tab and choose 'Custom'. Then move all of your IV over from the left to the right box. Then choose the 'interaction' option and move the continuous IV, together with the categorical IV over to the right hand box.
When you run your model the output will include the interaction term.
Here is a nice walkthrough that looks at various ways of checking if the relation between two continuous variables is the same or different for two different groups (it's all brought together on the last page so you might want to skim through that first):
http://psych.unl.edu/psycrs/statpage/rhtest_eg2a.pdf