0

I have some data that is highly skewed. I want to test whether the median of the data is different from 1, so I decided to use a Wilcoxon Signed Rank test.

The description and implementation of this test in Stata and SAS is given here:

http://www.ats.ucla.edu/stat/sas/whatstat/whatstat.htm#1sampm

http://www.ats.ucla.edu/stat/stata/whatstat/whatstat.htm#1sampm

There's no Z-Score reported in SAS, only an 'S' stat and a p-value. I need to report a statistic, but the 'S' stat reported by SAS looks like a variance or something.

Is there something else going on here? I think both the SAS and Stata examples on this page use the same 'hsb2' dataset available from http://www.ats.ucla.edu/stat/data/hsb2.sas7bdat so the results should be the same.

user2146441
  • 255
  • 1
  • 8
  • 3
    The null-hypothesis of the Wilcoxon Signed Rank test is not in terms of means, so it is probably the wrong test to use for your null-hypothesis. – Maarten Buis Nov 25 '13 at 11:28
  • You have cross-posted a similar question on Stack Overflow at http://stackoverflow.com/questions/20190745/getting-sas-to-output-a-z-score-for-a-wilcoxon-signed-ranks-test Advice is explicit: Please don't do that. http://stats.stackexchange.com/help/on-topic – Nick Cox Nov 25 '13 at 11:35
  • Apologies: I want to test that the median is different from 1. I've edited the question accordingly. And also deleted the cross-post. – user2146441 Nov 25 '13 at 11:58
  • You might want to read [this](http://stats.stackexchange.com/a/76380/3277) answer with comments to it, where the the null hypothesis for Wilcoxon is discussed – ttnphns Nov 25 '13 at 12:58
  • your link to the data doesn't work for me. – Glen_b Nov 26 '13 at 02:29
  • I just checked and edited the link address there. – user2146441 Nov 26 '13 at 08:52

2 Answers2

1

You could see either (i) a straight [signed rank statistic]( In moderate to large samples, the z-value is more interpretable, but the p-value should be (about) the same in either case. )$^{[1]}$, or (ii) a signed rank statistic which has been standardized by subtracting the mean and then dividing by the standard deviation under of the signed rank statistic the null hypothesis (yielding a z-value).

In moderate to large samples, the z-value is more interpretable, but the p-value should be (about) the same in either case.

The quantity S you're seeing is no doubt some version of the signed rank statistic; the z value is very likely the corresponding standardized version.

$[1]$ - which (ties aside) will take integer values, and for large samples they could be large numbers. In fact, there can also be several different statistics that might be presented as being the signed rank statistic, but (while different in value) are all reasonably simple to translate between, and all yield the same two-tailed p-value

Glen_b
  • 257,508
  • 32
  • 553
  • 939
0

First S is a test statistic, so you can report that. The reasons that people prefer z are 1) that it is more familiar and 2) that it is scaled (so that larger data sets don't have an almost automatically larger value.

Second, SAS gives a t-statistic (4.14 in the example) which can be used just like the z-statistic given by Stata (4.13 in the example). I am not sure why Stata gives z and SAS gives t, but it will only make a big difference with relatively small N.

So, actually (at least from the examples you posted) SAS gives more information.

Nick Cox
  • 48,377
  • 8
  • 110
  • 156
Peter Flom
  • 94,055
  • 35
  • 143
  • 276
  • The dataset is quite large, so the S statistic is in the order of 60000 for some categories. As regards using the t-statistic that SAS reports, I am reporting a t-stat for a test of difference in means and want to report the result of a Signed Rank test also, so I don't want to report the t-statistic twice. Should I manually scale the S statistic if there's no other way to request it in SAS? – user2146441 Nov 25 '13 at 12:01
  • I think (but am not sure) that the z that Stata reports is also about the mean, not the median. I don't use Stata. You'd have to dig deeper than the links you gave to be sure. See [Wikipedia](http://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test) for some info. – Peter Flom Nov 25 '13 at 12:17
  • @Peter Flom Not so. The procedure for Stata's `signrank` takes no account of the mean (which would be bizarre at best). Definitions and formulas, including that for $z$, accessible to all at http://www.stata.com/manuals13/rsignrank.pdf – Nick Cox Nov 26 '13 at 13:37
  • OK, @NickCox I sit corrected. – Peter Flom Nov 26 '13 at 18:11
  • That's OK. As you say you don't use Stata. What's relatively recent is that the complete Stata documentation is accessible to all via the website. There's little reason to suppose that non-Stata users would know that. – Nick Cox Nov 26 '13 at 18:15