View source: R/07_sdl_diagnostic.R
envelope | R Documentation |
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.
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, ...)
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. |
envelope
returns an "sdlrm_envel"
object which consists of
a list with the following components:
a list with the quantile and pearson residuals resulting from the fit of the SDL regression model.
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.
Rodrigo M. R. de Medeiros <rodrigo.matheus@ufrn.br>
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.
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.