Generate Diagnostic Plots for a bdGlm Object

DESCRIPTION:

Creates a set of plots suitable for assessing a fitted bigdata generalized linear model of class bdGlm. The plots use hexaginal binning since the number of points is typically very large.

This function requires the bigdata library section to be loaded.

USAGE:

plot.bdGlm(x, residuals=NULL, ask=F, which.plots=NULL, xbin=20, ...)

REQUIRED ARGUMENTS:

x
a bdGlm object.

OPTIONAL ARGUMENTS:

residuals
if residuals is a vector with the same length as each fitted term in x, then these are taken to be the residuals to be used in plotting. This is useful when a type other than "deviance" residuals is wanted in the plots produced.
ask
if TRUE, plot.bdGlm operates in interactive mode.
which.plots
numeric vector taking values between 1 and 3 inclusive, specifying which of the plots (described below) to display.
xbins
number of hexagonal bins across the x-axis values.

SIDE EFFECTS:

Several plots are produced for the fitted model represented by the object x. These diagnostic plots can be one or all of the following:

1: Residuals against Fitted Values

This is useful for diagnosing:

(1) whether the relationship between the response and explanatory variables is linear -- if any curvature is observed than the model might be improved by adding additional, nonlinear terms to the model,

(2) whether the conditional variance of the residuals depends on the explanatory variables -- if the residuals are larger (positive and negative) for larger predicted values, then a nonlinear transformation of the response such as a square-root or log transformation may be useful.

Caution -- the use of this plot is not as easy for some probability models as for the normal probability model (used in lm).

2: Square Root of the Absolute value of Residuals against Predicted (Linear) Values

This is also useful for diagnosing whether the conditional variance of the residuals is constant. The square-root transformation reduces the visual impact of large residuals, but also undesirably inflates small differences in magnitudes for residuals near zero.

3: Response against Fitted Values

4: Normal QQplot of Standardized Residuals

This is useful for diagnosing whether the distribution of the residuals is normal (Gaussian). This is irrelevant for probability models other than Gaussian.

DETAILS:

This function is a method for the generic function for class bdGlm. It can be invoked by calling for an object x of the appropriate class, or directly by calling regardless of the class of the object.

When ask=T, rather than produce each plot sequentially, plot.bdGlm displays a menu listing all the plots that can be produced. If the menu is not desired but a pause between plots is still wanted one must set par(ask=T) before invoking this command with argument ask=F.

SEE ALSO:

,

EXAMPLES:

# Create sample bdGlm object:
bigKyph <- as.bdFrame(kyphosis)
glmob <- glm(Kyphosis ~ Age + Start, family=binomial, data=bigKyph)
plot(glmob, ask = T)  # Interactive version
par(mfrow=c(2,2))
plot(glmob)  # All on at once, on one page