0

I am new to R and I would love it if you can help me with this because I am having serious difficulties.

I have unbalanced panel data that shows monthly companies' performance compared to the rest of the market in terms of $$ (eg. this month company 1 has made $1000 more than the average of the market). Each of these companies had decided on a strategy when they entered the market (1 through 8). These strategies are nested into two different groups (a,b) so that strategies 1,2, and 3 are part of the group a, while strategies 4 through 8 are part of group b. I would need a rank of the best strategies from best to worst. I have discretized my DV so that now it only shows whether that month company 1 performed higher or lower than the market. However, I am not sure it is the right way because I would then lose how much better or worse each month companies performed compared to the market.

My data looks like this:

ID  Main    Strategy   YearMonth  DiffPerformance    Control1    Control 2     DiffPerformanceHL
1     a        2         201706      9.037               2          57              H
1     a        2         201707      4.371               2          57              H   
1     a        2         201708      1.633               2          57              H
1     a        2         201709      -3.521              2          59              L
1     a        2         201710      13.096              2          59              H           
1     a        2         201711      5.070               2          60              H
1     a        2         201712       4.25               2          60              H
2     b        5         201904      6.78                4          171             H
2     b        5         201905      -15.26              4          169             L
2     b        5         201906      7.985               4          169             H

Where ID is the company, Main is the group (a or b) Strategies are 1 through 8 and nested as previously stated, YearMonth represents the specific month, DifferencePerformance is the DV as a continuous variable, Control 1 is static over time and is a categorical variable (1 through 6), Control 2 is a control count variable that changes over time, and DiffPerformance HL is the discretized DV.

Can you please help me figuring out how to create a nested logit model in R? I would be super appreciative

Thanks

Simon_W
  • 57
  • 4
  • [You could try to use this example to get you started.](https://cran.r-project.org/web/packages/mlogit/vignettes/e3mxlogit.html) – Kat Oct 11 '21 at 01:59
  • Thank you, but shouldn't it be a nested logit model rather than a mixed logit model? – Simon_W Oct 11 '21 at 13:27
  • I thought that you didn't know where to begin. I didn't provide the link as motivation to change the model you were trying to implement, just to get you started. On the other hand, while it is a mixed logit, [Williams (1977)](https://doi.org/10.1068/a090285) and [Brownstone and Train (1999)](https://doi.org/10.1016/S0304-4076(98)00057-8) wrote about the near equivalent possibilities. I don't recall which one, but one of the two felt that the nested was a bit inhibiting, as well. Either way, the programming and data structure for the subtypes of logit models will typically be pretty similar. – Kat Oct 11 '21 at 14:31
  • Ok, I understand thanks. I just know that I need to implement a nested logit model and looking online, my data structure is quite different. I will check the mixed logit model and understand the nuances that lead me to the decision. Thank you again – Simon_W Oct 11 '21 at 19:04

0 Answers0