plotMeanVar | R Documentation |
Functions to create a Mean-Variance plot for checking the distribution assumptions of the mean and the variance. Distributions available are Gaussian, Poisson, QuasiPoisson, Gamma and Tweedie.
plotMeanVar(model, cut.bins = 20, save = FALSE, label = NULL, print = TRUE)
model |
Fitted model object (glm or gam) |
save |
( |
label |
Character string indicating an label to be added to the plot when using |
print |
Logical stating whether or not to print the plot. If FALSE then the plot object is returned. |
cut.prob.by |
Numerical input to state the increment for the sequence of cut probabilities. |
A plot showing the observed mean and variance (cutting the fitted values into bins and finding the mean fitted value and the variance for each bin) and the assumed relationship under various distributions depending on the model fitted (lines on the plot).
# load data
data(ns.data.re)
model<-glm(birds ~ observationhour + as.factor(floodebb) + as.factor(impact),
family='quasipoisson', data=ns.data.re)
plotMeanVar(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.