shrink.heur {apricom}R Documentation

Shrinkage After Estimation Using Heuristic Formulae


Shrink regression coefficients using heuristic formulae, first described by Van Houwelingen and Le Cessie (Stat. Med., 1990)


shrink.heur(dataset, model, DF, int = TRUE, int.adj = FALSE)



a dataset for regression analysis. Data should be in the form of a matrix, with the outcome variable as the final column. Application of the datashape function beforehand is recommended, especially if categorical predictors are present. For regression with an intercept included a column vector of 1s should be included before the dataset (see examples)


type of regression model. Either "linear" or "logistic".


the number of degrees of freedom or number of predictors in the model. If DF is missing the value will be automatically estimated. This may be inaccurate for complex models with non-linear terms.


logical. If TRUE the model will include a regression intercept.


logical. If TRUE the regression intercept will be re-estimated after shrinkage of the regression coefficients. If FALSE the regression intercept will be re-estimated as described by Harrell 2001.


This function can be used to estimate shrunken regression coefficients based on heuristic formulae (see References). A linear or logistic regression model with an intercept is fitted to the data, and a shrinkage factor is estimated. The shrinkage factor is then applied to the regression coefficients. If int.adj == FALSE the intercept value is estimated as described in Harrell 2001.If int.adj == TRUE the intercept value will be re-estimated by refitting the model with the shrunken coefficients.

The heuristic formula work by applying the number of model degrees of freedom (or the number of predictors) as a penalty, and so as the model becomes more complex, the necessary shrinkage increases, and the shrinkage factor becomes closer to zero.


shrink.heur returns a list containing the following:


the raw regression model coefficients, pre-shrinkage.


the shrunken regression model coefficients


the heuristic shrinkage factor


the number of degrees of freedom or number of predictors in the model


Warning: In poorly fitting models that includea large number of predictors the number of degrees of freedom may approch or exceed the model chi square. In such cases the shrinkage factor will be very small or even negative, and a different model building strategy is recommended.


Harrell, F. E. "Regression modeling strategies: with applications to linear models, logistic regression, and survival analysis." Springer, (2001).

Harrell, F. E., Kerry L. Lee, and Daniel B. Mark. "Tutorial in biostatistics multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors." Statistics in medicine (1996) 15:361-387.

Steyerberg, E. "Clinical Prediction Models" Springer (2009)

Van Houwelingen, J. C. and Le Cessie, S., "Predictive value of statistical models." Statistics in medicine (1990) 9:1303:1325.


## Example 1: Linear regression using the iris dataset
## shrinkage using a heuristic formula
data(iris) <- as.matrix(iris[, 1:4]) <- cbind(1,
shrink.heur(dataset =, model = "linear")

## Example 2: logistic regression using a subset of the mtcars data
## shrinkage using a heuristic formula
data(mtcars) <- cbind(1,datashape(mtcars, y = 8, x = c(1,6,9)))
shrink.heur(dataset =, model = "logistic", DF = 3,
int = TRUE, int.adj = TRUE)

[Package apricom version 1.0.0 Index]