View source: R/04_sdl_regression.R
sdlrm | R Documentation |
Fit of the modified skew discrete Laplace (SDL) regression model via maximum
likelihood for a parameterization of this distribution that is indexed by the mean, a
dispersion parameter, and the mode (xi
).
sdlrm(
formula,
data,
subset,
na.action,
phi.link = "log",
xi = 0,
control = sdl_control(...),
...
)
## S3 method for class 'sdlrm'
print(x, digits = max(3, getOption("digits") - 3), ...)
formula |
a symbolic description of the model, of type |
data |
an optional data frame containing the variables in the formula. By default the variables are taken from environment(formula). |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. (See additional details about how this argument interacts with data-dependent bases in the ‘Details’ section of the model.frame documentation.) |
na.action |
a function which indicates what should happen when the data contain |
phi.link |
character specification of the link function for the dispersion parameter. The links
|
xi |
the mode of the distribution, an integer value. |
control |
a list of control arguments specified via |
... |
arguments passed to |
x |
a fitted model object of class |
digits |
a non-null value for digits specifies the minimum number of significant digits to be printed in values. |
The sdlrm
function returns an object of class "sdlrm"
, which consists of a
list with the following components:
a list containing the elements "mean
" and "dispersion
" that
consist of the estimates of the coefficients associated with the mean and the dispersion
parameter, respectively.
a vector with the fitted means.
a vector with the fitted dispersion parameters.
the link function used for the dispersion parameter model.
the specified mode for the model.
log-likelihood value of the fitted model.
asymptotic covariance matrix of the maximum likelihood estimator of the model parameters vector.
Sample size.
the response vector.
a list with elements "mean
" and "dispersion
" containing the
model matrices from the respective models.
object returned by optim
function in the sdlrm
function.
the function call.
the formula used to specify the model in sdlrm
.
a list with elements "mean", "dispersion" and "full" containing the terms objects for the respective models.
The print()
function returns a basic summary of the model fit with the estimated
coefficients, the log-likelihood value, the mode specified in the fit, and the Akaike (AIC)
and Bayesian (BIC) information criteria.
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.
summary.sdlrm
for more detailed summaries,
residuals.sdlrm
to extract residuals from the fitted model,
predict.sdlrm
for predictions, including mean and dispersion fitted values,
fitted variances, and fitted quantiles,
plot.sdlrm
for diagnostic plots.
choose_mode
for mode estimation via profile likelihood.
envelope
to create normal probability graphs with simulated envelope.
disp_test
to test the hypothesis of constant dispersion.
Information on additional methods for "sdlrm"
objects can be found at sdlrm-methods
.
# 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)
fit0 <- sdlrm(difference ~ group, data = pss, xi = 1)
fit0
summary(fit0)
# Fit a double model (mean and dispersion)
fit <- sdlrm(difference ~ group | group, data = pss, xi = 1)
fit
summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.