1
$\begingroup$

I want to use mk.test() function to test whether my data has a linear trend, but why — no matter how the set of data changes — are the p-values all the same?

library("trend")
mk.test(c(1,22,36,90))
    
    data:  c(1, 22, 36, 90)
    z = 1.6984, n = 4, p-value
    = 0.08943
    alternative hypothesis: true S is not equal to 0
    sample estimates:
           S     varS      tau 
    6.000000 8.666667 1.000000 
    
    
mk.test(c(1,2,3,4))
    
    data:  c(1, 2, 3, 4)
    z = 1.6984, n = 4, p-value
    = 0.08943
    alternative hypothesis: true S is not equal to 0
    sample estimates:
           S     varS      tau 
    6.000000 8.666667 1.000000 
    
mk.test(c(1,20,33,49))
    
    data:  c(1, 20, 33, 49)
    z = 1.6984, n = 4, p-value
    = 0.08943
    alternative hypothesis: true S is not equal to 0
    sample estimates:
           S     varS      tau 
    6.000000 8.666667 1.000000 
$\endgroup$

1 Answer 1

1
$\begingroup$

The p-value is a number that describes how likely you are to have found a particular set of observations if the null hypothesis were true.

All your data examples are very short and in increasing order, so the p-value is almost zero. It means, that the null hypothesis (no relationship) with your data is highly improbable (i.e. have to be rejected).

Give more values or change the order of them.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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