Announcement

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

  • How to create a graph for a 3 level model

    Hi statlist,

    I have a model:

    mixed immiatt agea male lrscale eduyrs i.houseincomedec born_r i.parentimmi trststf teredu gdp forbornpop lib10 mipex || cid: || year: lrscale, cov(un)
    and I would like to create a graph that shows the change over time as well as mipex (which is a policy index).

    I have done this previously with 2 level data using:

    margins, at(lrscale_r=(0(1)10))
    marginsplot, name(lrscale, replace)
    graph save lrscale "left:right scale graph.gph", replace
    margins, at (lrscale_r=(1(1)10)) over(born_r)
    marginsplot, name(lrscaleborn, replace)
    graph save lrscaleborn "left:right scale and born in the country graph.gph", replace
    margins, at (lrscale_r=(1(1)10)) over(parentimmi)
    marginsplot, name(lrscaleparents, replace)
    graph save lrscaleparents "left:right scale and parents born in the country graph.gph", replace
    and also:

    predict u0, reffects
    predict u0se, reses
    egen justone=tag(cid)
    sort u0
    generate rank=sum(justone)
    sort rank
    list cid u0 u0se rank if justone==1
    serrbar u0 u0se rank if justone==1, scale(2) yline(0) name(serrbar, replace)
    graph save serrbar "placement of countries in order of attitudes towards immigrants.gph", replace
    but I am struggling to adjust these for the 3 level model

    Is there anyway I can adjust it or is there a better way to create graphs to show what I want?

    This is for my masters dissertation and the coding part has already taken me 2 more weeks than planned so any help would be much appreciated!

    thanks
Working...
X