On 08/07/2010 2:45 PM, Jonathan Baron wrote:
On 07/08/10 19:25, Knut Krueger wrote:
> Hi to all,
> is there any function available to combine those p values;
>
>
> Kind Regards Knut
Here's a couple of functions I've used for one thing that you might
mean. The idea is that you have two p-values for different tests of
the same hypothesis, and you want to get an overall p-value for the
hypothesis. The first method, for combining two p-values, was
invented by Fisher a very long time ago. The second method I do not
remember a thing about, but I found it somewhere. You need to look
these up before trusting them.
# combine and output one-tailed p's. Enter 2-tailed p's.
combine <- function(x,y)
return(pchisq(-2*log(x/2)-2*log(y/2),4,low=F))
This assumes the two p values are independent, but you don't want to
divide x and y by 2: that biases things towards smaller p-values. (I'm
not sure what you mean by "2-tailed p's" though, so I might be wrong.)
# Stouffer's method for vector x, gives 2-tailed result
pnorm(sum(qnorm(x))/sqrt(length(x)))
This also assumes independence between the tests.
Duncan Murdoch
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.