[R-sig-Geo] Offset for spautolm function in Spatialreg package

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Mon Nov 23 12:28:59 CET 2020


On Sun, 22 Nov 2020, Kaushi Kanankege via R-sig-Geo wrote:

> Dear members of the R-sig-Geo,
> Is there a way to set an 'offset' when running a Poisson regression using
> the spautolm function offered in the Spatialreg package?

The spautolm function in spatialreg only supports Gaussian dependent 
variables. Perhaps the family= argument misled you to think otherwise, it 
takes the values c("SAR", "CAR, "SMA"), not distribution names. It was 
written as its help page describes to support the spatial regression 
chapter in Waller & Gotway (2004).

For Poisson CAR, see the hglm package, CARBayes, INLA, R2BayesX and many 
others (also mgcv gam() with an "mrf" smooth).

Hope this clarifies,

Roger

>
> I have count data of disease at administrative levels and I am trying to
> use CAR model to account for the spatial dependence between the admin
> levels. I would appreciate suggestions of setting the offset (the log of a
> total number of animals in each admin level) or ways to work around this
> using spautolm function.
>
> Thank you very much.
>
> Kaushi
>
> Further details below:
>
> # Unit of analysis is ‘Districts’ i.e. administrative divisions
>
> # Count_disease = number of animals with the disease
>
> # Var 1 and 2 are selected independent variables
>
> # We have the count of animals per each district and I am trying to set
> this as the ‘offset’
>
>
>
> # The same model was run as a zero inflated Poisson regression using the
> following
>
> offset = log(Ani_pop)
>
> ZIP.D <- zeroinfl(formula_Red, data = Data, dist = "poisson", EM = TRUE,
> link = "logit", offset = offset)
>
>
>
> #Formula
>
> formula <-  Count_disease ~  Variable 1 + Variable2
>
> # CAR fit
>
> CAR.D <- spautolm(formula_Red, data= Thai.D.shp2, listw=ThaiD.listw,
> family="CAR",zero.policy = TRUE, method="eigen")
>
>
>
> How to set the offset?
>
> Or suggestions to work around this?
>
>
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list