[R] p-value of the pooled Z score
Thomas Lumley
tlumley at uw.edu
Tue Mar 13 19:50:47 CET 2012
On Wed, Mar 14, 2012 at 3:41 AM, cheba meier <cheba.meier at googlemail.com> wrote:
> Hello,
>
> I have to compute the pooled z-value and I would like to know which way is
> more appropriate
>
>
> b <- c( -0.205,1.040,0.087)
> s <- c(0.449,0.167,0.241)
> n <- c(310, 342, 348)
> z <- b/s
>
> Z <- sum(z)/sqrt(length(n))
> P <- 2*(1-pnorm(abs(Z)))
> P
>
> w <- sqrt(n)
> Zw <- sum(w * z)/sqrt(sum(w^2))
> Pw <- 1 - pchisq(Zw * Zw, 1)
> Pw
>
A. Both give a valid test, neither test dominates the other, so in an
abstract statistical sense both are equally correct
B. But you probably want the weighted z, because that is more
commonly used. It's more commonly used because it has better power
when the difference being tested is approximately the same in each of
the component z scores
C. But in that case you would probably be better off with the
precision-weighted test, using the standard error information in
weighting.
precision <- 1/(s*s)
m.ave <- sum(m * precision)/sum(precision)
prec.ave <- sum(precision)
chisq.ave <- m.ave*m.ave*prec.ave
1 - pchisq(chisq.ave,1)
D. But in this example the sample sizes and standard errors are
sufficiently similar that it will not make much difference.
-thomas
--
Thomas Lumley
Professor of Biostatistics
University of Auckland
More information about the R-help
mailing list