Docsity

Notes on Conditional Logit and Multinomial Logit | POL 213, Study notes of Political Science

Toggle sidebar
bg1
POL 213 notes on conditional logit and multinomial logit.
Using data on automobile choice (taken from Stata website and used in Stata
manual), we have the following data structure:
. use choice
. list id car choice dealer sex income in 1/12
+---------------------------------------------------+
| id car choice dealer sex income |
|---------------------------------------------------|
1. | 1 American 0 18 male 46.7 |
2. | 1 Japan 0 8 male 46.7 |
3. | 1 Europe 1 5 male 46.7 |
4. | 2 American 1 17 male 26.1 |
5. | 2 Japan 0 6 male 26.1 |
|---------------------------------------------------|
6. | 2 Europe 0 2 male 26.1 |
7. | 3 American 1 12 male 32.7 |
8. | 3 Japan 0 6 male 32.7 |
9. | 3 Europe 0 2 male 32.7 |
10. | 4 American 0 18 female 49.2 |
|---------------------------------------------------|
11. | 4 Japan 1 7 female 49.2 |
12. | 4 Europe 0 4 female 49.2 |
+---------------------------------------------------+
In this case, we have three choices a choose must decide among. There are two
sets of covariates, the first set is choice specific: dealer (noted in lecture
as x) and the second set is chooser specific: sex and income (noted in lecture
as w). What makes w unique?
They are constants within choosers. Implications? Given CL model, the effects
of “sex” and “income” would seem to not be estimable. To obtain chooser-
specific effects, then, we must resort to interactions:
. gen japan = (car==2)
. gen europe = (car==3)
. gen sexJapan=sex*japan
. gen sexEurope=sex*europe
. gen incJapan=income*japan
. gen incEurope=income*europe
Note there is an excluded category. Why?
Now let’s proceed with conditional logit:
. clogit choice japan europe sexJapan sexEurope incJapan incEurope dealer,
group(id)
Iteration 0: log likelihood = -284.51561
Iteration 1: log likelihood = -251.47313
Iteration 2: log likelihood = -250.78678
Iteration 3: log likelihood = -250.7794
Iteration 4: log likelihood = -250.7794
1
pf3
pf4

Partial preview of the text

Download Notes on Conditional Logit and Multinomial Logit | POL 213 and more Study notes Political Science in PDF only on Docsity!

POL 213 notes on conditional logit and multinomial logit.

Using data on automobile choice (taken from Stata website and used in Stata manual), we have the following data structure:

. use choice . list id car choice dealer sex income in 1/ +---------------------------------------------------+ | id car choice dealer sex income | |---------------------------------------------------|

  1. | 1 American 0 18 male 46.7 |
  2. | 1 Japan 0 8 male 46.7 |
  3. | 1 Europe 1 5 male 46.7 |
  4. | 2 American 1 17 male 26.1 |
  5. | 2 Japan 0 6 male 26.1 | |---------------------------------------------------|
  6. | 2 Europe 0 2 male 26.1 |
  7. | 3 American 1 12 male 32.7 |
  8. | 3 Japan 0 6 male 32.7 |
  9. | 3 Europe 0 2 male 32.7 |
  10. | 4 American 0 18 female 49.2 | |---------------------------------------------------|
  11. | 4 Japan 1 7 female 49.2 |
  12. | 4 Europe 0 4 female 49.2 | +---------------------------------------------------+ In this case, we have three choices a choose must decide among. There are two sets of covariates, the first set is choice specific: dealer (noted in lecture as x ) and the second set is chooser specific: sex and income (noted in lecture as w)****. What makes w unique? They are constants within choosers. Implications? Given CL model, the effects of “sex” and “income” would seem to not be estimable. To obtain chooser- specific effects, then, we must resort to interactions: . gen japan = (car==2) . gen europe = (car==3) . gen sexJapan=sexjapan . gen sexEurope=sexeurope . gen incJapan=incomejapan . gen incEurope=incomeeurope Note there is an excluded category. Why? Now let’s proceed with conditional logit: . clogit choice japan europe sexJapan sexEurope incJapan incEurope dealer, group(id) Iteration 0: log likelihood = -284. Iteration 1: log likelihood = -251. Iteration 2: log likelihood = -250. Iteration 3: log likelihood = -250. Iteration 4: log likelihood = -250.

Conditional (fixed-effects) logistic regression Number of obs = 885 LR chi2(7) = 146. Prob > chi2 = 0. Log likelihood = -250.7794 Pseudo R2 = 0.


choice | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- japan | -1.352189 .6911829 -1.96 0.050 -2.706882. europe | -2.355249 .8526681 -2.76 0.006 -4.026448 -. sexJapan | -.5346039 .3141564 -1.70 0.089 -1.150339. sexEurope | .5704111 .4540247 1.26 0.209 -.319461 1. incJapan | .0325318 .012824 2.54 0.011 .0073973. incEurope | .032042 .0138676 2.31 0.021 .004862. dealer | .0680938 .0344465 1.98 0.048 .00058.


I use the “group” option to group the data by some identifying variable. Remember, we’re assuming that the chooser can choose among any of the three choices. Thus, for every individual, there are 3 records of data. To interpret the model we could use odds ratios.

. clogit, or Conditional (fixed-effects) logistic regression Number of obs = 885 LR chi2(7) = 146. Prob > chi2 = 0. Log likelihood = -250.7794 Pseudo R2 = 0.


choice | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] 

-------------+---------------------------------------------------------------- japan | .2586735 .1787907 -1.96 0.050 .0667446 1. europe | .0948699 .0808925 -2.76 0.006 .0178376. sexJapan | .5859013 .1840647 -1.70 0.089 .3165294 1. sexEurope | 1.768994 .803167 1.26 0.209 .7265405 4. incJapan | 1.033067 .013248 2.54 0.011 1.007425 1. incEurope | 1.032561 .0143191 2.31 0.021 1.004874 1. dealer | 1.070466 .0368737 1.98 0.048 1.00058 1.


To “prove” a point from above, suppose we try and estimate the conditional logit model with w but without the interactions? . clogit choice japan europe sex income dealer, group(id) note: income omitted due to no within-group variance. note: sex omitted due to no within-group variance. Iteration 0: log likelihood = -286. Iteration 1: log likelihood = -258. Iteration 2: log likelihood = -258. Iteration 3: log likelihood = -258. Conditional (fixed-effects) logistic regression Number of obs = 885 LR chi2(3) = 130. Prob > chi2 = 0. Log likelihood = -258.62825 Pseudo R2 = 0.


choice | Coef. Std. Err. z P>|z| [95% Conf. Interval] 

Prob > chi2 = 0. Log likelihood = -252.72012 Pseudo R2 = 0.


car | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Japan | sex | -.4694799 .3114939 -1.51 0.132 -1.079997. income | .0276854 .0123666 2.24 0.025 .0034472. _cons | -1.962652 .6216803 -3.16 0.002 -3.181123 -. -------------+---------------------------------------------------------------- Europe | sex | .5388442 .4525278 1.19 0.234 -.3480941 1. income | .0273669 .013787 1.98 0.047 .000345. _cons | -3.180029 .7546837 -4.21 0.000 -4.659182 -1.


(Outcome car==American is the comparison group) You should verify the results are equivalent.