# Trend test for two ordinal variables both containing three factors

I have two variables each of which have three levels (low, medium & high). I would like to be able to test whether there is a significant trend between the two variables i.e. as x goes up y goes up. The trend tests I've looked at all seem to have one variable with 2 levels and the other with n levels.

Here is an example of the frequency table of my data:

mat <- structure(c(20, 19, 6, 10, 22, 4, 0, 12, 4), .Dim = c(3L, 3L), .Dimnames = list(
c("low_1", "medium_1", "high_1"), c("low_2", "medium_2", "high_2")))


If there was a function for it in R that would be useful.

• Are you interested in assessing linear trend only (my response citing $M^2$ association test here would apply equally well), or possibly symmetry in the two-way table (e.g. quasi-symmetry for square table or quasi-uniform association, as described on this thread)? – chl Jul 18 '12 at 16:43