Learn R Programming

emax.glm (version 0.1.2)

residuals.em.glm: Deviance residuals for an 'em.glm' object.

Description

Deviance residuals for an 'em.glm' object.

Usage

# S3 method for em.glm
residuals(object, x, y, weight = c(1),
  type = "deviance", ...)

Arguments

object

An 'em.glm' object.

x

An n-by-p design matrix.

y

A vector of observation of length n.

weight

A n length vector of observation weight terms. This is currently designed to be either the exposure for a Poisson model or the number of trials for a Logistic model.

type

Residual type - either deviance or Pearson's residuals.

...

other arguments.

Value

An n length vector of residuals.

Examples

Run this code
# NOT RUN {
x <- model.matrix(~ factor(wool) + factor(tension), warpbreaks)
y <- warpbreaks$breaks

m <- em.glm(x = x, y = y, K = 2, b.init = "random")

residuals(m, x = x, y = y)

# }

Run the code above in your browser using DataLab