Search code examples
medianpspp

PSPP: How can I perform a Wilcoxon test against a single reference value


I am using PSPP and want to compare a sample's median against a given median value but all the options I find compare two variables against each other. I have tried a workaround by definining a variable that's filled with my reference value:

NPAR TEST /Wilcoxon [Variable of my actual data set] WITH [Variable filled with my reference value].

NPAR TEST /SIGN [Variable of my actual data set] WITH [Variable filled with my reference value].

But this is a) a dodgy workaround, and b) the results are nowhere near the Wilcoxon test result I get with SPSS.

What would be the correct syntax, or a better workaround?


Solution

  • As far as I can see PSPP does not have direct implementation for this, however your workaround of comparing to a sample with a constant value set to the median appears to be correct rather than "a dodgy workaround".

    This is confirmed in this IBM answer to the same question regarding SPSS:

    The one-sample Wilcoxon test can also be handled as a special case of the Wilcoxon matched pairs test, with the second variable being a constant value equal to the null hypothesized value against which you want to test. Simply compute a constant variable, then use that along with your variable of interest in the paired samples test. For a discussion of why this is legitimate, refer to a nonparametric statistics text such as Section 5.1 of W. J. Conover's (1971) Practical Nonparametric Statistics (Wiley).

    I don't have access to that textbook to check their answer, but I would consider IBM a reliable source anyway. I do not know why you would have found A different result using this method, it seems to behave correctly when I try it: perhaps double check you entered the data in the same way under SPSS and PSPP?