Finding multinomial logistic regression coefficients using Solver

The approach described in Finding Multinomial Logistic Regression Coefficients doesn’t provide the best estimate of the regression coefficients. In fact a higher value of LL can be achieved using Solver.

Referring to Figure 2 of Finding Multinomial Logistic Regression Coefficients, set the initial values of the coefficients (range X6:Y8) to zeros and then select Data > Analysis|Solver and fill in the dialog box that appears with the values shown in Figure 1 (see Goal Seeking and Solver for more details) and then  click on the Solve button.

Multinomial logistic regression Solver

Figure 1 – Solver dialog box for Multinomial Logistic Regression

The result is displayed in Figure 2 and 3.

Solver mulinomial logistic regression

Figure 2 – Multinomial logistic regression model using Solver (part 1)

Multinomial logistic Solver 2

Figure 3 – Multinomial logistic regression model using Solver (part 2)

As you can see the value of LL calculated by Solver is -163.386 (see Figure 3), which is a little larger than the value of -170.269 calculated by the binary model (see Figure 4 of Finding Multinomial Logistic Regression Coefficients).

To test the significance of the coefficients (the equivalent of Figure 5 of Finding Multinomial Logistic Regression Coefficients for the Solver model) we need to calculate the covariance matrix (as described in Property 1 of Finding Multinomial Logistic Regression Coefficients). This is shown in Figure 4.

Covariance matricìx multinomial logistics

Figure 4 – Calculation of the Covariance Matrix

The covariance matrix displayed in Figure 4 is calculated using the formulas shown in Figure 5.

Multinomial logistic covariance formulas

Figure 5 – Formulas used in Figure 4

Using the results in Figure 2 and 4, we get the result shown in Figure 6.

Multinomial logistic regression parameters

Figure 6 – Multinomial logistic regression model using Solver (part 3)

The key formulas used to calculate the Cured + Dead table are shown in Figure 7 (the Sick + Dead table is similar).

Multinomial logistic parameters formulas

Figure 7 – Key formulas in Figure 6

The forecasted probabilities, based on the multinomial logistic regression model using Solver, of the three outcomes for men and women at a dosages of 24 mg and 24.5 mg is displayed in Figure 8.

Forecast multinomial logistic formula

Figure 8 – Forecasted probabilities using Solver

4 Responses to Finding multinomial logistic regression coefficients using Solver

  1. Anson says:

    Hi Charles,

    As per your above samples, how can I find the p value of dead?


    • Charles says:

      There probably is a way to do this based on the analysis already done, but I can’t think of it at this moment. Instead, you can reanalyze the original data taking one of the other variables (e.g. Gender) and the base variable.

  2. Ed says:

    I’ve been working with a political campaign and decided to try a logistic regression to get a rough predictive formula for the likelihood of an individual voter showing up to the polls. My LL seems really low though, around -12,000. is this something that would indicate I did something wrong?

    • Charles says:

      The value of LL really depends on the nature of your data, and doesn’t necessarily mean that you have done something wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *