0

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

mikejwilliamson
  • 405
  • 1
  • 7
  • 17

1 Answers1

1

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.

Kamil Bartoń
  • 1,482
  • 9
  • 10
  • Thant's great thanks, was not aware of this. Yeah I realised after posting that the speed would be down to using gam rather than bam. – mikejwilliamson Jul 26 '21 at 07:06
  • It's proportional data so would negative binomial still be appropriate? I tried betar as a distribution but got multiple warnings "In estimate.theta(theta, family, y, mu, scale = scale1, ... : step failure in theta estimation" and the error "Error in chol.default(diag(p) + crossprod(S2 %*% t(R2))) : the leading minor of order 62 is not positive definite", so I'm guessing that might not be right for this dataset. – mikejwilliamson Jul 26 '21 at 08:52
  • 2
    Sorry, I replied hastily and confused it with "quasipoisson" (I have edited my reply removing that suggestion). If the response is (0,1), `betar` would be appropriate in theory. You could start with a simple model and increase complexity to see where it goes wrong. – Kamil Bartoń Jul 26 '21 at 10:47