Please help! Trying my luck here. I'm not very knowledgable in statistics nor SAS. I am giving a Table program but have no clue where to start to calculate 95% CI, Incident Rate, and Relative Risk (95%)
1. CI95% - do I calculate 95%CI between the two treatment groups ("group1" , "group2")? I wouldn't know where else you can get lower/higher limits solely based"System Organ Class" & "Preferred Term xx" counts.
2. Incident Rate- is there a function I can use to get this value ("event incident rate per 100 person-years")?
3. Relative Risk(95%)- no idea how how i would incorporate the two 95%CI
table shell:
sample data:
subject system_organ_class preferred_term treatment_group bob lungs breathe 1 bob lungs air 1 joe lungs breath 1 joe heart pump 1 ronnie brain hub 2
Thank you
Hello @HitmonTran,
Are you working on a clinical trial? If so, you must have access to the Statistical Analysis Plan (SAP), which is the primary source of information on the statistical methods you need to apply. If in doubt, discuss questions with the Trial Statistician, the author of the SAP. The table shell shown does not provide all details that would be required for precise answers. Your sample data are even more insufficient as they don't contain any time related information, without which neither incident rates nor the relative risks (as described in the table shell) can be computed.
Here's an outline of how I would expect the statistics in question to be calculated, based on my clinical research experience:
data have;
n= 6; ae=1; output;
n=783; ae=0; output;
run;
proc freq data=have;
weight n;
tables ae / binomial(level='1' correct);
output out=ci(keep=l_bin u_bin) binomial;
run;
Whether you should apply the continuity correction to the asymptotic CI (binomial option correct) or use the exact CI (variables xl_bin, xu_bin in output dataset ci) or one of the other possible choices (see binomial option CL=) is one of those study-specific details that you need to clarify internally. Your PROC FREQ step will also contain a BY statement defining treatment group, system organ class (SOC) and preferred term (PT) as BY variables so that all calculations can be done in a single step (on an appropriately structured input dataset).incident_rate = number_of_subjects / total_years_at_risk * 100where number_of_subjects is the number of participants, say, in group 1 who experienced the adverse event (AE) in question (or any fatal AE of a particular system organ class [SOC] or any fatal AE, respectively) and total_years_at_risk is the sum of all times at risk (in years) of the participants of that group. Typically, the time at risk for an individual subject is defined as the time from treatment start to AE onset or, if the subject did not experience the AE, to end of follow-up. Again, the details are study-specific.
/* Create sample data for demonstration */
data have2;
call streaminit(27182818);
do group=1 to 2;
do _n_=1 to 789;
fu_time=rand('uniform');
log_fu_time=log(fu_time);
num_ae=rand('bern',fu_time*exp(-3.45+0.67*(group=1)));
output;
end;
end;
run;
/* Perform Poisson regression */
proc genmod data=have2;
class group(ref='2' param=ref);
model num_ae=group / d=poisson offset=log_fu_time;
estimate 'relrisk' group 1;
ods output Estimates=relrisk(keep=Mean:);
run;
As for the other items, BY-group processing would be used to perform the calculations for all PTs, SOCs and overall in one PROC GENMOD step. Again, details are study-specific. For example, there is evidence that a modified Poisson regression model proposed by Guangyong Zou 2004 (using a robust error variance) yields a more appropriate (less conservative) confidence interval for the relative risk. See, e.g., https://support.sas.com/kb/23/003.html or Proper Estimation of Relative Risk Using PROC GENMOD in Population Studies for more details including the (fairly simple) implementation by means of a REPEATED statement in the PROC GENMOD step.It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.