## marginal negative binomial model with Matern correlation
data(scotland)
D.scotland <- spDists(cbind(scotland$longitude, scotland$latitude), longlat=TRUE)
m <- gcmr(observed~offset(log(expected))+AFF+I(latitude/100), data=scotland,
marginal=nb.marg(), cormat=matern.cormat(D.scotland),
options=list(seed=71271, nrep=100))
prof <- profile(m, which=2, low=0, up=8)
profRun the code above in your browser using DataLab