predict.sdlrm {sdlrm} | R Documentation |
Predict Method for a Modified Skew Discrete Laplace Regression Fit
Description
Obtains predictions from a fitted modified skew discrete Laplace regression object.
Usage
## S3 method for class 'sdlrm'
predict(
object,
newdata = NULL,
type = c("response", "dispersion", "variance", "quantile"),
at = 0.5,
na.action = stats::na.pass,
...
)
Arguments
object |
an object of class |
newdata |
optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used. |
type |
the type of prediction required. The default is on the scale of
the response variable |
at |
the order of the quantile to be predicted if
|
na.action |
function determining what should be done with missing
values in |
... |
arguments passed to or from other methods. |
Value
A vector with the required predictions.
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 a double model (mode = 1)
fit <- sdlrm(difference ~ group | group, data = pss, xi = 1)
## Fitted values (fitted means)
means <- predict(fit)
means
## Fitted dispersion parameter
phi <- predict(fit, type = "dispersion")
phi
## Fitted variances
vars <- predict(fit, type = "variance")
vars
## Fitted medians
medians <- predict(fit, type = "quantile")
medians
## Fitted third quartiles
quantiles <- predict(fit, type = "quantile", at = 0.75)
quantiles