mardi 27 janvier 2015

Error message with exactLRT to test for suitability of random intercept in lmer model

I'm trying to use exactLRT to see whether I should include a random intercept in my model. Below is a reproducible example:



library(lmer)


m.intercept <- lmer(Reaction ~ Days+(1|Subject), data=sleepstudy)


m0 <- lm(Reaction ~ Days, data=sleepstudy)


exactLRT(m=m.intercept, m0=m0)



I get the following error message: "Error in exactLRT(m = m.intercept, m0 = m0) : multiple random effects in model - exactLRT needs 'm' with only a single random effect."


However, as far as I understand, I've included a single random effect in m.intercept (namely, random intercept).


Any idea about what is the issue?


In case it's useful:



R version 3.1.2 (2014-10-31) Platform: i686-pc-linux-gnu (32-bit)


locale: [1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C

LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8 [5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8

LC_PAPER=en_CA.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C

LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C


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


other attached packages: [1] RLRsim_3.0 MuMIn_1.10.0

psych_1.4.5 WriteXLS_3.5.0 reshape2_1.2.2 languageR_1.4.1 [7] e1071_1.6-3 HLMdiag_0.2.5 gdata_2.13.3 psy_1.1

car_2.0-19 ggplot2_0.9.3.1 [13] date_1.2-34 plyr_1.8.1

Hmisc_3.14-4 Formula_1.1-1 survival_2.37-7 lattice_0.20-29 [19] foreign_0.8-62 lmerTest_2.0-6 lme4_1.1-6 Rcpp_0.11.2

Matrix_1.1-5


loaded via a namespace (and not attached): [1] bitops_1.0-6

caTools_1.17 class_7.3-11 cluster_1.15.3

colorspace_1.2-4 [6] dichromat_2.0-0 digest_0.6.4

gplots_2.13.0 gtable_0.1.2 gtools_3.4.0 [11] KernSmooth_2.23-13 labeling_0.2 latticeExtra_0.6-24 MASS_7.3-37 minqa_1.2.3 [16] munsell_0.4.2

nlme_3.1-119 nnet_7.3-8 numDeriv_2012.9-1

pbkrtest_0.3-8 [21] proto_0.3-10 RColorBrewer_1.0-5 RcppEigen_0.3.2.1.2 scales_0.2.3 stats4_3.1.2 [26] stringr_0.6.2 tools_3.1.2






Aucun commentaire:

Enregistrer un commentaire