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]

Re: st: Horizontal time line graph of individual with time events


From   Jannik Helweg-Larsen <[email protected]>
To   [email protected]
Subject   Re: st: Horizontal time line graph of individual with time events
Date   Fri, 4 Mar 2011 17:20:48 +0100

Thank you very much!- just the start I needed- very useful link

Two small follow up questions:

1. Regarding the  non-standard marker "pipe" = "|", which I use to
indicate start of admission:  Is it possible somehow to illustrate
this marker in the legend at right (see example below- next to "Start
of fever") ?

I wonder why this marker sign-"|"- is not included as a default marker option?

2. I had to experiment to get similar sizes of the shallow (msize) and
solid squares- why are Sh(shallow) and S(solid) not the same size?

To illustrate and for anyone interested, here is a preliminary code
for a slightly different graph, now including first day with negative
influenza pcr)

id  length  admdays  pcr1  pcr2  pcr1neg  tamistartd  tamistopd
 1      42        2    12    25       27          12         31
 2      23        3    13    16       21          15         21
 3      26        5     5    16       19           6         11
 4      22       10    10    14        .          11         15
 5       5        0     2     5        .           3          5
 6      29        1     4    11        .           7         12
 7      29        1     1    11        .           1         15
 8      29        7     9    14       17          10         18
 9      32        4     5    13        .           4         17

label define idlbl             ///	
  1 "Immunosuppressed"      ///
  2 "Alcoholic"  ///
  3 "COPD"	///
  4 "Pregnant"   ///	
  5 "Myelomatosis" ///
  6 "Lymphoma"   ///	
  7 "Leukemia"  ///
  8 "HIV" ///
  9 "Pregnant" ///

 label val id idlbl

generate pipe = "|"

twoway spike length id, horizontal || ///
scatter id admdays,ms(none) mlabpos(0) mlabel(pipe) mlabsize(*2) || ///
scatter id pcr1,ms(s)mfc(yellow)msize(*3) || ///
scatter id pcr2, ms(s)mfc(yellow)msize(*3) || ///
scatter id pcr1neg, ms(Sh) msize(*2.1) || ///
scatter id tamistartd, ms(0) || ///
scatter id tamistopd, title("Days since onset of fever")
ysc(reverse)ms(O) yla(1/9,val ang(h) noticks)  ///
legend(order(2 "Start of fever" 3 "First PCR+" 4 "Last PCR+" 5 "First
PCR-" 6 "Tamiflu start" 7 "Tamiflu stop" )pos(3) col(1))

Jannik
*
*   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