Learn R Programming

projpred

The R package projpred performs the projection predictive variable selection for various regression models. Usually, the reference model will be an rstanarm or brms fit, but custom reference models can also be used. Details on supported model types are given in section “Supported types of models” of the main vignette[^1].

For details on how to cite projpred, see the projpred citation info on CRAN[^2]. Further references (including earlier work that projpred is based on) are given in section “Introduction” of the main vignette.

The vignettes[^3] 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[^4].

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.

[^1]: The main vignette can be accessed offline by typing vignette(topic = "projpred", package = "projpred") or—more conveniently—browseVignettes("projpred") within R.

[^2]: The citation information can be accessed offline by typing print(citation("projpred"), bibtex = TRUE) within R.

[^3]: The overview of all vignettes can be accessed offline by typing browseVignettes("projpred") within R.

[^4]: The documentation can be accessed offline using ? or help() within R.

Copy Link

Version

Install

install.packages('projpred')

Monthly Downloads

2,047

Version

2.8.0

License

GPL-3 | file LICENSE

Maintainer

Last Published

December 15th, 2023

Functions in projpred (2.8.0)

extra-families

Extra family objects
df_binom

Binomial toy example
plot.cv_proportions

Plot ranking proportions from fold-wise predictor rankings
plot.vsel

Plot predictive performance
do_call

Execute a function call
df_gaussian

Gaussian toy example
mesquite

Mesquite data set
extend_family

Extend a family
performances

Predictive performance results
force_search_terms

Force search terms
print.vselsummary

Print summary of a varsel() or cv_varsel() run
predict.refmodel

Predictions or log posterior predictive densities from a reference model
projpred-package

Projection predictive feature selection
ranking

Predictor ranking(s)
print.refmodel

Print information about a reference model object
project

Projection onto submodel(s)
pred-projection

Predictions from a submodel (after projection)
print.vsel

Print results (summary) of a varsel() or cv_varsel() run
print.projection

Print information about project() output
predictor_terms

Predictor terms used in a project() run
y_wobs_offs

Extract response values, observation weights, and offsets
summary.vsel

Summary of a varsel() or cv_varsel() run
solution_terms

Retrieve the full-data solution path from a varsel() or cv_varsel() run or the predictor combination from a project() run
suggest_size

Suggest submodel size
varsel

Run search and performance evaluation without cross-validation
refmodel-init-get

Reference model and more general information
run_cvfun

Create cvfits from cvfun
augdat_link_binom

Link function for augmented-data projection with binomial family
cl_agg

Weighted averaging within clusters of parameter draws
augdat_ilink_binom

Inverse-link function for augmented-data projection with binomial family
as_draws_matrix.projection

Extract projected parameter draws and coerce to draws_matrix (see package posterior)
cv_proportions

Ranking proportions from fold-wise predictor rankings
augdat-internals

Augmented-data projection: Internals
cv-indices

Create cross-validation folds
break_up_matrix_term

Break up matrix terms
as.matrix.projection

Extract projected parameter draws and coerce to matrix
cv_varsel

Run search and performance evaluation with cross-validation