BookmarkSubscribeRSS Feed
MABRINCH
Fluorite | Level 6

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

20103.86
20114.89
20124.91
20134.92
20145.96
20156.02
20166.67
20175.62
20186.04
20196.43
2 REPLIES 2
Sajid01
Meteorite | Level 14

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. 

Sajid01_0-1623846656371.png

Make necessary changes as you may need.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1232 views
  • 1 like
  • 3 in conversation