Estimate a shrinkage factor for shrinkage-after-estimation techniques, with application to linear regression models.

1 | ```
ols.shrink(b, dat, sdm)
``` |

`b` |
1 x |

`dat` |
a |

`sdm` |
the shrinkage design matrix. This determines the regression coefficients that will be involved in the shrinkage process. |

This is an accessory function that works together with `bootval`

, `splitval`

,
`kcrossval`

and `loocval`

to estimate a shrinkage factor. For further details,
see References. This function should not be used directly, and instead should
be called via one of the aforementioned shrinkage-after-estimation functions.

the function returns a shrinkage factor.

Currently, this function can only derive a single shrinkage factor for a given model, and is unable to estimate (weighted) predictor-specific shrinkage factors.

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

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

1 2 3 4 5 6 7 8 9 | ```
## Shrinkage design matrix examples for a model with an
## intercept and 4 predictors:
## 1. Uniform shrinkage (default design within apricomp).
sdm1 <- matrix(c(0, rep(1, 4)), nrow = 1)
print(sdm1)
## 2. Non-uniform shrinkage; 1 shrinkage factor applied only to the
## first two predictors
sdm2 <- matrix(c(0, 1, 1, 0, 0), nrow = 1)
print(sdm2)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.