Programming the statistical procedures from SAS

Trend test for Incidence

Posts: 59

Trend test for Incidence

Hi all,

I am looking for an accurate test/ SAS procedure to detect trends over the years for an Incidence.


I posted the same question earlier, and I got a reply about Kendal Tau b. Not sure if this is a correct method. Can anyone please guide me with this? I also used Cochran Armitage Trend Test. Results from Cochran Armitage Trend test are different from Kendal Tau b test. Is Kendal Tau b dependent on the number of observations rather than differences over the years?


For Kendal Tau b I used the incidence rate. For Cochran Armitage Trend test, I used numerator as pts with Non-HIV_Cases and denominator as Non-HIV_Controls (this is difference of total population and Non-HIV_Cases)


Also my denominators are too big compared to the numerators.



*Kendal Tau B for time series trends;
proc corr data=APC_Test kendall;
var year; with Incidence_HIV;

 data APC_Trend1;
      input Year Inci $ Count @@;
   0 No 35752577   0 Yes  188
   1 No 35985413   1 Yes  169
   2 No 36246644   2 Yes  178
   3 No 36552387   3 Yes  142
   4 No 36856068   4 Yes  154
   5 No 37077061   5 Yes  143
   6 No 37318335   6 Yes  146

    proc freq data=APC_Trend1;
      weight Count;
      tables Year*Inci / trend measures cl;
      test smdcr;
      exact trend / maxtime=60;



Super User
Posts: 11,810

Re: Trend test for Incidence

Posted in reply to smunigala

Please define "accurate" in this context.

Also, what do want to know about your "trend"? Is there one? How much change and in which direction? Did it increase or decrease?

Also are your "years" sequential and just adjusted to be such as baseline and then each subsequent year or is there some other meaning?



Posts: 59

Re: Trend test for Incidence

Thanks for the reply. Yes, the years are consecutive, 2004 to 2010. I see a drop in the incidence of Incidence_Non-HIV and Incidence_HIV, I want to know if there is a significant drop in the incidence from 2004 to 2010. What would be the ideal test to check the signficance (p-value). I have attached my excel sheet. I have labeled the variables accordingly. Incidence/ 100000 is calculated from Non HIV_Cases and Total_Population and HIV_Cases and Total_Population.

Super User
Posts: 11,810

Re: Trend test for Incidence

Posted in reply to smunigala

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.


A SAS data set can be turned into datastep code that can be pasted here as text by following the instructions here:


I might calculate a standardized incidence = characteristic of interest/ population total standardized to something like per 100,000

The a rough pass through proc reg with model incidence = year .

The results will show a slope parameter (annual rate of change) , and a p-value for whether that slope parameter is signficant  and an r-square (roughly how much of the dependent variablilty is explained by the model).


However before actually using a simple regression you should see if the there is correlation between the data years.


Or check to see if you have SAS/ETS available as you data is a time series.

Ask a Question
Discussion stats
  • 3 replies
  • 1 like
  • 2 in conversation