[R-sig-ME] spatial autocorrelation as random effect with count data

Paul Buerkner paul.buerkner at gmail.com
Thu Jan 11 00:22:01 CET 2018


Modelling spatial structures is always a bit more diffult that just calling
glmer() regardless of the way you go. Here is an example of how your may
fit your data using GAMMs in a Bayesian framework:

library(brms)
fit <- brm(x ~ Stratum + t2(Lat, Lon) + (1|Loc),
                data = df, family = negbinomial())
summary(fit)
marginal_effects(fit)
marginal_smooths(fit)


2018-01-10 23:46 GMT+01:00 Sima Usvyatsov <ghiaco at gmail.com>:

> Thanks for your replies, everyone.
>
> As for why I "choose" to stick with GLM - I have zero experience with GAM,
> and it's a time-sensitive analysis, so there's just a time x experience
> issue.
>
> It sounds like maybe the glmer() way is not the way to go...
>
> I'm also exploring the SpatialFilter approach to getting rid of nuisance
> spatial autocorrelation, but am running into computational issues - it
> _really_ doesn't like my dataset.
>
> If anyone on here has any experience, input would be welcome. I have
> already posted a SpatialFilter-specific question on the r-sig-geo mailing
> list (https://stat.ethz.ch/pipermail/r-sig-geo/2018-January/026282.html),
> although I managed to provide a toy dataset with a mistake in it.
>
> Either way, thank you! At least I can stop digging in this direction.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list