0

I have a dataset that's about 5k lines long, with a binomial response variable, five continuous fixed effects, and one random effect with seven levels. I initially ran a model with glmer{lme4}:

glmer.fit <- glmer(response ~ var1 + var2 + var3 + var4 + var5 + (1|ranef), data = dat, family = binomial)

Model assessments using correlo{ncf} indicated that the distances between sampling points (5 km) were too small and spatial autocorrelation was significant.

I'm attempting to fit the model using spaMM following the same kind of structure as the above syntax, with the change that the coordinates x (zonal) and y (meridionial) are included as correlated random effects, specified with the Matern function. I opted to use fitme as per the tutorial as it's apparently faster.

spaMM.fitme <- fitme(response ~ var1 + var2 + var3 + var4 + var5 + (1|ranef) + Matern(1|x+y), data = my.dat, family = binomial(), fixed = list(nu = 0.5))

I opted for fitme as using corrHLfit didn't seem to complete after running for about 12 hours. I stopped the process and decided to run fitme, and I was wondering if anyone else may have used the function and had experienced a long processing time as well.

I did a run with simulated data made here and it produced an output really fast (< 2 min), so I suspect it might be my data. Is it just that my model is too complex and it's just trying to find a way to try to converge? Or is the spatial autocorrelation way too high and the model is just trying to work with it? Or is this a case that my entire sytax is incorrect because I wrongly interpreted/understood what I’m meant to do with my spatially correlated random effects?

Sorry I haven't produced any reproducible examples here, I'm not sure how to simulate the dataset I have, nor am I able to provide it as it's confidential.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.