plot.lmf | R Documentation |
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.
## S3 method for class 'lmf' ## S3 method for class 'lmf' plot(x, what = "total", ...)
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. |
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.
Thomas Kvalnes
lmf
, plot.lm
#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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.