View source: R/05_sdl_methods.R
residuals.sdlrm | R Documentation |
Residuals resulting from fitting a modified Laplace discrete skew regression.
## S3 method for class 'sdlrm'
residuals(object, type = c("quantile", "pearson", "response"), ...)
object |
an object of class |
type |
character; specifies which residual should be extracted.
The available arguments are |
... |
further arguments passed to or from other methods. |
A vector with the required residuals.
## 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)
## Randomized quantile residuals
rq <- residuals(fit)
## Pearson residuals
rp <- residuals(fit, type = "pearson")
## Raw response residuals
rr <- residuals(fit, type = "response")
cbind(quantile = rq, pearson = rp, raw = rr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.