if (FALSE) {
## to reproduce results from Solymos and Lele (Table 1)
data(sardata)
DAT <- data.frame(sardata$islands,
sardata$studies[match(sardata$islands$study,
rownames(sardata$studies)),])
x <- hsarx(log(S+0.5) ~ log(A) | (taxon.group + island.type +
abs(latitude) + I(log(extent)))^2 | study, DAT,
n.clones=5, n.adapt=2000, n.update=3000, n.iter=1000)
## SAR
DATS <- DAT[1:191,]
(x1 <- hsarx(log(S+0.5) ~ log(A),
DATS[DATS$study=="abbott1978bird",], n.clones=2))
## SARX
DATS$rnd <- rnorm(nrow(DATS), log(DATS$extent))
(x2 <- hsarx(log(S+0.5) ~ log(A) * rnd,
DATS[DATS$study=="abbott1978bird",], n.clones=2))
## HSAR
(x3 <- hsarx(log(S+0.5) ~ log(A) | 1 | study,
DATS, n.clones=2, n.iter=1000))
## HSARX
(x4 <- hsarx(log(S+0.5) ~ log(A) | abs(latitude) | study,
DATS, n.clones=2, n.iter=1000))
}
Run the code above in your browser using DataLab