# 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