I have also changed the method in the bam model from REML to GCV. Gam_dredge<-dredge(gam_global,evaluate=TRUE,fixed=c("offset(offset)","s(StationID,bs="re)"),rank="AIC") Gam_dredge<-dredge(gam_global,evaluate=TRUE,fixed=c("offset(offset)","s(StationID)"),rank="AIC") I tried the following two approaches with no success: #genertric random effect name as shown in model summary output I also need to retain the offset term in all models.Īfter conducting a web search, I tried the following based on this post 1 I am not interested in determining if the random effect is needed and need to keep it in all models as the random effect. When I run the dredge function on the global model the random effect is dropped from a subset of the models as dredge is running through the different model options with and without certain variables. I think this is a bug in the MuMIn package, and the fix is as simple as just renaming your cluster to anything else but cl.I spent an extremely frustrated day trying to figure out this issue and wound up digging around in the code for dredge.R on Github and found this. The random effect is s(StationID, bs = 're') gam_global<-bam(Numberpertow ~ s(interval,k=6)+Stratum+ClosArea+CruiseID+s(interval, by=CruiseID,k=6)+offset(offset)+s(StationID, bs = 're'),data=l.data,method = "REML",family=nb(),na.action = "na.fail") The global model using bam from the package mgcv is below. I am using the dredge function from the MuMin package for a gam with a random effect:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |