# serp Smooth Effects on Response Penalty for CLM

A regularization method for the cumulative link models (CLM). The ‘serp’ function applies the ‘smooth-effect-on-response penalty’ (SERP) on the estimates of the general CLM, causing all subject-specific effects associated with each variable in the model to shrink towards a unique global effect. Fitting is done using a modified Newton’s method. Several standard model performance and descriptive methods are also available. See Ugba et al., 2021 and Tutz and Gertheiss, 2016 for more details.

## Example

Consider the cumulative logit model of the wine dataset, where the rating of wine bitterness is predicted with the two treatment factors, temperature and contact.

``````## The unpenalized non-proportional odds model returns unbounded estimates, hence,
## not fully identifiable.
f1 <- serp(rating ~ temp + contact, slope = "unparallel",
reverse = TRUE, link = "logit", data = wine)
coef(f1)``````
``````## The penalized non-proportional odds model with a user-supplied lambda gives
## a fully identified model with bounded estimates. A suitable tuning criterion
## could as well be used to select lambda (e.g., cv)
f2 <- serp(rating ~ temp + contact, slope = "penalize",
link = "logit", reverse = TRUE, tuneMethod = "user",
lambda = 1e1 ,data = wine)
coef(f2)``````
``````## A penalized partial proportional odds model with one variable set to
## global effect is also possible.
f3 <- serp(rating ~ temp + contact, slope = "penalize",
reverse = TRUE, link = "logit", tuneMethod = "user",
lambda = 2e1, globalEff = ~ temp, data = wine)
coef(f3)``````
``````## The unpenalized proportional odds model with constrained estimates. Using a
## very strong lambda in f2 will result in estimates equal to estimates in f4.
f4 <-  serp(rating ~ temp + contact, slope = "parallel",
reverse = FALSE, link = "logit", data = wine)
summary(f4)``````

## Installation:

The released version of serp can be installed from CRAN with:

``install.packages("serp")``

or the development version from GitHub with:

``````# install.packages("devtools")
devtools::install_github("ejikeugba/serp")``````

``library(serp)``