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]

st: Combining m & f gamma confidence intervals to generate persons gamma confidence intervals using -distrate-


From   Tim Evans <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: Combining m & f gamma confidence intervals to generate persons gamma confidence intervals using -distrate-
Date   Thu, 24 May 2012 09:57:40 +0100

Hi,

I'm using -distrate- (which) is a user written package) in Stata 11.2 for the purpose of calculating age standardised incidence rates and confidence intervals using the gamma method. I first calculate male and then female rates and CIs. What I want to do is combine the rates and confidence intervals in order to obtain age-sex standardised person rates. However, I'm a little unsure that I am generating the persons (gamma) LCI and UCI correctly. My code is below and any tips would be appreciated - let me know if more information is needed.

* LOAD FEMALE DATA (INCIDENCE OR MORTALITY NUMBERS & POPULATIONS FOR AREAS OF INTEREST)

use "female_data_1.dta", clear
sort age_grp 

* CALCULATE RATES WITH DISTRATE

distrate count f_pop using "europopfull.dta", stand(age_grp) mult(100000) saving(dist_f_1.dta, replace)

use dist_f_1.dta, clear

foreach var of varlist  count -  ub_dob {
rename `var' `var'_f
}

save "dist_f_1.dta", replace

* LOAD MALE DATA (INCIDENCE OR MORTALITY NUMBERS & POPULATIONS FOR AREAS OF INTEREST)

use "male_data_1.dta", clear
sort age_grp

* CALCULATE RATES WITH DISTRATE

distrate count m_pop using "europopfull.dta", stand(age_grp) mult(100000) saving(dist_m_1.dta, replace)

use dist_m_1.dta, clear
foreach var of varlist  count -  ub_dob {
rename `var' `var'_m
}


*MERGE WITH FEMALE RESULTS

merge using "dist_f_1.dta"

*PERSONS

gen rateadj_p = 0.5*(rateadj_f+rateadj_m)
gen Leffse = 0.5*sqrt(((rateadj_f-lb_f)/1.96)^2 + ((rateadj_m-lb_m)/1.96)^2)
gen lb_p = rateadj_p - 1.96*Leffse
gen Ueffse = 0.5*sqrt(((ub_f-rateadj_f)/1.96)^2 + ((ub_m-rateadj_m)/1.96)^2)
gen ub_p= rateadj_p + 1.96*Ueffse

or should it be:
 something like:

gen pGLCI = rateadj_p -(0/2)*sqrt(((rateadj_m - lb_gam_m)/0)^2 + ((rateadj_f - lb_gam_f)/0)^2)
gen pGUCI = rateadj_p +(0/2)*sqrt((lb_gam_m - rateadj_m)/0)^2+((lb_gam_f - rateadj_f)/0)^2)

Best wishes

Tim
_DISCLAIMER:
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.


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