View source: R/41_refined_anchored_lasso.R
mean_comparison_anchor | R Documentation |
Performs a cross-validated, projection-based mean comparison between two high-dimensional groups using sparse or dense PCA and (group) Lasso classifiers.
mean_comparison_anchor(
control,
treatment,
pca_method = c("dense_pca", "sparse_pca"),
classifier_method = c("lasso", "group_lasso"),
lambda_type = "lambda.1se",
n_folds = 10,
group = NULL,
standardize_feature = TRUE,
verbose = TRUE
)
control |
A matrix or data frame for the control group. Rows are samples; columns are features. |
treatment |
A matrix or data frame for the treatment group. Rows are samples; columns are features. |
pca_method |
Character. Method for estimating the projection direction. Options are |
classifier_method |
Character. Classifier to guide the projection. Options are |
lambda_type |
Character. Regularization parameter choice in Lasso. Options are |
n_folds |
Integer. Number of cross-validation folds. Default is 10. |
group |
Optional. A grouping vector (required for |
standardize_feature |
Logical. Whether to standardize features using pooled mean and standard deviation. Default is TRUE. |
verbose |
Logical. Whether to print messages during execution. Default is TRUE. |
This function applies a projection-based method for high-dimensional mean testing. The projection direction is computed by anchoring the leading principal component with a regularized classifier (Lasso or group Lasso), and test statistics are aggregated across folds.
A list with:
Two-sided p-value for the overall test.
Standardized test statistic.
Per-fold results, including projections and scores.
process_fold_mean_diff
, combine_folds_mean_diff
, estimate_leading_pc
, fit_lasso
## Not run:
X <- matrix(rnorm(200 * 100), nrow = 100)
Y <- matrix(rnorm(200 * 100), nrow = 100)
result <- mean_comparison_anchor(X, Y, pca_method = "dense_pca", classifier_method = "lasso")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.