###### Example 1: Effect of ozone-enriched atmosphere on growth of sitka spruces
data(spruces)
mod1 <- size ~ poly(days,4) + treat
fit1 <- glmgee(mod1, id=tree, family=Gamma(log), corstr="AR-M-dependent", data=spruces)
dfbs1 <- dfbeta(fit1, method="full", coefs="treat", col="red", lty=1, lwd=1, col.lab="blue",
col.axis="blue", col.main="black", family="mono", cex=0.8, main="treat")
### Calculation by hand of dfbeta for the tree labeled by "N1T01"
onestep1 <- glmgee(mod1, id=tree, family=Gamma(log), corstr="AR-M-dependent",
data=spruces, start=coef(fit1), subset=c(tree!="N1T01"), maxit=1)
coef(fit1)-coef(onestep1)
dfbs1[rownames(dfbs1)=="N1T01",]
###### Example 2: Treatment for severe postnatal depression
data(depression)
mod2 <- depressd ~ visit + group
fit2 <- glmgee(mod2, id=subj, family=binomial(logit), corstr="AR-M-dependent",
data=depression)
dfbs2 <- dfbeta(fit2, method="full", coefs="group" ,col="red", lty=1, lwd=1, col.lab="blue",
col.axis="blue", col.main="black", family="mono", cex=0.8, main="group")
### Calculation by hand of dfbeta for the woman labeled by "18"
onestep2 <- glmgee(mod2, id=subj, family=binomial(logit), corstr="AR-M-dependent",
data=depression, start=coef(fit2), subset=c(subj!=18), maxit=1)
coef(fit2)-coef(onestep2)
dfbs2[rownames(dfbs2)==18,]
###### Example 3: Treatment for severe postnatal depression (2)
mod3 <- dep ~ visit*group
fit3 <- glmgee(mod3, id=subj, family=gaussian(identity), corstr="AR-M-dependent",
data=depression)
dfbs3 <- dfbeta(fit3, method="full", coefs="visit:group" ,col="red", lty=1, lwd=1, col.lab="blue",
col.axis="blue", col.main="black", family="mono", cex=0.8, main="visit:group")
### Calculation by hand of dfbeta for the woman labeled by "18"
onestep3 <- glmgee(mod3, id=subj, family=gaussian(identity), corstr="AR-M-dependent",
data=depression, start=coef(fit3), subset=c(subj!=18), maxit=1)
coef(fit3)-coef(onestep3)
dfbs3[rownames(dfbs3)==18,]
Run the code above in your browser using DataLab