Learn R Programming

care (version 1.0.0)

carscore: Estimate CAR Scores and Marginal Correlations

Description

carscore estimates the CAR score vector, either using the standard empirical estimator of the correlation matrix, or a shrinkage estimator.

Usage

carscore(x, y, estimator=c("empirical", "shrinkage"), diagonal=FALSE, verbose=TRUE)

Arguments

x
matrix of predictors (columns correspond to variables).
y
univariate response variable.
estimator
either "empirical" (the default) or "shrinkage".
diagonal
for diagonal=FALSE (the default) CAR scores are computed; otherwise with diagonal=TRUE marginal correlations.
verbose
if verbose=TRUE then the shrinkage intensity used in estimating the shrinkage correlation matrix is reported.

Value

  • carscore returns a vector containing the CAR scores (or marginal correlations).

Details

The CAR scores are the correlations between the response and the Mahalanobis-decorrelated predictors. In Zuber and Strimmer (2010) it is argued that squared CAR scores are a natural measure for variable importance --- see http://arxiv.org/abs/1007.5516 for details.

References

Zuber, V., and K. Strimmer. 2010. Variable importance and model selection by decorrelation. http://arxiv.org/abs/1007.5516.

See Also

care.

Examples

Run this code
# load care library
library("care")

######

# empirical CAR scores for diabetes data
data(efron2004)
car = carscore(efron2004$x, efron2004$y)
car

# R^2
sum(car^2)

# variables in order of squared CAR scores
xnames = colnames(efron2004$x)
xnames[order(car^2, decreasing=TRUE)]

# compare with standard ordering given by t-scores / partial correlations 
fit = fitlm(efron2004$x, efron2004$y)
xnames[order(fit$pcor^2, decreasing=TRUE)]

######

# shrinkage CAR scores for Lu et al. (2004) data
data(lu2004)
dim(lu2004$x)    # 30 403

# compute shrinkage car score
car = carscore(lu2004$x, lu2004$y, estimator="shrinkage")

# R^2
sum(car^2) 

# most important genes
order(car^2, decreasing=TRUE)[1:10]

# compare with empirical marginal correlations
marg = carscore(lu2004$x, lu2004$y, diagonal=TRUE)
order(abs(marg), decreasing=TRUE)[1:10]

Run the code above in your browser using DataLab