I am having a conceptual problem, of not being able to grasp whether my data is paired or unpaired. I have to test for the mean and median differences between two sets of data: SBP and GICS (see picture). The sample population is 1,500 firms for all years from 2004 to 2018. The firms are not necessarily the same, i.e. the 1,500 firms in 2005 are slightly different ones in 2006. From this population, both the SBP and GICS creates groupings of 10 from the 1,500 firms - but do it differently.
After the SBP and GICS have created the groupings, they take an average of the group - which becomes the variable/observation for each system (technically, this is an absolute percentage error). The goal is to look at which grouping system generates the lowest absolute percentage error. I have tried to illustrate it with the following:
My initial thought was that the SBP and GICS were unpaired; i.e. there was no "before vs. after" medical treatment effect, since both "systems" does the exact same thing: to create groupings of 10. What matters is, how they select the 10 firms for each group. Can someone help?
I was left wondering this, when I tried to run the tests in R. The sample median and mean values of the SBP and GICS are the following:
If we take the "simple" difference of the median, it is clearly 1.5% and 2.2% for the simple mean. My understanding is, that when I calculate the statistical pairwise difference (unreported from the figure), this value should be LOWER than the "simple" difference. Running the wilcox.test
in R, with the following code:
wilcox.test(GICS, SBP, alternative = "two.sided", mu=0, conf.int=T, conf.level = 0.99, paired = TRUE
gives me a pairwise difference of 1.9%, where I am left wondering, why I can be in a situation where the pseudo median (population estimator) of a Wilcoxon signed rank test, can be larger than the simple differences between sample medians? I am performing a paired signed rank test, since my data is dependent.
I have uploaded my dataset here: Dataset as a .csv
file.
Can someone help my understanding?
My main questions summarized:
- (1) Is my sample paired or unpaired?
- (2) By running the Wilcoxon signed rank test and Student t-test, can the generated pseudo median (or mean) EVER be larger, than the simple difference between sample medians and means?
EDIT: Running the Wilcoxon test as paired, i.e. pair=TRUE
, gives me a pseudo median of 1.513%.