plots: Plot Diagnostics for glm_hP and glm_CMP Objects

plotsR Documentation

Plot Diagnostics for glm_hP and glm_CMP Objects

Description

Two plots are currently available: a plot of residuals against fitted values and a Normal Q-Q plot.

Usage

## S3 method for class 'glm_hP'
plot(
  x,
  type = c("quantile", "pearson", "response"),
  ask = prod(graphics::par("mfcol")) < 2 && grDevices::dev.interactive(),
  ...
)

## S3 method for class 'glm_CMP'
plot(
  x,
  type = c("quantile", "pearson", "response"),
  ask = prod(graphics::par("mfcol")) < 2 && grDevices::dev.interactive(),
  ...
)

Arguments

x

glm_hP or glm_CMP object, typically the result of glm.hP or glm.CMP.

type

the type of residuals. The alternatives are: "quantile" (default), "pearson" and "response". Can be abbreviated.

ask

logical; if TRUE, the user is asked before each plot, see par(ask=.).

...

other parameters to be passed through to plotting functions.

Examples

## Fit the hyper-Poisson model
Bids$size.sq <- Bids$size ^ 2
hP.fit <- glm.hP(formula.mu = numbids ~ leglrest + rearest + finrest +
              whtknght + bidprem + insthold + size + size.sq + regulatn,
              formula.gamma = numbids ~ 1, data = Bids)
oldpar <- par(mfrow = c(1, 2))

## Plot diagnostics

plot(hP.fit)
par(oldpar)
## Fit the COM-Poisson model
Bids$size.sq <- Bids$size ^ 2
CMP.fit <- glm.CMP(formula.mu = numbids ~ leglrest + rearest + finrest +
              whtknght + bidprem + insthold + size + size.sq + regulatn,
              formula.nu = numbids ~ 1, data = Bids)
oldpar <- par(mfrow = c(1, 2))

## Plot diagnostics
plot(CMP.fit)
par(oldpar)

DGLMExtPois documentation built on Sept. 4, 2023, 5:06 p.m.