Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: New version of -somersd- on SSC

From   Roger Newson <>
Subject   st: New version of -somersd- on SSC
Date   Fri, 12 Aug 2005 15:44:39 +0100

Hello All

Thanks to Kit Baum, a new version of the -somersd- package is available for download from SSC. In Stata, use the -ssc- command to do this.

The -somersd- package is described as below on my website. The new version is much more time-efficient with large datasets (1000 observations or more), as it uses a search tree algorithm based on Newson (1987), which calculates the estimates and jackknife variances in a time of order N*log(N), where N is the number of observations. This is in contrast to a time of order N^2 using the previous version of -somersd-, or to a time of order N^3 using the official Stata command -ktau- prefixed with -jackknife:-. The new version also adds an option -notree-, so that users can use the old quadratic-time algorithm if they want to, and can therefore see for themselves the difference in performance. The manual -somersd.pdf-, distributed with -somersd-, has been updated to document the changes.

I would like to thank John Moran of The Queen Elizabeth Hospital, Woodville, South Australia for his encouraging feedback on the previous version of -somersd-, and Bill Gould of StataCorp for his very helpful advice about naming conventions in Mata. I would also like to thank all at StataCorp for giving us the Mata language, whose awesome power I am only now beginning to tap into. The -uniqrows()-, -panelsetup()-, -st_view()- and -st_subview- functions were very helpful in programming the new -somersd-, and made the job much easier than writing the earlier versions of my search tree algorithm in Pascal and FORTRAN77.

Best wishes



Newson RB. An analysis of cinematographic cell division data using U-statistics [DPhil thesis]. Brighton, UK: Sussex University: 1987.

package somersd from

somersd: Kendall's tau-a, Somers' D and median differences

The somersd package contains the programs somersd and cendif, which
calculate confidence intervals for the parameters behind rank or
"nonparametric" statistics. The program somersd calculates confidence
intervals for Kendall's tau-a or Somers' D, and stores the estimates and
their covariance matrix as estimation results. It can be used on
left-censored, right-censored, clustered and/or stratified data.
The program cendif calculates confidence intervals for Hodges-Lehmann
median differences (or other percentile differences) between two groups.
Kendall's tau-a is a difference between probabilities of concordance and
discordance, and measures rank order correlation. Somers' D is a parameter
equal to zero under the null hypothesis tested by the Wilcoxon-Mann-Whitney
or Breslow-Gehan ranksum test, and can be used to calculate confidence
intervals for Harrell's c index, for areas under receiver operating
characteristic (ROC) curves, for differences between Harrell's c indices
or ROC areas, or for Gini coefficients. The Hodges-Lehmann median difference
can be defined in terms of Somers' D, and is also zero under the null
hypothesis tested by the ranksum test. Full documentation of the two programs
(including methods and formulas) can be found in the ancillary files
somersd.pdf and cendif.pdf, which can be viewed using the Adobe Acrobat

Author: Roger Newson
Distribution-date: 12 August 2005
Stata-version: 9

INSTALLATION FILES (click here to install)

ANCILLARY FILES (click here to get)
(click here to return to the previous screen)

Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605

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

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index