envelope {sdlrm} | R Documentation |
Envelope Plot for the Residuals of a Modified Skew Discrete Laplace Regression Fit
Description
Provides the normal probability plot with simulated envelope of Pearson residuals and randomized quantile residuals resulting from the modified skew discrete Laplace (SDL) regression fit.
Usage
envelope(object, nsim = 99, progressBar = TRUE, plot = TRUE, ...)
## S3 method for class 'envelope'
print(x, ...)
## S3 method for class 'envelope'
plot(x, type = c("quantile", "pearson"), level = 0.95, ...)
Arguments
object , x |
an object of class |
nsim |
the number of replicates. The default is |
progressBar |
logical; if |
plot |
logical; if |
... |
further arguments passed to or from other methods. |
type |
character; specifies which residual should be produced in the
envelope plot. The available options are |
level |
level of the sample quantile of the residual used in the construction of confidence bands. |
Value
envelope
returns an "sdlrm_envel"
object which consists of
a list with the following components:
- residuals
a list with the quantile and pearson residuals resulting from the fit of the SDL regression model.
- simulation
a list whose components are matrices containing the ordered quantile and pearson residuals of the simulation for the plot envelope.
The method plot
makes the envelope plot.
Author(s)
Rodrigo M. R. de Medeiros <rodrigo.matheus@ufrn.br>
References
Medeiros, R. M. R., and Bourguignon, M. (2025). Modified skew discrete Laplace regression models for integer valued data with applications to paired samples. Manuscript submitted for publication.
Examples
## Data set: pss (for description run ?pss)
barplot(table(pss$difference), xlab = "PSS index difference", ylab = "Frequency")
boxplot(pss$difference ~ pss$group, xlab = "Group", ylab = "PSS index difference")
## Fit with a model only for the mean (mode = 1)
fit <- sdlrm(difference ~ group, data = pss, xi = 1)
## Building the envelope plot
envel <- envelope(fit, plot = FALSE)
# Class
class(envel)
envel
# Plot for the randomized quantile residuals (default)
plot(envel)
# Plot for the Pearson residuals
plot(envel, type = "pearson")