plot.lmf {lmf}R Documentation

Plot diagnostics for an lmf object

Description

Plots four diagnostic plots for objects of class "lmf": a plot of residuals against fitted values, a Normal Q-Q plot, a Scale-Location plot of the square root of standardized residuals against fitted values and a plot of standardized residuals against leverage with indications of cooks distance.

Usage

## S3 method for class 'lmf'
  ## S3 method for class 'lmf'
plot(x, what = "total", ...)

Arguments

x

an object of class "lmf".

what

the part of the model for which diagnostic plots should be generated. Options are 'total' (default) for the overall plots and 'age-year' for plots for each separate linear regression for each age within each year.

...

additional arguments to be passed through to plotting functions.

Details

The function is constructed partly from modifications of script from the plot.lm function in package stats. See ?plot.lm for details on the plots provided.

Author(s)

Thomas Kvalnes

See Also

lmf, plot.lm

Examples

#Data set from Engen et al. 2012
data(sparrowdata)
#Fit model
lmf.1 <- lmf(formula = cbind(recruits, survival) ~ weight + tars,
               age = age, year = year, data = sparrowdata)
#Diagnostic plots across all age classes and years
par(mfrow = c(2, 2))
plot(lmf.1)
#Diagnostic plots for each age class within each year (the
#actual linear regressions)
par(mfrow = c(2, 2))
plot(lmf.1, what = "age-year")

[Package lmf version 1.2.1 Index]