predict.sdlrm: Predict Method for a Modified Skew Discrete Laplace...

predict.sdlrmR 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 "sdlrm", a result of a call to sdlrm.

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 ("response"), that is, the fitted values (fitted means). The alternative "dispersion" provides the fitted dispersion parameters, while "variance" provides the fitted variances. Finally, the option "quantile" gives the fitted quantiles in the order specified via at.

at

the order of the quantile to be predicted if type = "quantile". The default is to predict the median, that is, at = 0.5.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

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

sdlrm documentation built on April 12, 2025, 1:15 a.m.