Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: (Many) overlaid graphs


From   Maria Ana Vitorino <[email protected]>
To   <[email protected]>
Subject   st: (Many) overlaid graphs
Date   Thu, 19 May 2011 17:11:42 -0400

Dear Statalist users,

I'm trying to do multiple overlaid graphs but I'm not sure how to do it since I have a very large number of time series.
The data is the following:


     +------------------------+
     | Person   Weight   Date |
     |------------------------|
  1. |  Name1       50      1 |
  2. |  Name1       55      2 |
  3. |  Name1       50      3 |
  4. |  Name1       45      4 |
  5. |    ...        .      . |
     |------------------------|
  6. |  Name2       85      2 |
  7. |  Name2       88      4 |
  8. |  Name3       68      1 |
  9. |    ...        .      . |
 10. |     ..        .      . |
     |------------------------|
 11. |  NameN        .      . |
     +------------------------+

If I just wanted to do the plot for the first two people, I could use something like:

twoway (scatter weight date if Person=="Name1", connect(l) sort xlab(, valuelabel) legend(label(1 "Name1"))) (scatter weight date if Person=="Name2", connect(l) sort xlab(, valuelabel) legend(label(2 "Name2")))


But, what I am trying to achieve is a plot with lines for ALL the people in the dataset. Since there are many people it is cumbersome to add one plot per person manually.

Is there an easier way of doing the plot with all the series in the same graph (and with a legend saying which series refers to each person)?

Thanks for the help!

Ana
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index