Announcement

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

  • Drawing a tsset time graph with three y axis variables with different scales

    Hello Stata community;

    I have this little data:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int Année long Effectif int(Impot_Total_Prlévé Moyenne_dimpot_par_capita)
    2012 2622399 2620  999
    2013 2573643 3125 1214
    2014 2624140 3517 1340
    2015 2700000 3549 1314
    end
    format %ty Année
    As you can see, the first variable is a time variable, the other variables are quantitative ones with different scales.

    Is there a possibility to draw one graph on which I could have the evolution of each of those quantitative variables with time, all on the same graph? I know I could use the "add a second y axis" option, but that only allows for two y axis.

    Thanks for the help.

  • #2
    I suggest using multiline from SSC. You need to install it before you can use it:

    Code:
    ssc install multiline
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int Année long Effectif int(Impot_Total_Prlévé Moyenne_dimpot_par_capita)
    2012 2622399 2620  999
    2013 2573643 3125 1214
    2014 2624140 3517 1340
    2015 2700000 3549 1314
    end
    format %ty Année
    
    multiline E I M A, recast(connected)
    Here,
    recast(connected) is optional; any variable labels will be shown if defined; and you might consider xtitle("") on the grounds that any reader will know what 2012/2015 mean.

    Click image for larger version

Name:	EIMA.png
Views:	1
Size:	56.8 KB
ID:	1763826

    Comment


    • #3
      Nick Cox Thanks very much, that worked.

      Comment

      Working...
      X