Learn R Programming

⚠️There's a newer version (2.10.0) of this package.Take me there.

projpred

The projpred R package performs the projection predictive variable selection for generalized linear and additive models as well as for generalized linear and additive multilevel models (with the support for additive models being still experimental). The package is compatible with the rstanarm and brms packages, but custom reference models can also be used.

The projection predictive variable selection is based on the ideas of Goutis and Robert (1998) and Dupuis and Robert (2003). The methods implemented in projpred are described in detail in Piironen et al. (2020) and Catalina et al. (2020). They are evaluated in comparison to many other methods in Piironen and Vehtari (2017). Type citation("projpred") in R (or see the CITATION file) for details on how to cite projpred.

Currently, the supported response distributions (objects of class family in R) are gaussian(), binomial() (via the brms package, brms::bernoulli() is also supported), and poisson().

The vignettes (currently, there is only a single one) illustrate how to use the projpred functions in conjunction. Details on the projpred functions as well as some shorter examples may be found in the documentation.

Installation

There are two ways for installing projpred: from CRAN or from GitHub. The GitHub version might be more recent than the CRAN version, but the CRAN version might be more stable.

From CRAN

install.packages("projpred")

From GitHub

This requires the devtools package, so if necessary, the following code will also install devtools (from CRAN):

if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
devtools::install_github("stan-dev/projpred", build_vignettes = TRUE)

To save time, you may omit build_vignettes = TRUE.

References

Catalina, A., Bürkner, P.-C., and Vehtari, A. (2020). Projection predictive inference for generalized linear and additive multilevel models. arXiv:2010.06994. URL: https://arxiv.org/abs/2010.06994.

Dupuis, J. A. and Robert, C. P. (2003). Variable selection in qualitative models via an entropic explanatory power. Journal of Statistical Planning and Inference, 111(1-2):77–94. DOI: 10.1016/S0378-3758(02)00286-0.

Goutis, C. and Robert, C. P. (1998). Model choice in generalised linear models: A Bayesian approach via Kullback–Leibler projections. Biometrika, 85(1):29–37.

Piironen, J. and Vehtari, A. (2017). Comparison of Bayesian predictive methods for model selection. Statistics and Computing, 27(3):711-735. DOI: 10.1007/s11222-016-9649-y.

Piironen, J., Paasiniemi, M., and Vehtari, A. (2020). Projective inference in high-dimensional problems: Prediction and feature selection. Electronic Journal of Statistics, 14(1):2155-2197. DOI: 10.1214/20-EJS1711.

Copy Link

Version

Install

install.packages('projpred')

Monthly Downloads

4,446

Version

2.2.1

License

GPL-3 | file LICENSE

Maintainer

Frank Weber

Last Published

September 20th, 2022

Functions in projpred (2.2.1)

print.vsel

Print results (summary) of variable selection
refmodel-init-get

Reference model structure
print.vselsummary

Print summary of variable selection
reexports

Objects exported from other packages
project

Projection onto submodel(s)
predict.refmodel

Predictions or log predictive densities from a reference model
pred-projection

Predictions from a submodel (after projection)
projpred-package

Projection predictive feature selection
mesquite

Mesquite data set
plot.vsel

Plot summary statistics of a variable selection
suggest_size

Suggest submodel size
solution_terms

Retrieve predictor solution path or predictor combination
summary.vsel

Summary statistics of a variable selection
varsel

Variable selection (without cross-validation)
cl_agg

Weighted averaging within clusters of parameter draws
cv-indices

Create cross-validation folds
df_binom

Binomial toy example
cv_varsel

Variable selection with cross-validation
as.matrix.projection

Extract projected parameter draws
break_up_matrix_term

Break up matrix terms
df_gaussian

Gaussian toy example
extend_family

Extend a family
extra-families

Extra family objects
do_call

Execute a function call