View source: R/06_choose_mode.R
choose_mode | R Documentation |
Estimation of the mode in a modified skew discrete Laplace (SDL) regression fit via profile log-likelihood.
choose_mode(
object,
grid = -5:5,
trace = TRUE,
plot = TRUE,
control = sdl_control(...),
...
)
## S3 method for class 'choose_mode'
print(x, ...)
## S3 method for class 'choose_mode'
plot(x, ...)
object |
an object of class |
grid |
grid of values that will be used to evaluate the profile log-likelihood function. |
trace |
logical; if |
plot |
logical; if |
control |
a list of control arguments specified via |
... |
further arguments passed to |
x |
an object of class |
An object of class "choose_mode"
. More specifically, it returns a list in which
each element consists of the fit of the modified SDL regression with each value of the mode
specified in grid
. In addition, it has the elements “logLik”
with the vector
of log-likelihood values for each adjustment and “grid”
with the specified grid of
values.
The print
function summarizes the fits by displaying, for each value in grid
,
the log-likelihood value and the Akaike (AIC) and Bayesian (BIC) information criteria. The
plot
function returns a graph of the profiled likelihood of the mode, highlighting its
maximum.
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 with xi = 0 (default)
fit0 <- sdlrm(difference ~ group, data = pss)
# Choosing the mode on the grid {-10, -9, ..., 0, ..., 9, 10}
fit <- choose_mode(fit0, grid = -10:10)
# Class
class(fit)
# It is possible to recovery the plot:
plot(fit)
# and the trace:
fit
# Fit with xi = 1
fit[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.