Displaying 1 result from an estimated 1 matches for "gamspcov".
2018 Jan 27
0
GAM: mismatch between nb/polys supplied area names and data area names
...of the covariate of the smooth
(i.e. the area labels)
shape<-readOGR(dsn="~/Long/MENHShape",layer=("MENHShape2"))
nb <- poly2nb(shape, queen = TRUE, snap=100, row.names=datawide$id)
names(nb) <- attr(nb, "region.id")
#run GAM spatial neighbors plus covariates
gamspcov <- gam(y2008_2014rate~s(id, bs="mrf", xt = list(nb = nb), k=20) +
s(deermi2) + s(t14), family=nb( ), data=datawide, method="MLE")
#ERROR MESSSAGE
#Error in smooth.construct.mrf.smooth.spec(object, dk$data, dk$knots) :
# mismatch between nb/polys supplied area names and data...