Error In Anovaobject Calculated Pwrss For A Lmm Is Negative
[ author ] 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
and itappears that something is broken with the mcmcsamp function that pvals.fnccalls. Running pvals.fnc on an lmer object actually changes the contents ofthe object (get a summary before and after running pvals.fnc and you'll see)in a way that triggers this error message. Douglas Bates has been notified;one can hope that the problem will be fixed in a future release of lme4.Dear R list,I have a recurring problem with the languageR package, specifically theaovlmer.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 https://stat.ethz.ch/pipermail/r-help/2008-November/181060.html + (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--View this message in context: http://www.nabble.com/Problem-with-aovlmer.fnc-in-languageR-tp20706128p21365322.htmlSent from the R help mailing list archive at Nabble.com. reply Tweet Search Discussions Search All Groups r-help Discussion Posts Previous Mats Exter: Dear http://grokbase.com/p/r/r-help/0919a7d0na/r-problem-with-aovlmer-fnc-in-languager 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 Related Discussions [R] Problem with workspace loading after languageR use [R] R 2.8. and languageR [R] pvals.fnc in lme4 and languageR [R] LanguageR pvals.fnc error message [R] incorrect MCMC CIs in pvals.fnc (languageR) ? [R] R-2.4.1 for MacOS X - languageR, acepack, Hmisc [R] aovlmer.fnc, lmer and binomial response [R] Problem with duplicates in row.names [R] Change margin size of complex barplot [R] reshape and geeglm problem Discussion Navigation viewthread | post posts ‹ prev | 2 of 2 | next › Discussion Overview groupr-help @ Notice: Undefined variable: pl_domain_short in /home/whirl/sites/grokbase/root/www/public_html__www/cc/flow/tpc.php on line 1605 categoriesr postedNov 26, '08 at 4:22p activeJan 9, '09 at 2:48a posts2 users2 websiter-project.org irc#r Preferences font variable Hotkey:f user style avatars Ho
Sign in Pricing Blog Support Search GitHub This repository Watch 47 Star 191 Fork 68 lme4/lme4 Code Issues 126 Pull requests 2 Projects 0 Pulse Graphs New issue Including lagged variables into -lme4- models #34 Closed https://github.com/lme4/lme4/issues/34 crazyclive opened this Issue Apr 12, 2013 · 4 comments Projects None yet Labels https://www.scribd.com/doc/314407932/lme4-Morfometria None yet Milestone No milestone Assignees No one assigned 2 participants crazyclive commented Apr 12, 2013 I wish to add two batteries of lagged variables (both from the response and one of the predictors) into the 2-level model I am building using -lme4-. Up to now, I've had a good deal of success in fitting these error in models to my own data, producing excellent results (although I'm still learning to master the essentials of what such models do). However, I also wish to test for potential dynamic processes in the model as I believe these to be important, and I've hit a wall there. Let me use the -Dyestuff- data to demonstrate what I have done thus far: (1) I first tried the direct route, using -lag(x,1)-: library(lme4) [...omitted...] error in anovaobject attach(Dyestuff) (fit=lmer(Yield~1+lag(Yield,1)+(1|Batch),Dyestuff,REML=T)) Error in mer_finalize(ans) : Calculated PWRSS for a LMM is negative (2) I got around that by doing: N=length(Yield) lagY1=c(NA,Yield[1:(N-1)]) (fit=lmer(Yield~1+lagY1+(1|Batch),Dyestuff,REML=T)) Linear mixed model fit by REML Formula: Yield ~ 1 + lagY1 + (1 | Batch) Data: Dyestuff AIC BIC logLik deviance REMLdev 318.7 324.1 -155.3 316.9 310.7 Random effects: Groups Name Variance Std.Dev. Batch (Intercept) 2206.1 46.970 Residual 2481.8 49.818 Number of obs: 29, groups: Batch, 6 Fixed effects: Estimate Std. Error t value (Intercept) 1659.44708 267.26451 6.209 lagY1 -0.08723 0.17422 -0.501 Correlation of Fixed Effects: (Intr) lagY1 -0.997 So far, so good. But when I wanted to introduce a -lag(x,2)- term: lagY2=c(NA,Yield[1:(N-2)]) (fit=lmer(Yield~1+lagY1+lagY2+(1|Batch),Dyestuff,REML=T)) Error in model.frame.default(data = Dyestuff, formula = Yield ~ 1 + lagY1 + : variable lengths differ (found for 'lagY2') it won't run. And, of course, the variables do differ in length. (3) Finally, using the -plm- package, I declared it as panel data and tried to run it that way: library(plm) [...omitted...] dye=plm.data(Dyestuff,c("Batch","Yield")) (fit=lmer(Yield~1+lag(Yield,1)+(1|Batch),dye,REML=T)) Error in mer_finalize(ans) : Calculated PWRSS for a LMM is negative Again, no success. At this point, I ran out of ideas. There should be no reason why a 2-level model using -lme4- cannot be fitted to data including a battery of lagged variables, so if somebody could help me achieve this ob
allUploadSign inJoinBooksAudiobooksComicsSheet Musiclme4 - MorfometriaUploaded by Mónica HernándezEuclidean VectorParameter (Computer Programming)Matrix (Mathematics)Confidence IntervalResampling (Statistics)Bootstrapping (Statistics)11 viewsDownloadEmbedDescription: Manual Lme4See MoreManual Lme4Copyright: © All Rights ReservedList price: $0.00Download as PDF, TXT or read online from ScribdFlag for inappropriate content You're Reading a Free Preview Pages 4 to 40 are not shown in this preview. Buy the Full Version You're Reading a Free Preview Pages 44 to 95 are not shown in this preview. Buy the Full Version You're Reading a Free Preview Pages 99 to 113 are not shown in this preview. Buy the Full Version Documents similar to lme4 - MorfometriaregRSMNon-Linear Least SquaresKernel Via Semi Definite.pdfcjm1960v12.0189-020320sim NotesCalculating Traffic Flow Using 2D Array Computations in CEPM-BVA-EG-OA