Hello, I hope that you can bare with me. I am new to models, but I think I have a pretty godd understanding of how to run them now, including how to use AICc and Anova. The issue is that I have many factors that I wish to compare so doing each one at a time would take forever. I came across the MuMIn package and I was so excited, however I am getting an error message and i don't know why. Firstly it is a mixed model that I am running with lme4. The .csv file that it comes from has more factors than I will probably use but I only listed the ones that I wanted to test. I had also coded the ones that are labels and not continuous data using the as.factor command and I ran the most complex model and ran summary() and it seemed to have worked fine. My model was: fm2test<-lmer(Feeding~MF.vs.OF+Age.class+tide.h.l+Site+HDp+(1|Brood), data=ABMtest.df) and then I wanted to use the dredge command as so: dd<-dredge(fm2test, trace=TRUE, rank="AICc", REML=FALSE) I got an error: Error in UseMethod("fixef") : no applicable method for 'fixef' applied to an object of class "mer" I have no idea how to fix this. I have looked at ?dredge but cannot find anything there and I am very new to R so any help would be greatly appreciated. I want to run all the possible models using the factors and then want to identify those models which best explain Feeding. I also have other models to run and in addition I have more factors to use but wanted to do this first as a test. Could someone also advise me on a way to list all models in order and if each model is accessible in order to compare with Anova? Thank you so much in advance. Rachel -- View this message in context: http://r.789695.n4.nabble.com/Using-MuMIn-error-message-tp4500236p4500236.html Sent from the R help mailing list archive at Nabble.com.
This was solved by loading each package right before using it (I thought you loaded both at the beginning). However I now have an additional issue. I ran a small model with just three factors to try it out and it worked beautifully, but when I tried to run it with all the factors this is what I got when I tried to run the model:> ABmodel<-read.csv(file.choose(), header=T) > ABmodel$Brood<-as.factor(ABmodel$Brood) > ABmodel$Site<-as.factor(ABmodel$Site) > ABmodel$Age.class<-as.factor(ABmodel$Age.class) > ABmodel$Tide<-as.factor(ABmodel$Tide) > ABmodel$tide.h.l<-as.factor(ABmodel$tide.h.l) > ABmodel$tide.inc.out<-as.factor(ABmodel$tide.inc.out) > ABmodel$MF.vs.OF<-as.factor(ABmodel$MF.vs.OF) > local({pkg <- select.list(sort(.packages(all.available > TRUE)),graphics=TRUE)+ if(nchar(pkg)) library(pkg, character.only=TRUE)})> > fullABmodel1<-lmer(Feeding~Site+Age.class+tide.h.l+tide.inc.out+Tide+HDp+NHDp+Foraging.Eff+MF.vs.OF+Age+HDr+NHDr+AllDr+(1|Brood), > data=ABmodel, REML=FALSE)Error in mer_finalize(ans) : Downdated X'X is not positive definite, 7.> fullABmodel1<-lmer(Feeding~Site+Age.class+tide.h.l+tide.inc.out+Tide+HDp+NHDp+Foraging.Eff+MF.vs.OF+Age+HDr+NHDr+AllDr+(1|Brood), > data=ABmodel, REML=FALSE)Error in mer_finalize(ans) : Downdated X'X is not positive definite, 7.> fullABmodel1<-lmer(Feeding~Site+Age.class+tide.h.l+tide.inc.out+Tide+HDp+NHDp+Foraging.Eff+MF.vs.OF+Age+HDr+NHDr+AllDr+(1|Brood), > data=ABmodel, REML=FALSE)Error in mer_finalize(ans) : Downdated X'X is not positive definite, 7.> summary(fullABmodel)Error in summary(fullABmodel) : error in evaluating the argument 'object' in selecting a method for function 'summary': Error: object 'fullABmodel' not found>I am attaching my raw .csv file. Note those above that are as.factors. The file has more factors than I am using because I am also going to be looking at different issues with it. Note that broods are nested within site but I want to see if site has an effect. I ran a smaller model and it was weighted and had a delta below 2 but not sure if that is only because so few factors were being compared, so thought I would run it as a fixed then maybe as a random later. http://r.789695.n4.nabble.com/file/n4500740/AllBroodmodel.csv AllBroodmodel.csv -- View this message in context: http://r.789695.n4.nabble.com/Using-MuMIn-error-message-tp4500236p4500740.html Sent from the R help mailing list archive at Nabble.com.
Hi Rachel Do you accidentally have nlme and lme4 loaded at the same time? If so then try unloading nlme. regards Mike ________________________________________ From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Dragonwalker [dragonwalkerart at hotmail.com] Sent: 23 March 2012 21:55 To: r-help at r-project.org Subject: [R] Using MuMIn - error message Hello, I hope that you can bare with me. I am new to models, but I think I have a pretty godd understanding of how to run them now, including how to use AICc and Anova. The issue is that I have many factors that I wish to compare so doing each one at a time would take forever. I came across the MuMIn package and I was so excited, however I am getting an error message and i don't know why. Firstly it is a mixed model that I am running with lme4. The .csv file that it comes from has more factors than I will probably use but I only listed the ones that I wanted to test. I had also coded the ones that are labels and not continuous data using the as.factor command and I ran the most complex model and ran summary() and it seemed to have worked fine. My model was: fm2test<-lmer(Feeding~MF.vs.OF+Age.class+tide.h.l+Site+HDp+(1|Brood), data=ABMtest.df) and then I wanted to use the dredge command as so: dd<-dredge(fm2test, trace=TRUE, rank="AICc", REML=FALSE) I got an error: Error in UseMethod("fixef") : no applicable method for 'fixef' applied to an object of class "mer" I have no idea how to fix this. I have looked at ?dredge but cannot find anything there and I am very new to R so any help would be greatly appreciated. I want to run all the possible models using the factors and then want to identify those models which best explain Feeding. I also have other models to run and in addition I have more factors to use but wanted to do this first as a test. Could someone also advise me on a way to list all models in order and if each model is accessible in order to compare with Anova? Thank you so much in advance. Rachel -- View this message in context: http://r.789695.n4.nabble.com/Using-MuMIn-error-message-tp4500236p4500236.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system.
Hello Mike, I don't think I did, but I fixed the issue by loading each package before use. The second issue was solved by removing a variable that was used to create two other categorical variables. I think it must have been recognising this. Thanks for the help. -- View this message in context: http://r.789695.n4.nabble.com/Using-MuMIn-error-message-tp4500236p4508901.html Sent from the R help mailing list archive at Nabble.com.
Possibly Parallel Threads
- Urgent - I really need some help lme4 model avg Estimates
- two lmer questions - formula with related variables and output interpretation
- dredge solely offset models in MuMIn
- collapsing a data frame
- help: advice on the structuring of ReML models for analysing growth curves