Multinomial Logit Model with Dummy Variables

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

ghpow1
Posts: 3
Joined: Fri Apr 08, 2011 6:34 am

Multinomial Logit Model with Dummy Variables

Postby ghpow1 » Fri Apr 08, 2011 7:20 am

Hi All,

Using Eviews 7 - I am attempting to build a Multinomial Logit model with dummy variables of the following form

Dependent Variable : 0-8 Discrete Choices

Dummy Variable 1: 965 dummy vars
Dummy Variable 2: 805 dummy vars

The data set I am using has the dummy columns pre-created, so it's a table of 72,381 rows and 1770 columns.

The first 965 columns represent the dummy columns for Variable 1
The next 805 columns represent the dummy columns for Variable 2

My code to build the LOGL looks like the following. I want to know...is there a better way of doing this without these huge equations? (I probably also need a more powerful PC to do all of this).

I'll also want to perform a joint test of significance on the first 805 coefficients...

Is this possible?

Kind Regards,

Code: Select all

coef(72381) beta @logL dependent_variable dependent_variable_1 = exp( beta(1) + beta(2)*batter + beta(3)*series05 + beta(4)*series06 + beta(5)*series07 + beta(6)*series08 + beta(7)*series09 + beta(8)*series10 + beta(9)*series11 + beta(10)*series12 + beta(11)*series13 + beta(12)*series14 + beta(13)*series15 + beta(14)*series16 + beta(15)*series17 + beta(16)*series18 + beta(17)*series19 + beta(18)*series20 + beta(19)*series21 + beta(20)*series22 + beta(21)*series23 + beta(22)*series24 + beta(23)*series25 + beta(24)*series26 + beta(25)*series27 + beta(26)*series28 + beta(27)*series29 + beta(28)*series30 + beta(29)... dependent_variable_2 = ... dependent_variable_7 = *series801 + beta(6449)*series802 + beta(6450)*series803 + beta(6451)*series804 + beta(6452)*series805 + beta(6453)*series806 + beta(6454)*series807 + beta(6455)*series808 + beta(6456)*series809 ) dnm = 1 + dependent_variable_1 + dependent_variable_2 + dependent_variable_3 + dependent_variable_4+ dependent_variable_5 + dependent_variable_6 + dependent_variable_7 + dependent_variable_8 dependent_variable = d0*log(1/dnm) + d1*log(dependent_variable_1/dnm) '+ d2*log(dependent_variable_2/dnm) + d3*log(dependent_variable_3/dnm) + d4*log(dependent_variable_4/dnm) + d5*log(dependent_variable_5/dnm) + d6*log(dependent_variable_6/dnm) + d7*log(dependent_variable_7/dnm) + d8*log(dependent_variable_8/dnm)

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Multinomial Logit Model with Dummy Variables

Postby EViews Glenn » Fri Apr 08, 2011 9:33 am

Yikes.

First of all, I don't think you need a coefficient matrix 72831 long, "only" 1770*7 or so since that correspond to the coefficients multiplied by the number of choices-1. Even so, at that point you are up to around 12390 coefficients and you're *probably* going to be running out of memory for the moment matrix.

If your system can handle the memory, you would still have to create the long expressions. I would do this programatically rather than trying to type in the expressions. If you need to, you should take a look at the discussion of loops.

That said, even if you were to get all of it coded up, it's not clear that it would work.

Most other econometric and statistical software probably wouldn't be able to handle this problem (since it requires custom coding to handle the dummy variables). There are some simplifications you can get in the algorithm that can save memory, but it's not nearly as straightforward as in the standard panel/dummy variables case where you can project. Actually, thinking about it, LIMDEP might have something in this regard since I know that Bill Greene has written some on problems in this general area.

Lastly, I might suggest that you consider alternatives to multinomial logit. The MNL model is really designed for cases where the explanatory variables are continuous. There are contingency table type analyses that might be more appropriate in your pure dummy variable setting. You might want to take a look at Agresti or a similar book for a discussion.

ghpow1
Posts: 3
Joined: Fri Apr 08, 2011 6:34 am

Re: Multinomial Logit Model with Dummy Variables

Postby ghpow1 » Sun Apr 10, 2011 2:24 am

Yikes.

First of all, I don't think you need a coefficient matrix 72831 long, "only" 1770*7 or so since that correspond to the coefficients multiplied by the number of choices-1. Even so, at that point you are up to around 12390 coefficients and you're *probably* going to be running out of memory for the moment matrix.

If your system can handle the memory, you would still have to create the long expressions. I would do this programatically rather than trying to type in the expressions. If you need to, you should take a look at the discussion of loops.

That said, even if you were to get all of it coded up, it's not clear that it would work.

Most other econometric and statistical software probably wouldn't be able to handle this problem (since it requires custom coding to handle the dummy variables). There are some simplifications you can get in the algorithm that can save memory, but it's not nearly as straightforward as in the standard panel/dummy variables case where you can project. Actually, thinking about it, LIMDEP might have something in this regard since I know that Bill Greene has written some on problems in this general area.

Lastly, I might suggest that you consider alternatives to multinomial logit. The MNL model is really designed for cases where the explanatory variables are continuous. There are contingency table type analyses that might be more appropriate in your pure dummy variable setting. You might want to take a look at Agresti or a similar book for a discussion.
Thanks Glenn. Haha "Yikes". :)

I'm actually trying to replicate another person's research, just with new data, so this kind of thing has been done before. I will reduce the coefficient series. But yeah, not looking good!


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest