plot_residuals: Plot Residuals

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/ares.r

Description

Extract and/or plot the model residuals

Usage

1
2
plot_residuals(x, gaps = FALSE, type = "deviance",
	 band=c(-3,3), date.format = "%d/%m/%Y", new = TRUE, ...)

Arguments

x

a model fitted by fit_core or a vector of the class residuals

gaps

a logical indicating whether .ares.selection should be honoured

type

a quoted string indicating the type of residuals to extract. Default is "deviance". See get_residuals

band

a vector limits to plot the band. If NULL, the band is omitted. Default is c(-3,3)

date.format

a string indicating the date format for the horizontal axis. Default is dd/mm/yyyy See strptime for more options

new

if TRUE a new graph window is opened

...

further options for plot

Details

If x is a model then the residuals are extracted with get_residuals. If x is a vector of the class residuals the function works as a method for the generic function plot, therefore only the graph is plotted.

Value

A vector of class residuals with extracted and/or adjusted residuals of the model.

Author(s)

Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br

References

McGullagh, P., Nelder, J. A. (1989) Generalized linear models. Chapman and Hall.

Hastie, T., Tibshirani, R. (1990) Generalized additive models. 2 ed. Chapman and Hall.

Pierce, D. A., Schafer, D. W. (1986) Residuals in generalized linear models. Journal of the American Statistical Association, 81(396),977–986.

See Also

get_residuals,resid,gam,glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(admrio)
setup(admrio,"date")
f <- resp5~s(time)+weekdays+s(tmpmax)+s(humid)
m <- fit_core(f)
## extract the residuals and plot
r1 <- plot_residuals(m)

## extract first then plot
r <- get_residuals(m,"adj_deviance")
plot(r)

wjunger/ares documentation built on Dec. 23, 2021, 5:17 p.m.