PrussianHorses | R Documentation |
Data collected by Ladsilaus von Bortkiewicz (1898), Das Gesetz der kleinen Zahlen.
data(PrussianHorses)
kicks: Count of soldier deaths from horse kicks
year: Calendar year
corps: Military corps (division). G is the guard corps.
Richard McElreath
von Bortkiewicz (1898), Das Gesetz der kleinen Zahlen
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.