qqresid | R Documentation |
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()
.
qqresid(model, scale="normal")
model |
Fitted model object (e.g., |
scale |
You can choose the scale of the residuals between |
A QQ plot.
x-axis: Theoretical quantiles
y-axis: Sample quantiles generated by DPIT residuals
resid_disc()
, resid_semiconti()
, resid_zeroinfl()
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.