Thanks to Martin for helpfully spelling out what Suzanne needed to do. This was essentially what I had in mind.
Best wishes
Roger
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
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/
Opinions expressed are those of the author, not of the institution.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: 11 June 2009 15:59
To: [email protected]
Subject: AW: st: test difference in quintiles
<>
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:
*************
clear*
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
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Newson, Roger B
Gesendet: Donnerstag, 11. Juni 2009 10:45
An: '[email protected]'
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
Roger
References
Newson, R. B. Hodges-Lehmann median differences between exponential
subpopulations. Downloadable from
http://www.imperial.ac.uk/nhli/r.newson/papers.htm#miscellaneous_documents
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
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgene
tics/reph/
Opinions expressed are those of the author, not of the institution.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: 10 June 2009 22:42
To: [email protected]
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.
-Steve
On Wed, Jun 10, 2009 at 10:57 AM, Susanne
Neckermann<[email protected]> 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
of
> 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:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/