7
$\begingroup$

Let say I've a contigency table as :

           score
           <=2  [3-4]  >=5
no_event   248    796  288
event       71    419  285

I computed the percentage of events for each score category (<=2, [3-4] and >=5). Hereby the plot (top of each bar displays the number of events / (events+no_event) .

enter image description here

I would like to test if the increase in proportion between >2 -> [3-4] -> >=5 is significative.

My first idea would be to use a chisq or fisher exact test.

 m <- matrix(c(248,71,796,419,288,285),ncol=3)
 fisher.test(m)$p.value
 [1] 9.640235e-17

However this test didn't take into account the order of the categories >2 -> [3-4] -> >=5

Any ideas ?

Thank you

$\endgroup$
0
$\begingroup$

One is to use a Cochran Armitage trend test. There is an implementation in R. I suppose you are interested in event vs non-event, so you need to flip your matrix:

library(DescTools)
m <- matrix(c(71,248,419,796,285,288),ncol=3)
CochranArmitageTest(m)

Cochran-Armitage test for trend

data:  m
Z = 8.5195, dim = 3, p-value < 2.2e-16
alternative hypothesis: two.sided

Since you have two groups, and you know the average score in event is higher, you can also test the difference of the scores using a wilcoxon:

event_scores =  rep(1:3,m[1,])
noevent_scores =  rep(1:3,m[2,])

wilcox.test(event_scores,noevent_scores)

    Wilcoxon rank sum test with continuity correction

data:  event_scores and noevent_scores
W = 618058, p-value < 2.2e-16
alternative hypothesis: true location shift is not equal to 0
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.