Hi all,
I am doing an incidence rate calculation for an analysis. The table that I have to produce looks like this :-
ESRD Group | |||||
Number of events | Percentages | Total Person years | Incidence rate | 95% CI | |
Serious Infections | |||||
Hospitalization required | |||||
IV antibiotics required | |||||
Types of Serious Infections | |||||
Intestinal infectious diseases | |||||
Zoonotic bacterial diseases | |||||
Other bacterial diseases | |||||
Human Immunodeficiency Virus | |||||
Viral diseases accompanied by exanthema | |||||
Arthropod-borne viral diseases | |||||
Other diseases due to viruses & chlamydiae | |||||
Rickettsioses & other arthropod-borne diseases | |||||
Other spirochetal diseases | |||||
Helminthiases | |||||
Other infectious & parasitic diseases | |||||
Late effects of infectious & parasitic diseases | |||||
Opportunistic Infections |
Now, I have made a macros to look for all the codes described in this table by different catergories of serious infections which looks like this : How can i compute incidence rate after this ?
First i have to find out patients who are at risk , compute person years = (period_stop - svcdate)/365
then find patients who had an incidence of any of these infections
and then calculate incidence rate ..
how to do that ?
*STEP 1 ;
/*CALCUALTING THE NUMBER OF PATIENTS WITH THE APPLICABLE ENDPOINT (ONLY FIRST EVENT TO BE COUNTED) */
/*FLAG COMORBIDITIES */
%macro incidence ;
%do i = 1 %to 12 ;
%let inf = %scan(int*zoo*othbact*hiv*vir*arth*chly*ricket*spiro*helminth*para*late, &i., *) ;
/*intestinal infectious disease*/
%let int = %str("001","002","003","004","005","006","007","008","009") ;
/*zoonotic bacterial disease*/
%let zoo = %str("020","021","022","023","024","025","026","027") ;
/*other bacterial disease*/
%let othbact = %str("030","031","032","033","034","035","036","037","038","039","040","041");
/*hiv*/
%let hiv = %str("042") ;
/*viral diseases accompanied by exanthem*/
%let vir = %str("050","051","052","053","054","055","056","057");
/*arthropod-brone viral disease*/
%let arth = %str("060","061","062","063","064","065","066");
/*other diseases due to viruses and chlamydiae*/
%let chly = %str("070","071","072","073","074","075","076","077","078","079");
/*rickettsioses and otehr arthrpod-borne diseases*/
%let ricket = %str("080","081","082","083","084","085","086","087","088");
/*other spirochetal diseases*/
%let spiro = %str("100","101","102","103","104");
/*helminthiases*/
%let helminth = %str("120","121","123","124","125","126","127","128","129");
/*other infectious and parasitic diseases*/
%let para = %str("130","131","132","133","134","135","136");
/*late effects of infectious and parasitic diseases*/
%let late = %str("137","138","139");
%end ;
/*FLAG PATIENT WITH THE ABOVE MENTIONED COMORBIDITIES ATFTER INDEX_DATE BUT BEFORE PERIOD_STOP*/;
data _04_postindex_&inf. ;
set derived._01_ic_of_i2;
&inf. =1 ;
where (code in:(&&&inf.)) and (index_date le svcdate le period_stop) ;
run ;
proc sort data = _04_postindex_&inf. out= _04_postindex_&inf._s ;
by enrolid index_date svcdate ;
run ;
data _04_postindex2;
set _04_postindex_&inf._s ;
by enrolid svcdate ;
format first_svcdate_&inf. mmddyy10. ;
if first.enrolid then first_svcdate_&inf. = svcdate ;
run ;
/*FLAG PATIENTS WITH THE ABOVE MENTIONED COMORBIDITES BEFORE THE INDEX_DATE */
%mend incidence;
%incidence;
I'm not sure what data manipulations you need, but once you have a data set of the relevant people including the number of incidents and their person-time, you can estimate the incidence rate using PROC GENMOD as discussed and illustrated in this note.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.