rnagammumin

Dredge on GAM returns NA results for logLik, AICc, delta and weight


I have a global moel with two smoothed terms and two random effects.

mRI_qb <- gam(ri ~ SE_score + s(deg, k=7) + s(gs, k=7) + TL + species + sex + season + year + 
                s(code, bs = 're') + s(station, bs = 're'), 
              family=quasibinomial(), data=node_dat, na.action = "na.fail")

I ran the dredge function on MuMIn which was very slow, even using the pdredge function.

# RI dredge very slow so using parallel processing
library (parallel)
library (snow)

#make cluster - use 5 because have 6 cores, need one for other tasks
mycluster = makeCluster(5, type = "SOCK")  ## also need snow installed

#data must exported to the cluster - see 'details' https://rdrr.io/cran/MuMIn/man/pdredge.html
clusterExport(mycluster,"node_dat")

#required packages must be also loaded there
clusterEvalQ(mycluster, library(mgcv))
RI_dredge <- MuMIn::pdredge(mRI_qb, mycluster)

However, after 8 days it finally finished. However I just have NAs for the logLik, AICc, delta and weight columns.

enter image description here

I can't seem to find why the dredge has outputted NAs for those columns, especially as the model runs fine with no errors.

A copy of the dataset can be found here


Solution

  • This is because you have used quasibinomial family, which does not give a log-likelihood, and so no AIC can be calculated. You might try bam rather than gam, since this is such a large dataset.