[R] Example of mcmcsamp() failing with lmer() output

Michael Kubovy kubovy at virginia.edu
Fri Apr 27 18:58:30 CEST 2007


Hi,

I would appreciate help with the following model

<<1>>=
gunload <- read.table(hh('datasets/gunload.dat'), header = T)
gunload$method <- factor(gunload$method, labels = c('new', 'old'))
gunload$physique <- factor(gunload$group, labels = c('slight',  
'average', 'heavy'))
gunload$team9 <- factor(rep(1:9, each = 2))
@

This is a split plot design with randomly selected teams for each  
physique, which was crossed with two methods.

Following the Oats example in chap. 1 of MEMSS, and adapting to lmer:

<<2>>=
require(lme4)
gl.lmer <- lmer(rounds ~ method * physique + (1 | physique/team),  
data = gunload)
mcmcsamp(gl.lmer)
@
lmer runs as expected, but mcmcsamp() gives:
Error: Leading minor of order 1 in downdated X'X is not positive  
definite
Error in t(.Call(mer_MCMCsamp, object, saveb, n, trans, verbose,  
deviance)) :
	error in evaluating the argument 'x' in selecting a method for  
function 't'

I tried:

<<3>>=
require(nlme)
gl.lme <- lme(rounds ~ method * physique, random = ~1 | physique/ 
team, data = gunload)
@
which gave all the expected output except that two p-values were NaN.

Which aspect of the data is making the simulation fail, and is there  
anything to be done about it?

_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



More information about the R-help mailing list