Dear R list,
I have a recurring problem with the languageR package, specifically the
aovlmer.fnc function. When I try to run the following code (from R. H.
Baayen's textbook):
# Example 1:
library(languageR)
latinsquare.lmer <- lmer(RT ~ SOA + (1 | Word) + (1 | Subject),
data = latinsquare)
x <- pvals.fnc(latinsquare.lmer,
withMCMC = TRUE)
aovlmer.fnc(latinsquare.lmer,
mcmc = x$mcmc,
which = c("SOAmedium", "SOAshort"))
I get the following error message (German locale):
Fehler in anova(object) : Calculated PWRSS for a LMM is negative
Invoking traceback yields the following result:
> traceback()
4: .Call(mer_update_projection, object)
3: anova(object)
2: anova(object)
1: aovlmer.fnc(latinsquare.lmer, mcmc = x$mcmc, which =
c("SOAmedium",
"SOAshort"))
By contrast, the following code (without the aovlmer.fnc command) runs
without error:
# Example 2:
library(languageR)
latinsquare.lmer <- lmer(RT ~ SOA + (1 | Word) + (1 | Subject),
data = latinsquare)
pvals.fnc(latinsquare.lmer,
withMCMC = TRUE)
Similarly, the following code (without the pvals.fnc command, and
consequently running aovlmer.fnc *without* MCMC sampling) also runs
without error:
# Example 3:
library(languageR)
latinsquare.lmer <- lmer(RT ~ SOA + (1 | Word) + (1 | Subject),
data = latinsquare)
aovlmer.fnc(latinsquare.lmer,
noMCMC = TRUE)
However, the following code results in exactly the same error message as
given above, which puzzles me because up to and including the pvals.fnc
command, the code is basically the same as in Example 2 (which runs
fine); and the code in the final aovlmer.fnc command is the same as in
Example 3 (which also runs fine) and, crucially, does not refer to the
object created by pvals.fnc (named "x") at all:
# Example 4:
library(languageR)
latinsquare.lmer <- lmer(RT ~ SOA + (1 | Word) + (1 | Subject),
data = latinsquare)
x <- pvals.fnc(latinsquare.lmer,
withMCMC = TRUE)
aovlmer.fnc(latinsquare.lmer,
noMCMC = TRUE)
Trying to run the examples given in the languageR documentation, no
error occurs for me with the example in ?pvals.fnc; however, the same
error as above occurs when running the example given in ?aovlmer.fnc.
I am using Windows XP SP3, R version 2.8.0, and updated packages. The
following is the result of sessionInfo:
> sessionInfo()
R version 2.8.0 (2008-10-20)
i386-pc-mingw32
locale:
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
base
other attached packages:
[1] languageR_0.953 lme4_0.999375-27 Matrix_0.999375-16
zipfR_0.6-5 lattice_0.17-17
loaded via a namespace (and not attached):
[1] grid_2.8.0 tools_2.8.0
To sum up, the error occurs when invoking aovlmer.fnc, but somehow seems
to be caused by previous invocation of pvals.fnc. I have reproduced the
error on several other computers (running on Windows XP SP2, Windows XP
SP3, and Windows Vista) with fresh installations of R, so I do hope I
have excluded any trivial blunders on my part. Any help is greatly
appreciated.
Thank you very much in advance!
Mats Exter
--
Mats Exter
Institut f?r Linguistik
Allgemeine Sprachwissenschaft
Universit?t zu K?ln
50923 K?ln
Germany