Calculate p trends The following table shows the averages of the response variables var1, var2, var3 with respect to the explanatory variable divided in quartiles.
                                Explanatory variable (Quartiles)
Response variables  Q1 < 347    347 ≤ Q2 < 416  416 ≤ Q3 < 480  Q4 ≥ 480
Var 1                 4952           4882            4759         4503
Var 2                 2.26           1.76            1.75         1.59
Var 3                 73.42          73.45           73.22        74.01

It has been suggested to add an extra column showing the p trends...I know what is the p value, but I have never heard "p-trend"...what is that? Any idea how to calculate using Matlab?
Thanks
 A: Maybe the suggester meant "the p value of the trends", in which case you could calculate a spearman-rho or kendall-tau rank correlation between your variables and (1, 2, 3, 4). It won't be too informative with only four data points, though.
I would prefer $\rho$ or $\tau$ over, say, pearson-r because they do not presuppose linearity.
For instance, here is how you can test Spearman's correlation between the quartiles (1, 2, 3, 4) and your Var1 in R:
> cor.test(1:4,c(4952,4882,4759,4503),method="spearman")

        Spearman's rank correlation rho

data:  1:4 and c(4952, 4882, 4759, 4503)
S = 20, p-value = 0.08333
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho 
 -1

Since your Var1 and Var2 both decrease monotonically and both $\rho$ and $\tau$ only care about ranks, you will get $\rho=\tau=-1$ for both Var1 and Var2, and always $p=0.0833$, since the p value only depends on the correlation estimate and the sample size (which is 4 here). Var3 is not monotonic, and I get $\rho=0.4$, $\tau=0.33$, with $p=0.75$ in both cases.
