Hi,
I have a population of people with diagnosed end-stage renal disease (ESRD). The data comes from a national registry of people with ESRD, established in 1960.
I am estimating annual rates of amputations in this population between 2000 and 2015, age-standardised.
Below I provide the code I have used to obtain this data.
stset dox1, fail(lea1==1) origin(born) entry (entry) scale(365.25) id(usrds_id)
stsplit _year, after(time=d(1/1/2000)) at(0(1)15) trim
replace _year=2000 + _year
gen pop = 1
gen agecat = .
replace agecat = 1 if _t0>17 & _t0<45
replace agecat = 2 if _t0>=45 & _t0<65
replace agecat = 3 if _t0>=65 & _t0<75
replace agecat = 4 if _t0>=75 & _t0<.
collapse (sum) pop lea1, by(_year agecat)
where dox1 is date of exit (either date of amputation, date of death or 31december 2015, whichever occurred first)
lea1 = amputation event
entry = 01 january 2000 or date of ESRD registration if thereafter
Once i have counts of amputations and 'population at risk' by year and agegroup, i run the following command to obtain age-standardised results by year:
foreach x of varlist lea1 {
set more off
qui dstdize `x' pop agecat, by(_year) using("2000_pop")
putexcel set lea.xlsx, sheet("`x'", replace) modify
matrix C = r(Nobs)', r(crude)'*1000, r(adj)'*1000, r(lb_adj)'*1000, r(ub_adj)'*1000, r(se)'*1000
matrix rowname C = 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
matrix list C
putexcel A1=("year") B1=("pop") C1=("`x'crude") D1=("`x'Rate") E1=("`x'LL") F1=("`x'UL") G1=("`x'SE") A2=matrix(C, rownames)
}
Overall - i show that between 2000 and 2009, rates of amputation declined but thereafter, they did not change. I am trying to explore possible reasons for this. One element i want to explore is disease duration, i.e. with increased survival in this population (leading to increased disease duration), is the 'population at risk' in more recent years different to those in earlier years such that amputations are less likely?
My question: people in my dataset have varying degrees of disease duration (with respect to date of ESRD diagnosis to dox1). On average, disease duration increased 2 years between 2000 and 2015. Is there a way to 'adjust/standardize' for disease duration in this dataset?
Many thanks
Jess
I have a population of people with diagnosed end-stage renal disease (ESRD). The data comes from a national registry of people with ESRD, established in 1960.
I am estimating annual rates of amputations in this population between 2000 and 2015, age-standardised.
Below I provide the code I have used to obtain this data.
stset dox1, fail(lea1==1) origin(born) entry (entry) scale(365.25) id(usrds_id)
stsplit _year, after(time=d(1/1/2000)) at(0(1)15) trim
replace _year=2000 + _year
gen pop = 1
gen agecat = .
replace agecat = 1 if _t0>17 & _t0<45
replace agecat = 2 if _t0>=45 & _t0<65
replace agecat = 3 if _t0>=65 & _t0<75
replace agecat = 4 if _t0>=75 & _t0<.
collapse (sum) pop lea1, by(_year agecat)
where dox1 is date of exit (either date of amputation, date of death or 31december 2015, whichever occurred first)
lea1 = amputation event
entry = 01 january 2000 or date of ESRD registration if thereafter
Once i have counts of amputations and 'population at risk' by year and agegroup, i run the following command to obtain age-standardised results by year:
foreach x of varlist lea1 {
set more off
qui dstdize `x' pop agecat, by(_year) using("2000_pop")
putexcel set lea.xlsx, sheet("`x'", replace) modify
matrix C = r(Nobs)', r(crude)'*1000, r(adj)'*1000, r(lb_adj)'*1000, r(ub_adj)'*1000, r(se)'*1000
matrix rowname C = 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
matrix list C
putexcel A1=("year") B1=("pop") C1=("`x'crude") D1=("`x'Rate") E1=("`x'LL") F1=("`x'UL") G1=("`x'SE") A2=matrix(C, rownames)
}
Overall - i show that between 2000 and 2009, rates of amputation declined but thereafter, they did not change. I am trying to explore possible reasons for this. One element i want to explore is disease duration, i.e. with increased survival in this population (leading to increased disease duration), is the 'population at risk' in more recent years different to those in earlier years such that amputations are less likely?
My question: people in my dataset have varying degrees of disease duration (with respect to date of ESRD diagnosis to dox1). On average, disease duration increased 2 years between 2000 and 2015. Is there a way to 'adjust/standardize' for disease duration in this dataset?
Many thanks
Jess
Comment