Learn R Programming

plsRglm (version 1.7.1)

weighted_significance: Compute cross-validation weighted significance scores

Description

This function combines the empirical distribution of selected component counts with a matrix of bootstrap significance indicators. Rows in matind are matched to component counts using names such as "YT1", "YT2", and so on.

Usage

weighted_significance(cv_counts, matind)

Value

Named numeric vector containing weighted significance scores for each predictor. When no row of matind matches cv_counts, the function returns a named vector of NA_real_ values.

Arguments

cv_counts

named vector or table of cross-validation component counts.

matind

matrix-like object whose rows are named by model/component labels and whose columns are predictors. Values are typically logical significance indicators returned by confints2signifind and combined with rbind.

See Also

confints2signifind, cvtable, and signpred.

Examples

Run this code

cv_counts <- c("1" = 87, "2" = 13)
matind <- rbind(
  YT1 = c(X1 = TRUE, X2 = TRUE),
  YT2 = c(X1 = TRUE, X2 = FALSE)
)
weighted_significance(cv_counts, matind)

Run the code above in your browser using DataLab