# NOT RUN {
data(PrussianHorses)
d <- PrussianHorses
dat <- list(
kicks = d$kicks,
year = as.integer(as.factor(d$year)), # year as category
corps = as.integer(d$corps)
)
m0 <- ulam(
alist(
kicks ~ poisson( lambda ),
log(lambda) <- d[corps] + y[year],
d[corps] ~ normal(0,0.5),
y[year] ~ normal(0,0.5)
), data=dat )
plot(precis(m0,2))
# }
Run the code above in your browser using DataLab