Re: R-alpha: ANNOUNCE: ctest

Thomas Lumley (thomas@biostat.washington.edu)
Tue, 21 Jan 1997 09:46:14 -0800 (PST)


Date: Tue, 21 Jan 1997 09:46:14 -0800 (PST)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: r-testers@stat.math.ethz.ch
Subject: Re: R-alpha: ANNOUNCE: ctest
In-Reply-To: <x24tgbc5ll.fsf@bush.kubism.ku.dk>

On 21 Jan 1997, Peter Dalgaard BSA wrote:

> survplot (Kaplan-Meier plot of survival fct.)

This is in survival4 (as are a full set of weighted, stratifies, k-sample 
logrank tests) and will be available real soon now. (I'm 
still having some problems with NextMethod, especially on "[" methods).

> and (now I'm dreaming, not even Splus has this)
> 
> pairwise(...)	Multiple comparisons (HSD, Scheffe, Bonferroni)

I have code for two much more useful relatives of Bonferroni's 
correction, due to Hochberg and Holm. Bonferroni works ok when only one 
null hypothesis is false; these work well when several hypotheses are 
false even with correlation between thme (and are strictly more powerful 
than Bonferroni). They take a vector of p-values and return "adjusted 
p-values", the interpretation of which is that you should reject all 
hypotheses with adjusted p-values less than your chosen test size.

They are explained in more detail in "Adjusted p-values for simultaneous 
inference" by SP Wright, Biometrics 48: 1005-1013

adjust.holm <-function(p) {
        n<-length(p)
        r<-rank(p)
        index<-order(p)
        qi<-p*(n+1-r)
        for (i in 2:n) {
                qi[index[i]]<-max(qi[index[i]], qi[index[i-1]])
        }
        qi
        }

adjust.hochberg <-function(p) {
        n<-length(p)
        r<-rank(p)
        index<-order(p)
        qi<-p*(n+1-r)
        for (i in (n-1):1) {
                qi[index[i]]<-min(qi[index[i]], qi[index[i+1]])
        }
        qi
        }


Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-