Hi
I would like to calculate the APC annual percentage change with 95% CI for the crude incidence of a disease in the period 2010 til 2019. Is it necessary to use joinpoint software? (which I have no clue on how to work with).
I have following data
year incidence rate
2010 | 3.86 |
2011 | 4.89 |
2012 | 4.91 |
2013 | 4.92 |
2014 | 5.96 |
2015 | 6.02 |
2016 | 6.67 |
2017 | 5.62 |
2018 | 6.04 |
2019 | 6.43 |
I think you can try this code.
https://communities.sas.com/t5/SAS-Procedures/Annual-Percentage-Change-with-95-CIs/td-p/329864
Hello @MABRINCH
The following code will perform what you need.
In the code IR =Incidence rate and per_ch =percentage change;
data test;
input @1 year @6 IR;
ch_ir=ir-lag(ir);
datalines;
2010 3.86
2011 4.89
2012 4.91
2013 4.92
2014 5.96
2015 6.02
2016 6.67
2017 5.62
2018 6.04
2019 6.43
;
run;
proc sql;
select sum(ir) into:sum_ir from test;
run;
data test2 (drop=ch_ir);
Retain Year IR per_ch;
format per_ch z5.2;
set test;
per_ch=ch_ir*100/&sum_ir;
run;
The output will be like this.
Make necessary changes as you may need.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.