Announcement

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

  • -Coefplot- with Multiple Models Output - Reshaping Graph

    Dear all my question is related to
    Code:
    coefplot
    .
    I ran a simple logit regression:

    Code:
    logit employ i.birth if id == "lu", or baselevels nolog
    eststo lu
    logit employ i.birth if id == "cy", or baselevels nolog
    eststo cy
    * etc...
    where employ is a binary variable for being employed, and i.birth is a categorical variable covering regions of birth (AMERICA, ASIA, EUROPE, etc.) with the home country set as the base. The variable id represents specific countries (at, be, de, uk, etc.).
    When I run coefplot:

    Code:
    coefplot lu cy be, label drop(_cons) eform xline(1)
    I get this graph:
    Click image for larger version

Name:	coefplot.png
Views:	2
Size:	33.5 KB
ID:	1761909

    I would like to reshape this graph so that id (lu, cy, be, etc.) is on the y-axis and the coefficients for i.birth (AFRICA, ASIA…) are shown in this row (spreaded across x-axis).
    I read forums related to coefplot but did not find a similar case.
    This example is also not covered in the help documentation for coefplot.
    Could someone please suggest a solution?






    Attached Files

  • #2
    Try the
    Code:
    vertical
    option as suggested by the coefplot help file.

    Comment


    • #3
      Hi Andreas,

      thank you for your help, but I need something different.
      When I use -vertical- I get this:

      Click image for larger version

Name:	whatigot.png
Views:	2
Size:	32.5 KB
ID:	1761921

      But i need something different that looks like this example:
      Click image for larger version

Name:	whatineed.png
Views:	7
Size:	39.6 KB
ID:	1761922

      Where the points America, Africa... represent coeffcients from the logit for particular countries (at, be, cy...).
      Attached Files

      Comment


      • #4
        Here is the example:

        Code:
        employ    id    birth
        1    at    NAT
        0    at    NAT
        1    at    NAT
        0    at    NAT
        1    at    NAT
        1    at    NAT
        1    at    NAT
        1    at    NAT
        1    at    NAT
        1    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        0    at    NAT
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        0    at    ASIA
        0    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        1    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    ASIA
        0    at    EUROPE
        0    at    EUROPE
        0    at    EUROPE
        1    at    EUROPE
        0    be    EUROPE
        0    be    EUROPE
        0    be    EUROPE
        0    be    EUROPE
        0    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    EUROPE
        1    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        0    be    ASIA
        1    be    ASIA
        1    be    ASIA
        1    be    ASIA
        1    be    ASIA
        1    be    ASIA
        1    be    ASIA
        1    be    NAT
        1    be    NAT
        1    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        0    be    NAT
        1    be    NAT
        1    be    NAT
        1    be    NAT
        1    be    NAT
        1    be    NAT
        1    be    NAT
        1    be    NAT
        
        logit employ ib3.birth if id =="at", or baselevels nolog
        eststo at
        
        logit employ ib3.birth if id =="be", or baselevels nolog
        eststo be

        I wonder how to get results in a form like this:
        ​​​​​​​ Click image for larger version

Name:	whatineed.png
Views:	7
Size:	39.6 KB
ID:	1761935
        Attached Files

        Comment


        • #5
          Thanks for the clarification but I don't see what kind of information one would read from a plot like this, as there is no scale for the coefficients?

          Comment


          • #6
            Hi there should be a scale.
            The best I could get so far is this graph.
            But I would like to merge this graphs to one graph (have coefficients for ASIA, AFRICA) on one line for "ro", "se"... as they represent models for different states
            . Is there any command that would allow that?

            Click image for larger version

Name:	Graph.png
Views:	1
Size:	76.3 KB
ID:	1761998

            Comment


            • #7
              With the help provided here: https://repec.sowi.unibe.ch/stata/co...ted.html#h-3-6 and here: https://www.statalist.org/forums/for...ultiple-models, you should get close to something like you want. But note that plotting all regional coefficients on the line for e.g. ro would result in a huge overlap, as the coefficients are similar in magnitude. coefplot would add vertical space between each marker, but depending on the number of regions and countries, your graph might become very large in vertical direction.

              Comment

              Working...
              X