Announcement

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

  • Using margins after gsem mlogit model.

    I am running a multilevel multinomial logit model

    Code 1: gsem (i.o1<- v1 v2 v3 c1 c2 M1[g1]@1), mlogit

    where vn are categorical/dummy variables, cn are continuous variables, g1 is the group level, and o1 is the dependent variable.

    I have have no problem with this but I want to run a margins predict command. I cannot make margins and gsem work together.

    When I run the model without the constraining group level variables (code 4) by the group i (logically) get the same results as using a mlogit command (code 2). When I use margins (code 3) after mlogit command (code 2) I get results however when i use margins (code 3) after gsem (either code 4 or code 1) it runs for at least a whole weekend without showing any output. This is despite the fact that mlogit (code 2) and and unconstrained gsem (code 4) give the same results.

    Can margins/predict be used after gsem, mlogit? (Or have I massively over complicated this and am doing something simple wrong?)


    Code 2: mlogit o1 i.v1 i.v2 i.v3 c1 c2
    Code 3: margins v1 v2 v3, at(c1=(#)c2=(#)) predict(outcome(1.o1)
    [result]

    Code 4: gsem (i.o1<- v1 v2 v3 c1 c2), mlogit
    Code 3: margins v1 v2 v3, at(c1=(#)c2=(#)) predict(outcome(1.o1)
    [nothing, no error message, just runs for ever]

    Any help would be very appreciated, Thanks Patrick.
Working...
X