## tests
# load data
data(geesimdata)
x<-geesimdata$x
y<-geesimdata$y
id<-geesimdata$id
corstr<-"exchangeable"
dist<-"poisson"
# obtain the estimates
library(geepack)
# x matrix already include the intercept column.
fit<-geeglm(y~x-1,data=geesimdata,family =dist,id=id,corstr = "ar1")
beta<-fit$coefficients
rho<-unlist(summary(fit)$corr[1])
phi<-unlist(summary(fit)$dispersion[1])
r<-rep(1,nrow(x))
ee.matrix<-ee.gee(y,x,r,id,beta,rho,phi,dist,corstr)
apply(ee.matrix,1,mean)
Run the code above in your browser using DataLab