Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interaction between categorical and continous variable - MNL

    Dear Stata users,

    I would like to generate interactions between categorical and continuous variable in MNL model. This is the code I am using:
    xi: clogit choice Mov MovS Rst i.obs_MS#c.day1 i.obs_M#c.day1 i.obs_R#c.day1 , group(lp1)

    Unfortunately this does not work.

    This is the output I am getting
    "interactions not allowed"

    Is there a short way to gen such interactions?





  • #2
    It is the -xi:- prefix that does not allow the # terms. But -xi:- is obsolete.* Just eliminate it from the command and you should have no problem.

    That said, your model is mis-specified and will produce meaningless results because you have interaction terms but have omitted the constituent terms. E.G. you have an interaction between obs_MS and day1, but neither obs_MS nor day1 by itself appears. The simplest way to fix this is to change all of the #'s in your command to ##.

    *Well, almost obsolete. There are still a few situations where it is needed, but this is not one of them, and they are all pretty exotic.

    Comment

    Working...
    X