Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

residuals.glmgee

Residuals for Generalized Estimating Equations


Description

Calculates residuals for a fitted generalized estimating equation.

Usage

## S3 method for class 'glmgee'
residuals(
  object,
  ...,
  type = c("mahalanobis", "standardized", "response"),
  plot.it = TRUE,
  identify
)

Arguments

object

a object of the class glmgee obtained from the fit of a generalized estimating equation.

...

further arguments passed to or from other methods

type

an (optional) character string giving the type of residuals which should be returned. The available options are: (1) the difference between the observed response and the fitted mean ("response"); (2) the standardized difference between the observed response and the fitted mean ("standardized"); (3) the distance between the observed response vector and the fitted mean vector using a metric based on the product between the cluster size and fitted variance-covariance matrix ("mahalanobis"). By default, type is set to be "mahalanobis".

plot.it

an (optional) logical switch indicating if a plot of the residuals is required. By default, plot.it is set to be TRUE.

identify

an (optional) integer value indicating the number of individuals/clusters to identify on the plot of residuals. This is only appropriate when plot.it=TRUE.

Value

A vector with the observed residuals type type.

Examples

mod <- size ~ poly(days,4) + treat
fit <- glmgee(mod, id=tree, family=Gamma("log"), data=spruce, corstr="AR-1")
residuals(fit,type="mahalanobis",col="red", pch=20,col.lab="blue",
          col.axis="blue",col.main="black",family="mono",cex=0.8)

glmtoolbox

Set of Tools to Data Analysis using Generalized Linear Models

v0.1.0
GPL-2 | GPL-3
Authors
Luis Hernando Vanegas [aut, cre], Luz Marina Rondón [aut], Gilberto A. Paula [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.