Model selection using glmulti

时光毁灭记忆、已成空白 提交于 2019-12-08 04:13:08

问题


I am attempting to run glmulti to test all possible subsets for model selection. The following is the code that I am trying to use.

    lmer.glmulti<-function(formula, data, random="", ...){
    lmer(paste(deparse(formula),random),data=data,
       REML=FALSE,...)
    }

    glmulti <-
 glmulti(formula(lmer(transLOT~DielEnd+TidalHeight+Pier+PercentIllumination+WT+BP+Anglers+(1|Transmitter), data=RESIDENCY_FOR_R), fixed.only=TRUE),
          data=RESIDENCY_FOR_R,
          level = 1,              
          method = "h",            
          crit = "bic",            
          confsetsize = 5,       
          plotty = F, report = F,  
          fitfunc = lmer.glmulti,  
          random="+(1|Transmitter)",
          intercept=TRUE) 

A problem arises with the variable combinations. In my output, the 4th and 5th models are the same (see below) and there is a blank in-between "Pier" and "(1|Transmitter)."

[[4]]
Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: RESIDENCY_FOR_R$transLOT ~ 1 + DielEnd + TidalHeight + Pier +      +(1 | Transmitter)
   Data: data
      AIC       BIC    logLik  deviance  df.resid 
 2522.600  2558.928 -1253.300  2506.600       685 
Random effects:
 Groups      Name        Std.Dev.
 Transmitter (Intercept) 0.2361  
 Residual                1.4686  
Number of obs: 693, groups:  Transmitter, 9
Fixed Effects:
         (Intercept)          DielEndNight     TidalHeightRising  PierGarden City Pier         PierMBSP Pier  
             2.86894              -0.62946               0.08668              -1.38613               0.88502  
         PierPier 14  
            -0.77364  

[[5]]
Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: RESIDENCY_FOR_R$transLOT ~ 1 + DielEnd + TidalHeight + Pier +      +(1 | Transmitter)
   Data: data
      AIC       BIC    logLik  deviance  df.resid 
 2522.600  2558.928 -1253.300  2506.600       685 
Random effects:
 Groups      Name        Std.Dev.
 Transmitter (Intercept) 0.2361  
 Residual                1.4686  
Number of obs: 693, groups:  Transmitter, 9
Fixed Effects:
         (Intercept)          DielEndNight     TidalHeightRising  PierGarden City Pier         PierMBSP Pier  
             2.86894              -0.62946               0.08668              -1.38613               0.88502  
         PierPier 14  
            -0.77364 

If anyone could help that would be greatly appreciated.

来源:https://stackoverflow.com/questions/50952828/model-selection-using-glmulti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!