Skip to content
Prev 5039 / 20628 Next

Does lmer have it's own random number generator?

Hi folks,

Does lmer have it's own internally seeded random number generator? I
just came across an example where I get different results across
repeated identically specified lmer fits even when I use set.seed():

library(ez)
data(ANT)

#repeat the below a few times, the result
# on the last line should vary occasionally,
# sometimes TRUE, sometimes FALSE,
# and sometimes there will be a warning
# after the fit

set.seed(1)
fit = lmer(
	formula = rt ~ (1|subnum) +
		cue*flank*group*block +
		cue*flank*group*I(block^2) +
		cue*flank*group*I(block^3)
	, data = ANT[ANT$error==0,]
)
any(is.finite(attr(fit,'deviance')))