How to perform Jonckheere-Terpstra Test?
When you choose to analyse your data using a Jonckheere-Terpstra test, part of the process involves checking to make sure that the data you want to analyse can actually be analysed using a Jonckheere-Terpstra test. You need to do this because it is only appropriate to use a Jonckheere-Terpstra test if your data "passes" six assumptions that are required for a Jonckheere-Terpstra test to give you a valid result.
Before we introduce you to these six assumptions, do not be surprised if, when analysing your own data using SPSS Statistics, one or more of these assumptions is violated (i.e., is not met). This is not uncommon when working with real-world data rather than textbook examples, which often only show you how to carry out a Jonckheere-Terpstra test when everything goes well! However, don’t worry. Even when your data fails certain assumptions, there is often a solution to overcome this.
1. Check Assumption
- Yes-Assumption #1: Your dependent variable should be measured at the ordinal or continuous level. "Expression"
- Yes-Assumption #2: Your independent variable should consist of two or more ordinal, independent groups. "SS/SL/LL"
- Yes-Assumption #3: You should have independence of observations, which means that there is no relationship between the observations in each group or between the groups themselves.
- ? -Assumption #4: In order to know how to interpret the results from a Jonckheere-Terpstra test, you have to determine whether the distributions in each group (i.e., the distribution of scores for each group of the independent variable) have the same shape and the same variability. That is, the distributions of the scores must be the same with the only possible difference being a shift in location (i.e., scores can be higher or lower in some groups, but the distribution of the scores remains the same). This allows you to use the Jonckheere-Terpstra test as a test of medians.
- Yes-Assumption #5: You need to predict, a priori, the order of the groups of the independent variable when running the Jonckheere-Terpstra test (i.e., the term, "a priori", simply means that you have to predict this order "before" you collect your data, typically when you set the research questions/hypotheses for your study). This will most likely be the ordered groups of the ordinal independent variable.
- Yes -Assumption #6: You need to predict, "a priori", the direction of the alternative hypothesis. When we refer to predicting the "direction of the alternative hypothesis", this means that you need to predict whether the medians increase or decrease as the groups of the ordinal variables increase or decrease. e.g. we would have the prediction before looking at the data that "job satisfaction will increase with higher job position". We can have two sided test or have a priori to do a fix sided test.
2. Run in R
jonckheere.test(x, g, alternative = c("two.sided", "increasing", "decreasing"), nperm=NULL)
The exact calculation of p-value requires that there be no ties and that the sample size is less than 100. When data are tied and sample size is at most 100 permutation p-value (approximate) is returned.
nperm: number of permutations for the reference distribution (# of sample times to get the approximate p-value). The default is null in which case the permutation p-value is not computed. Recommend that the user set nperm to be 1000 or higher if permutation p-value is desired.
(Permutation is a group of things, which the order of things matters. 'abc' != 'cba')
JT statistics:
mu <- (N^2 - (n1^2 + n2^2 + n3^2 + n4^2))/4
s