I'm trying to do AICc model selection and model averaging with tweedie (compound Poisson) distributed data in R.
I was working with the AICcmodavg R package with no success, then decided to try out the MuMIn package when I came across the suggestion here (https://stats.stackexchange.com/questions/141806/glm-model-selection-using-aicc-with-tweedie-distribution) that
"You can use AICtweedie directly in MuMIn's functions, just specify it as a rank argument."
I set up my models as follows My response variable (NVIR) is catch-per-unit-effort of eastern newt adults and my explanatory variables are various habitat characteristics of my sampling sites.
m1<- glm(NVIR~Water_T+cond+DO+ORP+pH+max_depth+type,
family = tweedie(link.power=0, var.power=1.3), data = cpue)
m2<- glm(NVIR~Water_T+cond+DO+ORP+pH+littoral_slope+type,
family = tweedie(link.power=0, var.power=1.3), data = cpue)
m3<- glm(NVIR~pH+DO+cond+max_depth+type,
family = tweedie(link.power=0, var.power=1.3), data = cpue)
m4<- glm(NVIR~pH+DO+cond+littoral_slope+type,
family = tweedie(link.power=0, var.power=1.3), data = cpue)
m5<- glm(NVIR~cond+type+pH+max_depth,
family = tweedie(link.power=0, var.power=1.3), data = cpue)
and then tried this line
model.sel(m1, m2, m3, m4, m5, rank = AICc, rank.args = AICtweedie)
and received the error
Error in UseMethod("logLik") :
no applicable method for 'logLik' applied to an object of class "function"
In addition: Warning message:
In model.sel.default(m1, m2, m3, m4, m5, rank = AICc, rank.args = AICtweedie) :
models are not all fitted to the same data
Alternatively, I also tried this line
model.sel(m1,m2,m3,m4,m5, rank.args=AICtweedie)
and got this error:
Error in get(x) : object 'Tweedie' not found
In addition: Warning message:
In model.sel.default(m1, m2, m3, m4, m5, rank.args = AICtweedie) :
models are not all fitted to the same data
I'm wondering whether the problem is with my code, or if the tweedie family is incompatible with this package.
Thank you for your time.