Description Usage Format Details Source Examples
The data give counts of deaths from cancer of the Larynx by region of Germany from 1986 to 1990, along with the expected count according to the populaiton of the region and the total deaths for the whle of Germany. A list of polygons defining the boundaries of the districts is also provided.
1 2 | data(larynx)
data(german.polys)
|
The Larynx
data frame has the following columns
A factor with 544 levels identifying the health reporting region.
Expected number of deaths according to population of region and pan-German total.
Number of deaths from cancer of the Larynx in the region.
A measure of level of smoking in the region.
german.polys
is a list with one item per health reporting region in Larynx
. The name of each item identifies the region using the same labels as Larynx$region
. Each item is a two column matrix defining a polygon approximating the outline of the region it relates to. Each row of the matrix defines a polygon vertex. NA
rows separate geographically disjoint areas which are part of the same region.
Note that the polygons are set up to exactly share vertices with their neighbours, which facilitates the auto-identification of neighbourhood structures.
Data are from the INLA website:
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(gamair);require(mgcv)
data(larynx);data(german.polys)
## plot raw deaths over expected deaths by region...
polys.plot(german.polys,Larynx$Y/Larynx$E)
## Fit additive model with Gauss MRF for space and smooth of
## smoking level. k somewhat low to reduce computational time
b <- gam(Y~s(region,k=60,bs="mrf",xt=list(polys=german.polys)) +
offset(log(E))+s(x,k=10),family=poisson,data=Larynx,method="REML")
summary(b)
plot(b,scheme=c(0,1),pages=1)
|
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-20. For overview type 'help("mgcv-package")'.
Family: poisson
Link function: log
Formula:
Y ~ s(region, k = 60, bs = "mrf", xt = list(polys = german.polys)) +
offset(log(E)) + s(x, k = 10)
Parametric coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.04030 0.01399 -2.88 0.00398 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Approximate significance of smooth terms:
edf Ref.df Chi.sq p-value
s(region) 31.055 42.930 143.05 1.1e-12 ***
s(x) 1.971 2.498 40.46 1.1e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
R-sq.(adj) = 0.941 Deviance explained = 31.6%
-REML = 1400.4 Scale est. = 1 n = 544
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.