Transcript
Page 1: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

Multinomial Logistic Regression

Page 2: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

Read the data use http://www.ats.ucla.edu/stat/stata/dae/ml

ogit, clear

Describe the data Codebook Summarize Tabulate Make graphs

Page 3: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 4: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 5: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 6: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

The outcome variable is brand. The variable female is coded as 0 for male and 1 for female. Let's start with some descriptive statistics of the variables of our interest.

Page 7: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 8: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 9: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 10: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 11: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 12: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

Using the Multinomial Logit Model Now we have warmed up to building our model. Our goal is to associate the brand choices with age and gender. We will assume a linear relationship between the transformed outcome variable and our predictor variables female and age. Since there are multiple categories, we will choose a base category as the comparison group. Here our choice is the first brand (brand=1).

Page 13: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 14: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 15: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 16: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

The output above has two parts, labeled with the categories of the outcome variable brand.

log(P(brand=2)/P(brand=1)) = b_10 + b_11*female + b_12*agelog(P(brand=3)/P(brand=1)) = b_20 + b_21*female + b_22*age,

with b's being the raw regression coefficients from the output.

Page 17: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

For example, we can say that for one unit change in the variable age, the log of the ratio of the two probabilities, P(brand=2)/P(brand=1), will be increased by 0.368, and the log of the ratio of the two probabilities P(brand=3)/P(brand=1) will be increased by 0.686.

Therefore, we can say that, in general, the older a person is, the more he/she will prefer brand 2 or 3.

Page 18: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

The ratio of the probability of choosing one outcome category over the probability of choosing the reference category is often referred as relative risk (and it is also sometimes referred as odds).

We can use the rrr option for mlogit command to display the regression results in the language of risk.

Page 19: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 20: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 21: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 22: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 23: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

We can also present the regression result graphically. For example, we can create three variables p1, p2 and p3 for the predicted probabilities and plot them against a predictor variable. In the example below, we plot p1 against age separated by the variable female.

Page 24: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 25: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 26: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 27: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 28: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 29: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 30: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 31: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

0.2

.4.6

.81

Pr(brand==1)

25 30 35 40age

male female

Page 32: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 33: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 34: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 35: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 36: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 37: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate
Page 38: Multinomial Logistic Regression.  Read the data use  clear  Describe the data Codebook Summarize Tabulate

Top Related