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]
Re: st: How to plot progression over time for individual cases/IDs
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: How to plot progression over time for individual cases/IDs
Date
Mon, 2 Jul 2012 14:49:49 +0200
On Mon, Jul 2, 2012 at 2:20 PM, Sofia Ramiro wrote:
> I want to plot the progression of a variable over time. I have assessments from 7 time points and from 192 patients.
> I would like to have a plot with individual progression in each patient
> (and if it gets too crowded and complicated to see a patttern, then I
> will stratify and for example have one graph for males and one for
> females, etc).
> My problem is that I don't manage to identify the
> individual patient lines as they all come up with the same colour.
> Syntax used: graph twoway line fnmisi2totalmsassst timepoint
You cannot assign a unique combination of pattern and color to 192
patients and hope to get a readable picture let alone a readable
legend. Even separating them by sex or some other variable will not be
enough. You will just have to forget about being able to identify all
units in that graph in the sense that you can read each individual's
id from that graph.
However, you can and should plot a separate line for each individual,
which you can do by adding the -connect(L)- option for this type of
graph. This will make the graph a lot more readable.
sort ov001 timepoint
twoway line fnmisi2totalmsassst timepoint, c(L)
Stratifying can still be useful. Some nice tricks are discussed in:
N.J. Cox (2010) Speaking Stata: Graphing subsets. The Stata Journal,
10(4): 670--681.
<http://www.stata-journal.com/article.html?article=gr0046>
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/