Learn R Programming

geepack (version 1.1-6)

geeglm: Fit Generalized Estimating Equations (GEE)

Description

The geeglm function fits generalized estimating equations using the 'geese.fit' function of the 'geepack' package for doing the actual computations. geeglm has a syntax similar to glm and returns an object similar to a glm object. An important feature of geeglm, is that an anova method exists for these models.

Usage

geeglm(formula, family = gaussian, data=parent.frame(), weights, subset, 
                  na.action, start = NULL, etastart, mustart, offset,
                  control = geese.control(...), 
                  method = "glm.fit", x = FALSE, y = TRUE,
                  contrasts = NULL, 
                  id, waves=NULL, zcor=NULL, 
                  corstr = "independence",
                  scale.fix = FALSE,
                  scale.value =1, std.err="san.se",
                  ...)

Arguments

formula
See corresponding documentation to glm
family
See corresponding documentation to glm
data
See corresponding documentation to glm
weights
See corresponding documentation to glm
subset
See corresponding documentation to glm
na.action
No action is taken. Indeed geeglm only works on complete data.
start
See corresponding documentation to glm
etastart
See corresponding documentation to glm
mustart
See corresponding documentation to glm
offset
See corresponding documentation to glm
control
See corresponding documentation to glm
method
See corresponding documentation to glm
x
See corresponding documentation to glm
y
See corresponding documentation to glm
contrasts
See corresponding documentation to glm
id
a vector which identifies the clusters. The length of `id' should be the same as the number of observations. Data are assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the for
waves
Wariable specifying the ordering of repeated mesurements on the same unit. Also used in connection with missing values. See examples below.
zcor
Used for entering a user defined working correlation structure.
corstr
a character string specifying the correlation structure. The following are permitted: '"independence"', '"exchangeable"', '"ar1"', '"unstructured"' and '"userdefined"'
scale.fix
a logical variable; if true, the scale parameter is fixed at the value of 'scale.value'.
scale.value
numeric variable giving the value to which the scale parameter should be fixed; used only if 'scale.fix == TRUE'.
std.err
Type of standard error to be calculated. Defualt 'san.se' is the usual robust estimate. Other options are 'jack': if approximate jackknife variance estimate should be computed. 'j1s': if 1-step jackknife variance estimate
...
further arguments passed to or from other methods.

Value

  • An object of type 'geeglm'

Warning

Use "unstructured" correlation structure only with great care. (It may cause R to crash).

Details

In the case of corstr="fixed" one must provide the zcor vector if the clusters have unequal sizes. Clusters with size one must not be represented in zcor.

References

Liang, K.Y. and Zeger, S.L. (1986) Longitudinal data analysis using generalized linear models. Biometrika, *73* 13-22. Prentice, R.L. and Zhao, L.P. (1991). Estimating equations for parameters in means and covariances of multivariate discrete and continuous responses. Biometrics, *47* 825-839.

See Also

geese, glm,anova.geeglm

Examples

Run this code
data(dietox)
dietox$Cu     <- as.factor(dietox$Cu)
mf <- formula(Weight~Cu*(Time+I(Time^2)+I(Time^3)))
gee1 <- geeglm(mf, data=dietox, id=Pig, family=poisson("identity"),corstr="ar1")
gee1
summary(gee1)

mf2 <- formula(Weight~Cu*Time+I(Time^2)+I(Time^3))
gee2 <- geeglm(mf2, data=dietox, id=Pig, family=poisson("identity"),corstr="ar1")
anova(gee2)

Run the code above in your browser using DataLab