Dear list,
In a study of coastal dolphins, I have built a density surface model which includes: (1) a single smooth of depth, (2) a smooth-factor interaction between year (factor) and geographic coordinates (bivariate smooth of x and y), and (3) a random effect term for the transect ID.
abundance.est ~ year_f + s(x, y, m = 2) + s(x, y, by = year_f,
bs = c("tp", "tp"), m = 1) + s(depth) + s(transect_f, bs = "re")
(Note that the data support a hazard-rate detection function model with group size as a covariate, hence why the response is the estimated abundance per segment, rather than the counts).
The rationale for including a random effect term in this instance is that (1) dolphin abundance is expected to be more similar within a transect than between transects, and (2) a subset of transects were sampled multiple times over the course of the study period. Including the random effect term seems to have a positive effect on model performance, and e.g., propels the %deviance explained from ~5% without it to > 20% with it.
Given the above model structure, what is the correct way of obtaining predictions and estimates of variance from the model (conditional on the random effect)?
I cannot, however, seem to find a similar option in "dsm.var.gam" – which means that repeat runs of the function with a different value for the transect ID in "new.data" give slightly different results. What am I missing?
Any advice much appreciated,
Best wishes,
Phil