Description Usage Arguments Value References Examples
View source: R/main_functions.R
This package provides functions to perform variable selection with weighted lasso for both linear regression and the Cox proportional hazards regression. The weights are chosen to direct the variable selection procedure so that covariates that are highly associated with the response are likely to be selected and covariates that weakly associated with the response are less likely to be selected. Association between the response and the covariates is based on results from simpler linear/Cox regressions between the response and each covariate, and include, for example, q-values, partial correlation coefficients, and t-statistics of regression coefficients.
Performs variable selection with covariates multiplied by weights that direct which variables are likely to be associated with the response.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | d2wlasso(
x,
z,
y,
cox.delta = NULL,
factor.z = TRUE,
regression.type = c("linear", "cox")[1],
weight.type = c("one", "corr.estimate", "corr.pvalue", "corr.bh.pvalue", "corr.tstat",
"corr.qvalue", "parcor.estimate", "parcor.pvalue", "parcor.bh.pvalue", "parcor.tstat",
"parcor.qvalue", "exfrequency.random.partition.aic",
"exfrequency.random.partition.bic", "exfrequency.kmeans.partition.aic",
"exfrequency.kmeans.partition.bic", "exfrequency.kquartiles.partition.aic",
"exfrequency.kquartiles.partition.bic", "exfrequency.ksorted.partition.aic",
"exfrequency.ksorted.partition.bic")[1],
weight_fn = function(x) { x },
ttest.pvalue = TRUE,
q_opt_tuning_method = c("bootstrap", "smoother")[2],
qval.alpha = 0.15,
alpha.bh = 0.05,
robust = TRUE,
show.plots = FALSE,
pi0.known = FALSE,
pi0.val = 0.9,
penalty.choice = c("cv.mse", "cv.penalized.loss", "penalized.loss",
"deviance.criterion")[3],
est.MSE = c("est.var", "step")[1],
cv.folds = 10,
mult.cv.folds = 0,
penalized.loss.delta = 2,
nboot = 100,
k.split = 4,
step.direction = "backward"
)
|
x |
(n by m) matrix of main covariates where m is the number of covariates and n is the sample size. |
z |
(n by 1) matrix of additional fixed covariate affecting response variable. This covariate should always be selected. Can be NULL. |
y |
(n by 1) a matrix corresponding to the response variable. If |
cox.delta |
(n by 1) a matrix that denotes censoring when |
factor.z |
logical. If TRUE, the fixed variable z is a factor variable. |
regression.type |
a character indicator that is either "linear" for linear regression or "cox" for Cox proportional hazards regression. Default is "linear". |
weight.type |
Character value denoting which weights to be used for the weighted lasso, where each covariate in
|
weight_fn |
A user-defined function to be applied to the weights for the weighted lasso. Default is an identify function. |
ttest.pvalue |
logical indicator used when |
q_opt_tuning_method |
character indicator used when |
qval.alpha |
scalar value used when |
alpha.bh |
scalar value used when |
robust |
logical indicator used when |
show.plots |
logical indicator. When |
pi0.known |
logical indicator used when |
pi0.val |
scalar used when |
penalty.choice |
character that indicates the variable selection criterion. Options are "cv.mse" for
the K-fold cross-validated mean squared prediction error, "penalized.loss" for the penalized loss criterion which
requires specification of the penalization parameter |
est.MSE |
character that indicates how the mean squared error is estimated in the penalized loss
criterion when |
cv.folds |
scalar denoting the number of folds for cross-validation
when |
mult.cv.folds |
scalar denoting the number of times we repeat the cross-validation procedures
of |
penalized.loss.delta |
scalar to indicate the choice of the penalization parameter delta in the
penalized loss criterion when |
nboot |
scalar denoting the number of bootstrap samples obtained for exclusion frequency weights when
|
k.split |
scalar that indicates the number of partitions used to compute the exclusion frequency weights
when |
step.direction |
character that indicates the direction of stepwise regression used to compute the exclusion frequency weights
when |
weights: weights used in the weighted Lasso. Weights computed depend on weight.type
selected.
weighted.lasso.results: variable selection results from the LASSO when the covariates
are multiplied by weights as specified by weight.type
.
threshold.selection: variable selection results when weights are below a specified threshold.
Results are reported only when weight.type
are "corr.pvalue","corr.bh.pvalue",
"corr.qvalue","parcor.pvalue","parcor.bh.pvalue","parcor.qvalue".
Garcia, T.P. and M¨uller, S. (2016). Cox regression with exclusion frequency-based weights to identify neuroimaging markers relevant to Huntington’s disease onset. Annals of Applied Statistics, 10, 2130-2156.
Garcia, T.P. and M¨uller, S. (2014). Influence of measures of significance-based weights in the weighted Lasso. Journal of the Indian Society of Agricultural Statistics (Invited paper), 68, 131-144.
Garcia, T.P., Mueller, S., Carroll, R.J., Dunn, T.N., Thomas, A.P., Adams, S.H., Pillai, S.D., and Walzem, R.L. (2013). Structured variable selection with q-values. Biostatistics, DOI:10.1093/biostatistics/kxt012.
Efron, B., Hastie, T., Johnstone, I. AND Tibshirani, R. (2004). Least angle regression. Annals of Statistics 32, 407–499.
Garcia, T.P. and M¨uller, S. (2016). Cox regression with exclusion frequency-based weights to identify neuroimaging markers relevant to Huntington’s disease onset. Annals of Applied Statistics, 10, 2130-2156.
Garcia, T.P. and M¨uller, S. (2014). Influence of measures of significance-based weights in the weighted Lasso. Journal of the Indian Society of Agricultural Statistics (Invited paper), 68, 131-144.
Garcia, T.P., Mueller, S., Carroll, R.J., Dunn, T.N., Thomas, A.P., Adams, S.H., Pillai, S.D., and Walzem, R.L. (2013). Structured variable selection with q-values. Biostatistics, DOI:10.1093/biostatistics/kxt012.
Storey, J. D. and Tibshirani, R. (2003). Statistical significance for genomewide studies. Proceedings of the National Academy of Sciences 100, 9440-9445.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | x = matrix(rnorm(100*5, 0, 1),100,5)
z = matrix(rbinom(100, 1, 0.5),100,1)
y = matrix(z[,1] + 2*x[,1] - 2*x[,2] + rnorm(100, 0, 1), 100)
dwl0 = d2wlasso(x,z,y)
dwl1 = d2wlasso(x,z=NULL,y,weight.type="corr.pvalue")
dwl2 = d2wlasso(x,z,y,weight.type="parcor.qvalue")
dwl3 = d2wlasso(x,z,y,weight.type="parcor.bh.pvalue")
dwl4 = d2wlasso(x,z,y,weight.type="parcor.qvalue",mult.cv.folds=100)
dwl5 = d2wlasso(x,z,y,weight.type="exfrequency.random.partition.aic")
dwl6 = d2wlasso(x,z,y,weight.type="exfrequency.kmeans.partition.aic")
dwl7 = d2wlasso(x,z,y,weight.type="exfrequency.kquartiles.partition.aic")
dwl8 = d2wlasso(x,z,y,weight.type="exfrequency.ksorted.partition.aic")
## Cox model
x = matrix(rnorm(100*5, 0, 1),100,5)
z = matrix(rbinom(100, 1, 0.5),100,1)
y = matrix(exp(z[,1] + 2*x[,1] - 2*x[,2] + rnorm(100, 0, 2)), 100)
cox.delta = matrix(1,nrow=length(y),ncol=1)
dwl0.cox = d2wlasso(x,z,y,cox.delta,regression.type="cox",penalty.choice="cv.mse")
dwl1.cox = d2wlasso(x,z=NULL,y,cox.delta,
regression.type="cox",weight.type="corr.pvalue",penalty.choice="cv.mse")
dwl2.cox = d2wlasso(x,z,y,cox.delta,
regression.type="cox",weight.type="parcor.qvalue",penalty.choice="cv.mse")
dwl3.cox = d2wlasso(x,z,y,cox.delta,
regression.type="cox",weight.type="parcor.bh.pvalue",penalty.choice="cv.mse")
dwl4.cox = d2wlasso(x,z,y,cox.delta,
regression.type="cox",weight.type="parcor.qvalue",
mult.cv.folds=100,penalty.choice="cv.mse")
dwl5.cox = d2wlasso(x,z,y,cox.delta,regression.type="cox",
weight.type="exfrequency.random.partition.aic",penalty.choice="cv.mse")
dwl6.cox = d2wlasso(x,z,y,cox.delta,regression.type="cox",
weight.type="exfrequency.kmeans.partition.aic",penalty.choice="cv.mse")
dwl7.cox = d2wlasso(x,z,y,cox.delta,regression.type="cox",
weight.type="exfrequency.kquartiles.partition.aic",penalty.choice="cv.mse")
dwl8.cox = d2wlasso(x,z,y,cox.delta,regression.type="cox",
weight.type="exfrequency.ksorted.partition.aic",penalty.choice="cv.mse")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.