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: Graphing longitudinal profiles


From   Thomas Speidel <[email protected]>
To   <[email protected]>
Subject   st: Graphing longitudinal profiles
Date   Thu, 01 Dec 2011 09:26:46 -0700

I am having difficulties creating a connected line graph for a longitudinal dataset. Here's an example of a simplified dataset:

. list, clean noobs

    id   time   value
    84      0      15
    84      1      18
    84      2      17
    88      0      19
    88      1       .
    88      2       .
    93      0      14
    93      1      19
    93      2      19
    94      0      16
    94      1      20
    94      2      20
    97      0      13
    97      1       .
    97      2       .
    98      0      17
    98      1      19
    98      2      20
    99      0      17
    99      1      18
    99      2      20

. sort id time
. twoway line value time, connect(L)
[graph]

Notice the vertical line going from 13 to 19 on the y-axis. Why?
I read Nick Cox's FAQ: http://www.stata.com/support/faqs/graphics/connect.html and I feel the solution to my problem is buried somewhere there. Yet, I tried all sorts of "sorts" and the problem remains.
I neeed line segments for each id, all on the same graph.

Thanks,
Thomas Speidel
*
*   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