Hi,
I would like to derive p-values for pair-wise comparison (Tukey's) of
effects when the response is a count.
I am trying a test case where y ~ Po( lambda(x) ). x has three
levels : A, B and C with lambda(x) = 10, 20 and 20 respectively.
Hence, p-values for the contrast C - B should distribute uniformally.
I have implemented this test case as below but do not get uniform
distribution of those p-values, rather high values (close to 1). Is my
code correct? The problem could be due to the normal approximation but
I have also tried with larger sample sizes (n=1e4) and still get it.
Is there an issue in using multcomp for count data? My final real case
will be with quasipoisson data.
Thanks for your help,
Julien
seed(0)
pvals = t(
sapply(
1:100,
function(i){
x = factor(sample( c("A", "B", "C"),
1000, replace=TRUE ))
means = c(A=10, B=20, C=20)
y = rpois(length(x), lambda=means[x])
fit = glm(y ~ x , family=poisson() )
summary( glht(fit, linfct = mcp(x = "Tukey") ) )$test
$pvalues
}
)
)
hist(pvals[,3], breaks=30)
> Julien Gagneur
> Computational Scientist
> Steinmetz lab
> Tel: +49-(0)6221-387-8114
> Fax: +49-(0)6221-387-8518
> Email: julien.gagneur@embl.de
>
> Room V205
> EMBL
> Meyerhofstrasse 1
> D-69117 Heidelberg
> Germany
[[alternative HTML version deleted]]
Peter Westfall has answered me giving useful links. Here is the exchange: thanks for your quick answer and the refs. My misconception was that i treated the p-values as if they were non adjusted p-values. Discreteness was a minor problem. The p-values look much more uniform once I test only for the contrast of interest and not all the pair- wise ones. summary( glht(fit, linfct = mcp( x=c(0, -1, 1)) ) )$test$pvalues instead of: summary( glht(fit, linfct = mcp(x = "Tukey") ) )$test$pvalues Julien On Jun 15, 2009, at 16:21 , Westfall, Peter wrote: P-values are uniform only when the distribution is continuous. See Westfall, P.H. and Troendle, J.F. (2008). Multiple Testing with Minimal Assumptions, Biometrical Journal 50, 745-755. Westfall, P.H., and Soper, K.A. (2001). "Using priors to improve multiple animal carcinogenicity tests<http://pubs.amstat.org/doi/pdfplus/10.1198/016214501753208852 >", Journal of the American Statistical Association 96, 827-834. Westfall, P.H. and Wolfinger, R.D.(1997). "Multiple Tests with Discrete Distributions<http://www.jstor.org/stable/2684683>," The American Statistician 51, 3-8. for the finite sample case. For the asymptotic case with Poisson etc, see Hothorn, T., Bretz, F., and Westfall, P. (2008). Simultaneous Inference in General Parametric Models, Biometrical Journal 50(3), 346– 363. Good luck, Peter [[alternative HTML version deleted]]