[R-sig-ME] MCMC and F tests, take 3

Hank Stevens HStevens at MUOhio.edu
Fri Jul 11 15:46:13 CEST 2008


Hi folks,
Repost/summary of previous correspondence.  Thanks to Ben Bolker,  
Spencer Graves and Ken Beath for questions and comments.

Are there general situations in which we might expect very different
answers from F tests vs. mcmcpvalue with orthogonal contrasts  
(Helmert)? I have doubts about the MCMC results with the most recent  
version of lme4 (versions ....-20 on CRAN, and -21 on R-Forge).

If you are interested, please run the code below.

system("open http://www.cas.muohio.edu/~stevenmh/RFiles/lme4.html")
source("http://www.cas.muohio.edu/~stevenmh/RFiles/aovBayes.r")
download.file("http://www.cas.muohio.edu/~stevenmh/RFiles/datout.csv",  
"dathere.csv")
dat <- read.csv("dathere.csv")
names(dat)
options(contrasts=c("contr.helmert", "contr.poly"))
library(lme4)
sessionInfo()

modcA.sim <- lmer(y ~ ageinj + sex + race + zses +
               tsi + tsq +
                grp + grp:tsi + grp:tsq +
              zfad + zfad:grp + zfad:tsi + zfad:tsq +
              tsi:zfad:grp + tsq:zfad:grp + (1|id), dat)
attr(modcA.sim @ X, "contrasts")
aov.Bayes(modcA.sim, n=1000)
mc.out <- mcmcsamp(modcA.sim, n=1000)
densityplot(mc.out)
xyplot(mc.out)


Dr. Hank Stevens, Associate Professor
338 Pearson Hall
Botany Department
Miami University
Oxford, OH 45056

Office: (513) 529-4206
Lab: (513) 529-4262
FAX: (513) 529-4243
http://www.cas.muohio.edu/~stevenmh/
http://www.cas.muohio.edu/ecology
http://www.muohio.edu/botany/

"If the stars should appear one night in a thousand years, how would men
believe and adore." -Ralph Waldo Emerson, writer and philosopher  
(1803-1882)




More information about the R-sig-mixed-models mailing list