### R packages are so easy to install, even I can do it. From within R ### I used: ### install.packages("gee", "/home/faculty/gustaf/myRlibs/") ### ### Or to use the package without installing it, the permissions are set ### (I think) so that you can use the library command below from R on unixlab library(gee, lib.loc="/home/faculty/gustaf/myRlibs/") ### simulate some clustered Poission data (50 clusters of 5 subjects each) clust.id <- NULL for (i in 1:50) { clust.id <- c(clust.id, rep(i,5)) } x <- rnorm(250) randeff <- rnorm(50,mean=0,sd=log(3)) y <- rpois(250, exp(log(10) + 0.25*x + randeff[clust.id])) postscript("margmodfig.ps") plot(clust.id, y) graphics.off() ### usual glm fit ignoring cluster structure fit.0 <- glm(y~x, family="poisson") ### marginal model fit with independence working correlation model fit.1 <- gee(y~x, id=clust.id, family=poisson, corstr="independence") ### marginal model fit with equi-correlated working correlation model fit.2 <- gee(y~x, id=clust.id, family=poisson, corstr="exchangeable")