set.seed(1)
data(occupationalStatus)
## Fit an association model with homogeneous row-column effects
RChomog <- gnm(Freq ~ origin + destination + Diag(origin, destination) +
Nonlin(MultHomog(origin, destination)), family = poisson,
data = occupationalStatus)
## Plot model diagnostics
plot(RChomog)
## Put 4 plots on 1 page; allow room for printing model formula in outer margin:
par(mfrow = c(2, 2), oma = c(0, 0, 3, 0))
title <- paste(deparse(RChomog$formula, width.cutoff = 50), collapse = "")
plot(RChomog, sub.caption = title)
## Fit smoother curves
plot(RChomog, sub.caption = title, panel = panel.smooth)
plot(RChomog, sub.caption = title, panel = function(x,y) panel.smooth(x, y, span = 1))
Run the code above in your browser using DataLab