Announcement

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

  • Using coefplot after mlogit

    I am trying to plot the regression coefficients following mlogit. I am able to produce the graph I need, however it seems to only plot the coefficients for only one of my outcome categories. I run the following command:

    Code:
    svy: mlogit change2 i.releducLG i.matempLG  i.fatempLG i.coresidenceCH, rrr
    
    estimate store m1
    
    svy: mlogit change2 i.releducLG  i.matempLG  i.fatempLG i.coresidenceCH i.totalsibCH2 i.gcompLG  relorderLG i.birthyr1LG i.educ2LG i.maritalCH childCH i.qwealthLG goveducCH2 govempCH2, rrr
    
    estimate store m2
    
    coefplot m1 || m2, eform xline(1) nolabel keep(*:)
    which produces two graphs with regression coefficient for three categories of my outcome, but it is unreadable because of the number of variables. When I try to specify which coefficients using:

    Code:
    coefplot m1 || m2, swapnames eform xline(1) nolabel keep(*.matempLG *.coresidenceCH)
    I get the following graph and the coefficients for only one category of my outcome. Can anyone advise where I am going wrong? My outcome variable is coded 0, 1, 2 ,3 with 0 being the baseline category. "unemployed_employed" is category '1'.

    Click image for larger version

Name:	g1.png
Views:	1
Size:	58.8 KB
ID:	1562097




  • #2
    After some trial and error I have managed to get the following graph which is what I need. I am wondering is there a way to colour code the categories and add a legend (for consistently employed, unemployed_employed etc) so its easier to read?

    Code:
    coefplot m1 || m2 , eform xline(1) nolabel keep(*.releducLG *.matempLG *.coresidehceCH *.totalsibCH2 *relorderLG 2:)
    Click image for larger version

Name:	g2.png
Views:	1
Size:	97.4 KB
ID:	1562107

    Comment


    • #3
      Dear Lara ingram , I have been struck with this same problem, and I've been trying to use your code in your second post to create a similar graph that breaks down individual variables by category. I haven't quite been able to get it to show a similar output. We get the error as following:


      Code:
      (test_table1: no coefficients found, all dropped, or none kept)
      (test_table2: no coefficients found, all dropped, or none kept)
      (nothing to plot)
      Did you happen to encounter this error? How did you overcome it? I also was trying to figure out what the 2: meant in your code; I think I interpreted the *. as showing the outcome for each category individually.

      Comment

      Working...
      X