View source: R/rgcca_bootstrap.R
rgcca_bootstrap | R Documentation |
Bootstrap confidence intervals and p-values for evaluating the significance/ stability of the block-weight vectors produce by S/RGCCA.
rgcca_bootstrap( rgcca_res, n_boot = 100, n_cores = 1, balanced = TRUE, keep_all_variables = FALSE, verbose = TRUE )
rgcca_res |
A fitted RGCCA object (see |
n_boot |
Number of bootstrap samples. Default: 100. |
n_cores |
Number of cores for parallelization. |
balanced |
A boolean indicating if a balanced bootstrap procedure is performed or not (default is TRUE). |
keep_all_variables |
A boolean indicating if all variables have to be kept even when some of them have null variance for at least one bootstrap sample (default is FALSE). |
verbose |
Logical value indicating if the progress of the bootstrap procedure is reported. |
A list containing two objects: 'bootstrap' and 'rgcca'.
'bootstrap' is a list containing for each block, a matrix
with the variables of the block in row and the block weight vector
calculated across bootstrap sample in column. 'rgcca' is the fitted rgcca
object obtained from the original data. (see rgcca
)
plot.bootstrap
,
print.bootstrap
# Bootstrap confidence intervals and p-values for RGCCA data("Russett") blocks <- list( agriculture = Russett[, seq(3)], industry = Russett[, 4:5], politic = Russett[, 6:11] ) fit.rgcca <- rgcca(blocks, ncomp = c(2, 1, 2)) boot.out <- rgcca_bootstrap(fit.rgcca, n_boot = 20, n_cores = 2) plot(boot.out, type = "weight", block = 3, comp = 1) print(boot.out, comp = 2, block = 1) fit.rgcca <- rgcca(blocks, method = "mcoa") boot.out <- rgcca_bootstrap(fit.rgcca, n_boot = 50, n_cores = 2) plot(boot.out, type = "weight", block = 1) ## Not run: # Stability of the selected variables for SGCCA # Download the dataset's package at http://biodev.cea.fr/sgcca/ and install # it from the package archive file. # You can do it with the following R commands: if (!("gliomaData" %in% rownames(installed.packages()))) { destfile <- tempfile() download.file("http://biodev.cea.fr/sgcca/gliomaData_0.4.tar.gz", destfile) install.packages(destfile, repos = NULL, type = "source") } data("ge_cgh_locIGR", package = "gliomaData") A <- ge_cgh_locIGR$multiblocks A[[3]] <- A[[3]][, -3] Loc <- factor(ge_cgh_locIGR$y) levels(Loc) <- colnames(ge_cgh_locIGR$multiblocks$y) C <- matrix(c(0, 0, 1, 0, 0, 1, 1, 1, 0), 3, 3) # rgcca algorithm using the dual formulation for X1 and X2 # and the dual formulation for X3 fit.rgcca <- rgcca(A, connection = C, tau = c(1, 1, 0), ncomp = c(2, 2, 1), scheme = "factorial", verbose = TRUE ) boot.out <- rgcca_bootstrap(fit.rgcca, n_boot = 50, n_cores = 2) plot(boot.out, block = 1, type = "weight", ncomp = 1, n_marks = 30) plot(boot.out, block = 1, type = "weight", ncomp = 2, n_marks = 30) # stability analysis prior bootstrap for sgcca ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.