qqresid {assessor} | R Documentation |
QQ-plots of DPIT residuals
Description
Makes a QQ-plot of the DPIT residuals calculated from resid_disc()
, resid_semiconti()
or resid_zeroinfl()
.
The plot should be close to the diagonal if the model is correctly specified.
Note that this function does not return residuals. To get both residuals and QQ-plot,
use resid_disc()
, resid_semiconti()
and resid_zeroinfl()
.
Usage
qqresid(model, scale="normal")
Arguments
model |
Fitted model object (e.g., |
scale |
You can choose the scale of the residuals between |
Value
A QQ plot.
x-axis: Theoretical quantiles
y-axis: Sample quantiles generated by DPIT residuals
See Also
resid_disc()
, resid_semiconti()
, resid_zeroinfl()
Examples
n <- 100
b <- c(2, 1, -2)
x1 <- rnorm(n)
x2 <- rbinom(n, 1, 0.7)
y <- rpois(n, exp(b[1] + b[2] * x1 + b[3] * x2))
m1 <- glm(y ~ x1 + x2, family = poisson)
qqresid(m1, scale = "normal")
qqresid(m1, scale = "uniform")