[R-sig-ME] pMCMC in languageR?
Jonathan Baron
baron at psych.upenn.edu
Wed Jun 4 01:47:30 CEST 2008
Here is the relevant code from pvals.fnc() in the languageR package,
so far as I can tell.
mcmc = mcmcsamp(object, n = nsim)
#...
nr <- nrow(mcmc)
prop <- colSums(mcmc[, 1:ncoef] > 0)/nr
ans <- 2 * pmax(0.5/nr, pmin(prop, 1 - prop))
This seems like a reasonable way to compute something like a p-value.
It looks for the number of simulated cases on the wrong side of zero,
and the "0.5/nr" is sort of like a minimum p-value to correct for the
fact that the number of mcmc samples is finite.
But it isn't a p-value of the usual sort. It seems to be based on the
posterior distribution of the parameters, given reasonable
assumptions. In Baayen's book, and in the Baayen et al. paper that is
soon to appear in Journal of Memory and Language (already in the Web
version), it is usually fairly close to, but lower than, the p-level
for the t statistic, based on an unreasonably high df.
But I cannot find anywhere (including these sources) a description, in
words, of why this is a good thing, if it is. It would be nice to
have something to cite if one uses it in an article.
(Also, the current code of languageR, at the moment, does not seem to
work with the latest development version of lmer. I assume that this
is a temporary problem and not the result of some deep theoretical
problem of the sort that plagues the t statistic.)
Jon
--
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
More information about the R-sig-mixed-models
mailing list