Learn R Programming

grpss (version 3.0.1)

importance: Arrange and visualize the importance of groups

Description

Arranges and visualizes the importance of groups for the results of grp.criValues.

Usage

importance(grp.values, n = 10, plot = TRUE)

Arguments

grp.values
The result from grp.criValues.
n
Number of important groups to display. The default is the top 10 groups.
plot
A logical value indicating whether to make a barplot of the importance of groups.

Value

A matrix containing the first n important group indices and values of screening criterion.

Details

This function arranges the values of screening criterion from the most important to the least important, and then make a barplot to visualize the importance.

See Also

grp.criValues

Examples

Run this code
library(MASS)
n <- 30 # sample size
p <- 3  # number of predictors in each group
J <- 50 # number of groups
group <- rep(1:J,each = 3)  # group indices
Sigma <- diag(p*J)  # covariance matrix
X <- mvrnorm(n,seq(0,5,length.out = p*J),Sigma)
beta <- runif(12,-2,5)  # coefficients
y <- X%*%matrix(c(beta,rep(0,p*J-12)),ncol = 1) + rnorm(n)

crivalues <- grp.criValues(X,y,group)  # gSIS
importance(crivalues, n = 20)

Run the code above in your browser using DataLab