Announcement

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

  • Interaction in mixed logit

    Hello,
    Thank you for this forum. I am a PhD student. I am writing here to be confirm one thing. I am doing mixed logit analysis with my choice data. I am using the mixlogit code (Hole, 2007).
    My code is:
    mixlogit choice, group(obs) rand(org_northern_ gen_female_ lic_yes_ rev_reliable_ none mprice) ln(1) id(si_no) nrep(5000).

    Now I want to see the interaction between the attributes. I did not find any direct solution from the manual. I tried to generate the interaction manually and run it.

    I am sharing the code here:
    gen fem_rev= gen_female_ * rev_reliable_
    gen fem_lic= gen_female_ *lic_yes_
    gen fem_ori= gen_female_ *org_northern_

    mixlogit choice fem_rev fem_lic fem_ori , group(obs) rand(org_northern_ gen_female_ lic_yes_ rev_reliable_ none mprice) ln(1) id(si_no) nrep(5000)

    Could you please tell me is this the right way?

  • #2
    you need to check the basics of stata, gen codes are fine, but how the codes are put in the command mixlogit needs to be changed ( you linked everything together). please check upon the examples provided by the author to see what is the correct form.

    Comment

    Working...
    X