Beta regression & spatial autocorrelation

250 Views Asked by At

I am trying to work out the best possible way to add random effects to my beta regression. I have a data frame consisting of longitude, latitude, seal tag, sea surface temp in kelvin and the mean behavioural position of the seal. I have rescaled mean behavioural position so that the values lie between 0.99 and 0.01. 0.99 relates to 100% transiting behaviour. My residuals are not evenly dispersed and there is non-linearity, due to the spatial autocorrelation of individual seals. So, I have added random effects using latitude, longitude and seal tag, via the "re" smoothing factor in the gam function.

mod1 <- gam(beh_scale4 ~ TempK.Daily + s(Lat, Lon, tag, bs="re"),
            family = betar(link='logit'),
            data=df)

My residuals look more dispersed, but I am wondering if there is a better way of doing this.

Residuals before random effects:

Resid.before

Residuals after random effects:

Resid.after

1

There are 1 best solutions below

0
On

Personally, I would advise against using the stand alone residuals you get from a GLMM or GAMM fit (here it looks like you are using the raw residuals at least). They tend to have weird characteristics and are prone to being inaccurate when you are trying to diagnose model fit. There is an excellent vignette on the DHARMa package that would be much more useful if you are seeking to understand your residuals. It has some specific information on beta regressions as well.