Announcement

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

  • Twoway tsline of different groups in one image

    Hi,

    I want to make a time series graph of average leverage ratios of two groups of firms over years (connected and non-connected)
    I typed in the code
    Code:
    twoway (tsline Leverage), by(, legend(on)) by(connected)
    .
    Now is my question, how do I get both lines in one image?

    Click image for larger version

Name:	Leverage.png
Views:	1
Size:	11.4 KB
ID:	1450927



    I tried creating two different y variables Leverageconnected and Leveragenonconnected and entered
    Code:
    twoway (tsrline Leveragenonconnected Leverageconnected), legend(on)
    Click image for larger version

Name:	Overlapping.png
Views:	1
Size:	11.6 KB
ID:	1450928


    However, now my Y variable is not shown as Leverage anymore (I would like that) and from the lines you cannot see which one belongs to which group.

    Does anybody know how to deal with this?

    Thanks
    Last edited by Barbara Heerkens; 27 Jun 2018, 13:20.
Working...
X