Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Non-parametric test equivalents with survey-weighted data

From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Non-parametric test equivalents with survey-weighted data
Date   Sun, 7 Aug 2011 11:11:44 -0400


To expand a bit. Roger's -cendif-, part of -somersd-, will calculate "confidence intervals for generalized Hodges-Lehmann median differences, and other percentile differences, between values of a Y-variable in depvar for a pair of observations chosen at random from two groups A and B."  Obviously if the CI excludes zero, reject the null hypothesis.  Note that "median difference" is not the same as "difference in medians".  Although the H-L test is not one of Stata's built-in nonparametric tests, it appears in the SAS NPAR1WAY procedure. Your notion that clustering "doesn't matter" for rank tests is incorrect; an ordinary rank test (without weights) that ignored clustering would produce wrong results.


On Aug 6, 2011, at 1:51 PM, Roger Newson wrote:

The -somersd- package can be downloaded from SSC, and can be used to do rank statistics for clustered and/or sampling-probability weighted data. There is also a package -scsomersd- which calls the -somersd- package to do scenario comparisons in rank statistics. Both of these packages produce confidence intervals, not just P-values. The on-line help for -somersd- contains references to papers on the subject, published in The Stata Journal.

I hope this helps.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 05/08/2011 17:00, Janet Rosenbaum wrote:
> Frequently I use kwallis, ranksum, or nptrend for testing between
> groups, depending on the nature of the variables involved.  Stata
> doen't support these tests in survey-weighted data.
> Are there any equivalent tests to use when comparing weighted data?
> Survey-weighted data can use Pearson's chi-square or Wald, but my
> understanding is that neither is equivalent.
> As background, the weights are inverse probability weights derived
> from a propensity score model.  I have a cluster variable, but as far
> as I know that doesn't matter with non-parametric tests anyhow.
> Thanks for any thoughts,
> Janet
> Janet Rosenbaum, Ph.D.
> Assistant Professor
> University of Maryland, College Park.
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index