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]

Fwd: FW: st: Horizontal time line graph of individual with time events


From   Jannik Helweg-Larsen <[email protected]>
To   [email protected]
Subject   Fwd: FW: st: Horizontal time line graph of individual with time events
Date   Sat, 5 Mar 2011 14:02:40 +0100

Brilliant solution, many thanks- with rspike and rcap options- it is even also
possible to add the duration of fever-

The following now looks quite close to the original example  (it just
needs-as suggested- a small edit in the legend of the admissiondate
bar width) :

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

gen admdays1 = admdays + 0.09
gen admdays2 = admdays - 0.09

twoway spike length id, horizontal color(mint)|| ///
rspike zero fever id, horizontal color(red) || ///
rbar admdays? id, horizontal barw(0.5)color(black)|| ///
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, ytitle("") ///
ysc(reverse)ms(O) yla(1/9,val ang(h) noticks)  ///
legend(order(2 "Febrile period" 1 "Afebrile period" 3 "Admission date"
4 "First PCR+" 5 "Last PCR+" 6 "First PCR-" 7 "Tamiflu start" 8
"Tamiflu stop" )pos(3) col(1))

thanks again

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