Learn R Programming

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

projpred

The projpred R package performs the projection predictive variable selection for generalized linear models as well as generalized linear and additive multilevel models. 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

1,863

Version

2.1.2

License

GPL-3 | file LICENSE

Maintainer

Frank Weber

Last Published

May 13th, 2022

Functions in projpred (2.1.2)

extend_family

Extend a family
extra-families

Extra family objects
as.matrix.projection

Extract projected parameter draws
df_binom

Binomial toy example
break_up_matrix_term

Break up matrix terms
cv-indices

Create cross-validation folds
do_call

Execute a function call
mesquite

Mesquite data set
cv_varsel

Variable selection with cross-validation
df_gaussian

Gaussian toy example
refmodel-init-get

Reference model structure
solution_terms

Retrieve predictor solution path or predictor combination
reexports

Objects exported from other packages
projpred-package

Projection predictive feature selection
varsel

Variable selection (without cross-validation)
print.vsel

Print results (summary) of variable selection
predict.refmodel

Predictions or log predictive densities from a reference model
print.vselsummary

Print summary of variable selection
suggest_size

Suggest submodel size
project

Projection onto submodel(s)
summary.vsel

Summary statistics of a variable selection
pred-projection

Predictions from a submodel (after projection)
plot.vsel

Plot summary statistics of a variable selection