Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: At risk table


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: At risk table
Date   Sun, 5 Jun 2005 15:17:37 +0200

Horea asked how to display a number at risk table below a Kaplan-Meier graph.
 
The is the intent of -stsatrisk-, but the author correctly warns that it does not always work well.
 
It can be done, however, but not easily. Start with running -stsatrisk- to get the numbers right. Below I show an example of constructing the table. It works, but it required quite a bit of trial and error. I used -scheme lean1- putting the legend to the right of the plot area, to avoid conflict between legend and table.
 
Hope this helps
Svend
----------------------------------------------------
set scheme lean1
sts graph                                         ///
  ,                                               ///
  by(screengr) per(1000)                          ///
  fail                                            ///
  clpattern(- l)                                  ///
  title("")                                       ///
  graphregion(margin(b+6))                        ///
  plotregion(margin(l=0 b=0))                     ///
  xtitle(Months of follow-up)                     ///
  ytitle("Cumulated AAA mortality per 1000")      ///
  xscale(range(0 60))                             ///
  xlabel(0(12)60)                                 ///
  ylabel(0(1)5 , format(%1.0f) nogrid)            ///
  legend(label(1 "Controls") label(2 "Invited"))  ///
  text(-0.93 -5 "Invited" , size(*0.8) place(w))  ///
  text(-1.2 -5 "Controls" , size(*0.8) place(w))  ///
  text(-0.93 0 "6333" , size(*0.8))               ///
  text(-1.2 0 "6306" , size(*0.8))                /// 
  text(-0.93 12 "6172" , size(*0.8))              ///
  text(-1.2 12 "6120" , size(*0.8))               /// 
  text(-0.93 24 "5499" , size(*0.8))              ///
  text(-1.2 24 "5452" , size(*0.8))               /// 
  text(-0.93 36 "4971" , size(*0.8))              ///
  text(-1.2 36 "4905" , size(*0.8))               /// 
  text(-0.93 48 "4305" , size(*0.8))              ///
  text(-1.2 48 "4286" , size(*0.8))               /// 
  text(-0.93 60 "3644" , size(*0.8))              ///
  text(-1.2 60 "3657" , size(*0.8))
-----------------------------------------------------
 
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       sj@soci.au.dk 
_________________________________________________________ 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index