Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Graphing longitudinal profiles


From   Thomas Speidel <thomas@tmbx.com>
To   <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index