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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.