Solved – SPSS: Plot a multinomial logistic regression

data visualizationlogisticspss

Very simply, I'd like to plot a graph that compares what is predicted by the model to the real observations.

It seems easy for binomials, but for multinomial the graph that SPSS creates is pretty ugly, using X and O signs rather than real graphics.

Any clue?

Here's the kind of plot SPSS makes by default. Not very beautiful nor understandeable in one glance, for a non-expert:

Image

Best Answer

In my opinion, a good way to understand a model is just to plot it. This is as true for logistic regression as for standard linear regression. If you don't have any interactions, you can present each variable independently. (After all, the lack of interactions means the model is assuming the effect of each variable is independent of each other variable.)

I don't know how to get SPSS to produce these plots, although I'm sure it can be done. Nonetheless, a good fallback is to be able to produce plots in Excel. You will want to start by entering the names of the variables into cells A1 through A6 (i.e., "intercept", "Market Cap", "RoA", "History", etc.), and entering the estimated values in the corresponding cells B1 through B6. You'll also want to enter the means and labels for each variable at the top somewhere.

Further down the worksheet, you'll have 2 columns for each variable. In the left column (e.g., A), enter a series of values that spans the range of a variable (e.g., market capitalization). In the column to its right, write a function that will output the predicted probability given the variable value to the left and your model. Remember that the logistic regression model is: $$ \hat p_i=\frac{\exp\!\big(\beta_0+\beta_1\text{Mcap}+\beta_2\text{RoA}+\beta_3\text{hist}+\beta_4X_4+\beta_5X_5\big)}{1+\exp\!\big(\beta_0+\beta_1\text{Mcap}+\beta_2\text{RoA}+\beta_3\text{hist}+\beta_4X_4+\beta_5X_5\big)} $$ For the values of all the variables other than the one you are working on, use the mean of that variable. For instance, when you are getting predicted probabilities as a function of market capitalization, use the mean of RoA, etc. Once you have two columns of corresponding values for X & Y, you can plot them. Use Excel's chart wizard, and select "scatterplot" $\rightarrow$ "smooth lines without markers".

Here's a quick example:

enter image description here