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.