[R-sig-ME] Does lmer have it's own random number generator?

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Jan 3 11:01:07 CET 2011


Dear Mike,

Are you sure? Below the results of 100 simulations. I get the same
results each time.

Best regards,

Thierry

> set.seed(1)
> tmp <- replicate(100, {
+ 	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,]
+ 	)
+ 	fit at deviance
+ })
> apply(tmp, 1, var)
       ML      REML      ldL2     ldRX2   sigmaML sigmaREML     pwrss
disc 
        0         0         0         0         0         0         0
0 
     usqr      wrss       dev      llik   NULLdev 
        0         0        NA        NA        NA 
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Dutch_Belgium.1252  LC_CTYPE=Dutch_Belgium.1252   
[3] LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C                  
[5] LC_TIME=Dutch_Belgium.1252    

attached base packages:
 [1] grid      grDevices datasets  splines   graphics  stats     tcltk

 [8] utils     methods   base     

other attached packages:
 [1] ez_2.1-0           lme4_0.999375-37   Matrix_0.999375-45
lattice_0.19-15   
 [5] stringr_0.4        ggplot2_0.8.8      proto_0.3-8
reshape_0.8.3     
 [9] plyr_1.2.1         car_2.0-7          nnet_7.3-1         MASS_7.3-7

[13] rj_0.5.0-5         svSocket_0.9-51    TinnR_1.0.3        R2HTML_2.2

[17] Hmisc_3.8-3        survival_2.36-1   

loaded via a namespace (and not attached):
[1] cluster_1.13.2 nlme_3.1-97    rJava_0.8-8    stats4_2.12.0
svMisc_0.9-61 
[6] tools_2.12.0  

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey
  

> -----Oorspronkelijk bericht-----
> Van: r-sig-mixed-models-bounces at r-project.org 
> [mailto:r-sig-mixed-models-bounces at r-project.org] Namens Mike Lawrence
> Verzonden: maandag 3 januari 2011 3:52
> Aan: r-sig-mixed-models at r-project.org
> Onderwerp: [R-sig-ME] 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')))
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 




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