Learn R Programming

pgam (version 0.3.3)

envelope: Normal plot with simulated envelope of the residuals.

Description

A normal plot with simulated envelope of the residual is produced.

Usage

envelope(object, type = "deviance", size = 0.95, rep = 20, epsilon = 0.001, maxit = 100, plot = TRUE, verbose = FALSE, ...)

Arguments

object
object of class pgam holding the fitted model
type
type of residuals to be extracted. Default is deviance. Options are described in residuals.pgam
size
value giving the size of the envelope. Default is .95 which is equivalent to a 95% band
rep
number of replications for envelope construction. Default is 20
epsilon
convergence control to be passed to pgam
maxit
convergence control to be passed to pgam
plot
if TRUE a plot of the envelope is produced
verbose
if TRUE a sort of information is printed during the running time
...
further arguments to plot function

Value

  • An object of class envelope holding the information needed to plot the envelope.

Details

Sometimes the usual Q-Q plot shows an unsatisfactory pattern of the residuals of a model fitted and we are led to think that the model is badly specificated. The normal plot with simulated envelope indicates that under the distribution of the response variable the model is OK if only a few points fall off the envelope.

If object is of class pgam the envelope is estimated and optionally plotted, else if is of class envelope then it is only plotted.

References

Atkinson, A. C. (1985) Plots, transformations and regression : an introduction to graphical methods of diagnostic regression analysis. Oxford Science Publications, Oxford.

See Also

pgam, predict.pgam, residuals.pgam

Examples

Run this code
library(pgam)
data(aihrio)
attach(aihrio)
form <- ITRESP5~f(WEEK)+HOLIDAYS+rain+PM+g(tmpmax,7)+g(wet,3)
m <- pgam(form,aihrio,omega=.8,beta=.01,maxit=1e2,eps=1e-4,optim.method="BFGS",partial.resid="response")

e <- envelope(m)

Run the code above in your browser using DataLab