Announcement

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

  • #16
    Originally posted by Chen Samulsion View Post
    Well, just add sort option after twoway connected. Here it is:
    Code:
    rename (dltfp capva lavva) =_org
    genstack dltfp_org capva_org lavva_org, gen(c_)
    rename c_*_org *
    twoway bar lavva capva dltfp year, barwidth(0.7 0.7 0.7) yaxis(2) || connected dlva year, sort yaxis(1) xlabel(1996(2)2022) xtitle("") ytitle("", axis(1)) legend(pos(6) row(1))
    [ATTACH=CONFIG]n1771586[/ATTACH]
    Not yet there. I get dots for every variable and in addition stacked bars do not start from 0.
    Img for stata.png

    Comment


    • #17
      I guess that #13 also means that your data are more complicated than the data example you gave.

      Comment


      • #18
        I agree with Nick. It seems that there are more than one observations in each year. You should check your data, and grasp its structure.

        Comment


        • #19
          Nick's #17 hint was a great one: in fact I forgot (because of excel) I have a panel.
          Now I have the right one. Sorry for the many misleading inaccuracies and thank you very much for your valuable help.
          Click image for larger version

Name:	Img for stata.png
Views:	1
Size:	124.2 KB
ID:	1771597

          Comment


          • #20
            I am glad you like the graph you got, but different preferences aside I have to suggest that stc4 is a poor colour for dlva -- supposedly, or presumably, the most important variable. I recommend black and a thicker line, as in an earlier post, #10.

            Comment


            • #21
              Originally posted by Nick Cox View Post
              I am glad you like the graph you got, but different preferences aside I have to suggest that stc4 is a poor colour for dlva -- supposedly, or presumably, the most important variable. I recommend black and a thicker line, as in an earlier post, #10.
              Dear Nick,
              As I told you that was just a draft of the graph whose goal was to understand if that kind of graph was possible in stata. In fact, the "genstack" user written program is the key. Now I have to conform to my Institute (in addition to carefully review data, scale, axes and so on) for all the colours: black for lines or connected lines, different blue nuances for bars. But this is a minor problem I guess.
              Thank you again for your valuable help.
              Best regards,
              Marco

              Comment


              • #22
                We're at cross purposes.

                I am comparing the colours in #19 with those in #10, not reverting to discussion of #1. Naturally, your house style now takes over.

                But since you've mentioned it, the use of genstack is strictly optional here. You just need to keep track of positive and negative values separately. My code in #3 failed there but I think #10 nailed it.
                Last edited by Nick Cox; 27 Jan 2025, 09:21.

                Comment

                Working...
                X