BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
smunigala
Obsidian | Level 7

 

Hi,

I need advice about how to calculate a significance test (trend test) for comparing the incidence rates over the years. I need to comment on whether there is a significant increase or decreas (with p-value for a trend) for incidence rates over the years.

 

Please see the attached data. My denominator for incidence is 100,000 for all.

 

I would really appreciate if anyone can help me with the SAS code.

 

Thanks,

Satish

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

A popular test for detecting trends in timeseries is the Kendall Tau-b correlation, available in proc corr and proc freq :

 


proc corr data=trendtest kendall;
var year; with amortality_pan;
run;

 

 

PG

View solution in original post

12 REPLIES 12
Steelers_In_DC
Barite | Level 11

You should give more information regarding the calculations.  While I'm sure there are several that know exactly what you want I do no. 

smunigala
Obsidian | Level 7

Thanks for the reply. The incidence rates are the trends for acute pancreatitis deaths nationally over the years. I wanted to know if there is an increase or decrease in trend over the years. The incidence rates are adjusted for 2010 population (national US population).

 

 

PGStats
Opal | Level 21

What have you tried, so far?

PG
smunigala
Obsidian | Level 7

I have not done the trend test for comparing rates over the years to check for significance. However, I did Cochran- Armitage Trend test previously for categorical variable. So I am not sure how to do this. I looked up some online blogs about linear regression analysis but not entirely sure. I hope this helps.

 

Thanks!

PGStats
Opal | Level 21

A popular test for detecting trends in timeseries is the Kendall Tau-b correlation, available in proc corr and proc freq :

 


proc corr data=trendtest kendall;
var year; with amortality_pan;
run;

 

 

PG
Totoro
Calcite | Level 5

Hi, I have a similar question like this. After doing this step, how could I interpret the 0.4463? What is the trend for the data? Since the prevalence or the incidence are not normally distributed, could I just use Simple Regression Model and get the coefficient for the trend? Or is there any other suggestion for this situation? I have a sample data like below. Thanks a lot. 

Kendall Tau b Correlation Coefficients, N = 41
Prob > |tau| under H0: Tau=0

 

Year

Prevalence

0.44634
<.0001

YearPrevalence
197416.943
197519.6
197618.934
197718.48
197819.924
197912.369
198017.302
198115.954
198216.75
198317.184
198417.722
198519.008
198618.452
198716.744
198817.029
198917.643
199017.179
PGStats
Opal | Level 21

You will get a lot more attention if you submit your question as a new topic.

 

You can get a robust estimate of the slope called Sen's slope (or the Kendall slope estimator) as:

 

proc sql;
create table slope as
select 
    median( (b.prevalence-a.prevalence) / (b.year-a.year) ) as senSlope
from
    myData as a inner join 
    myData as b on a.year < b.year;
select * from slope;
quit;
PG
smunigala
Obsidian | Level 7

HI PGStats,

Can you please respond to my other post "Trend Test for Incidence"

 

Thanks you!

Totoro
Calcite | Level 5

Thanks a lot. It works and report a number 0.189. Could I interpret 0.189 as each year the prevalence is increasing 0.189 (the annual year of change). Is that correct? I really appreciate for your help.

 

 

PGStats
Opal | Level 21

I( guess so. But I haven't seen your code, or your full dataset. Make sure you understand what you are doing.

PG
PGStats
Opal | Level 21

Did something happen around 2001?

 

SGPlot1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If so you should test before and after separately:

 

libname xl Excel "&sasforum.\Datasets\Trendtest.xlsx" access=readonly;

proc sql;
create table trendtest as
select *, year>=2001 as period from xl.'Sheet1$'n;
quit;

proc sgplot data=trendtest;
scatter x=year y=amortality_pan;
refline 2001 / axis=x;
run;

proc corr data=trendtest kendall;
by period;
var year; with amortality_pan;
run;
PG
smunigala
Obsidian | Level 7

Hi PGStats,

Thanks for the response. I am not sure if there was anything significant in 2001 but recently over the years, the trends decreased due to improved diagnostic tests.

 

Satish

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 12 replies
  • 12973 views
  • 2 likes
  • 4 in conversation