Computes residuals for gee Objects

DESCRIPTION:

Computes the various types of residuals available for gee objects.

USAGE:

residuals.gee(object, type="mean") 

This is a method for the function residuals() for objects inheriting from class "gee". Note that as several types of residuals are available for gee objects, there is an additional optional argument type.

REQUIRED ARGUMENTS:

object
an object inheriting from class "gee" representing a fitted model.

OPTIONAL ARGUMENTS:

type
a character string indicatung the desired type of residual, with choices "response" (default), "pearson", "symmetric", "model" or "score".

VALUE:

Selected residuals of the gee model.

DETAILS:

type="response"
The response residuals are simply the residuals component of the "gee" object, y minus the fitted values for the response. They are used in constructing the other types of residuals.
type="pearson"
The Pearson residuals are standardized residuals created by dividing the response residuals by the estimated observation variance, V. When the scale is estimated, the sum of squared Pearson residuals adds up to the degrees of freedom for the regressors (N-p).
type="symmetric",type="model"
The symmetric and model residuals are based on multiplying the residuals in each cluster by a symmetric matrix P or a model derived matrix Q, respectively, where the matrix product P P or Q Q' is the inverse of the working cluster variance. P and Q will differ from cluster to cluster unless the design is balanced. Q is derived from the definition used in gee for the empirical correlation, and Q = S diag(W) where S S = inverse(R), the inverse of the working correlation matrix, where 1/(W(i)*W(i)) = V(i).
When V is constant for each cluster the symmetric and model residuals produce the same values. This occurs when the predictors are constant for a given subject or the link is identity.
type="score"
The score residuals, S, are derived from the GEE score equation for the regression coefficients. They are defined so that the sum of X' S vanishes over all the clusters, where X is the covariate matrix.
type="deviance"
Deviance residuals are not yet implemented.

SEE ALSO:

, , ,

EXAMPLES:

Seizure.Subject <- recordDesign(cluster = "Subject", data = Seizure)

gee.out <- gee(y~Time+group, cluster=cbind(clusterID,recordID),  
               variance="glm.scale", correlation="exchangeable", 
               family = poisson, link=log, data=Seizure.Subject) 

# produce a plot of fitted versus model residuals 
plot(fitted(gee.out), residuals(gee.out,type = "model"), 
     ylab="model residuals")