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

st: RE: Graphing RRs and their 95% CIs


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graphing RRs and their 95% CIs
Date   Mon, 17 Oct 2005 20:22:10 -0500

How about something like this?

use http://www.stata-press.com/data/r9/dollhill2.dta,clear
local j = 1
qui {
gen ub = .
gen lb = .
gen irr = .
gen cat = .
levelsof age, local(levels)
foreach l of local levels {
	ir deaths smoke pyears if age == `l',  noc noh  
	replace cat = `j' in `j'
	replace ub = ln(r(ub_irr)) in `j'
	replace lb = ln(r(lb_irr)) in `j'
	replace irr = ln(r(irr)) in `j'
	local ++j
	}
}
label define cat 1 "35-44" 2 " 45-54" 3 "55-64" 4 "65-74" 5 "75-84"
label values cat cat
eclplot irr lb ub cat, hori  xtitle("Incidence Rate Ratio") ytitle("Age")


Scott


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of roger webb
> Sent: Thursday, October 13, 2005 8:17 AM
> To: [email protected]
> Subject: st: Graphing RRs and their 95% CIs
> 
> Dear Statalist,
> 
> I have some age-specific rate ratios for suicide in recently released
> prisoners compared to the general population.
> 
> These were generated using the epitab command:
> ir suicide popn pyrs, by(ageband) istandard
> 
> Can anyone kindly recommend a Stata routine that will graph the
> RR and its 95%, preferably on the log scale?
> 
> Thanks,
> 
> Roger Webb
> University of Manchester (UK)
> 
> *
> *   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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index