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

AW: st: test difference in quintiles

From   "Martin Weiss" <>
To   <>
Subject   AW: st: test difference in quintiles
Date   Thu, 11 Jun 2009 16:59:01 +0200


Susanne asked me privately for further advice and also mentioned that she
could not figure out the implementation of Roger`s post. From what I
understand, the solution proposed by Roger should look like:

set obs 10000
capt ssc inst invcise
capt ssc inst parmest

gen x= rnormal()

no systematic 
difference btw groups

gen byte condition=/* 
*/ runiform()<0.5

/*just to check 
plausibility of results */ 
by con, sort : /* 
*/ summarize x, detail

statsby N=r(N) p5=r(c_1) /* 
*/ p5min=r(lb_1) p5max=r(ub_1),/* 
*/  by(condition)/* 
*/  clear: centile x, c(5)
invcise p5min p5max, /* 
 */ stderr(icse)
metaparm [iweight=(cond==1)-(cond==0)],/*
 */ norestore sumvar(N)/* 
 */ estimate(p5) stderr(icse)

list, noobs


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Newson, Roger B
Gesendet: Donnerstag, 11. Juni 2009 10:45
An: ''
Betreff: RE: st: test difference in quintiles

Thanks to Samuel for the promotion. However, -cendif- computes confidence
intervals, not for differences between percentiles, but for percentile
differences. These are not exactly the same thing. For a counterexample, see
Newson (2008).

If Suzanne wants confidence intervals for the differences between 2 5th
percentiles for 2 subpopulations, then Suzanne should probably use the
-centile- command to get confidence intervals for the 2 5th percentiles, and
then use the -invcise- package and the -metaparm- module of the -parmest-
package, downloadable from SSC, to get a confidence interval for the
difference between the 2 5th percentiles. The -invcise- package calculates
standard errors using the inverse confidence interval method.

I hope this helps.

Best wishes



Newson, R. B. Hodges-Lehmann median differences between exponential
subpopulations. Downloadable from
as from 12 October 2008.

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
Web page:
Departmental Web page:

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

-----Original Message-----
[] On Behalf Of
Sent: 10 June 2009 22:42
Subject: Re: st: test difference in quintiles

-cendif-  by Roger Newson, is part of the -somersd- package,
downloadable from SSC (type "ssc install somersd".  It computes CI's
for,  and tests, differences between medians.  You will need  large
sample sizes to test the difference between 5th percentiles with
reasonable power.  What do you mean by "number of observations in the
5th percentile"?  You should not group data prior to the analysis.


On Wed, Jun 10, 2009 at 10:57 AM, Susanne
Neckermann<> wrote:
> Hi!
> I want to test whether the difference in the fifth percentile of two
> distributions is significant.
> In principle, this test should be similar to the "median" (thats the name
> the command) test already implemented in Stata, but unfortunately I cannot
> program .ado files and I could not find a user-written procedure.
> Any idea how to go about this?
> P.S. the number of observations in the fifth percentile is pretty low
> (around 6), so one might have to use something with bootstrap or
> permutations.
> Thank you so much in advance
> susanne
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

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