Summary of a fitted object from the RGCCA package
Source:R/summary.rgcca.R
, R/summary.rgcca_cv.r
, R/summary.rgcca_permutation.R
, and 2 more
summary.Rd
`summary.rgcca()` summarizes a fitted RGCCA object. Some information about the model are displayed like model parameters or criterion.
`summary.rgcca_cv()` summarizes a fitted rgcca_cv object. Parameters of the analysis, tuning parameters and statistics for each set of parameters are displayed.
`summary.rgcca_permutation()` summarizes a fitted rgcca_permutation object. Parameters of the analysis, tuning parameters and statistics for each set of parameters are displayed.
`summary.rgcca_bootstrap()` summarizes a fitted rgcca_bootstrap object. Parameters of the analysis and bootstrap statistics are displayed.
`summary.rgcca_stability()` calls `summary.rgcca()` on the fitted RGCCA model returned by `rgcca_stability()`.
Usage
# S3 method for class 'rgcca'
summary(object, ...)
# S3 method for class 'rgcca_cv'
summary(object, type = c("sd", "quantile"), ...)
# S3 method for class 'rgcca_permutation'
summary(object, ...)
# S3 method for class 'rgcca_bootstrap'
summary(
object,
block = seq_along(object$rgcca$call$blocks),
comp = 1,
type = c("weights", "loadings"),
empirical = TRUE,
display_order = FALSE,
adj.method = "fdr",
...
)
# S3 method for class 'rgcca_stability'
summary(object, ...)
Arguments
- object
An object to be summarized (output of functions
rgcca
,rgcca_cv
,rgcca_permutation
,rgcca_bootstrap
, orrgcca_stability
).- ...
Further arguments passed to other methods (for the displaying of matrices).
- type
A character string indicating the type of the summarized object (see details).
- block
A numeric corresponding to the block(s) to summarize.
- comp
A numeric vector indicating the component(s) to consider.
- empirical
A logical value indicating if the bootstrap confidence intervals and p-values are derived from the empirical distribution. (default: TRUE)
- display_order
A logical value for ordering the variables. If TRUE, variables are ordered from highest to lowest absolute value. If FALSE, the block order is used. Default is TRUE.
- adj.method
A string indicating the method used to adjust the p-values. It must be a method handled by the p.adjust function. Default is "fdr".
Details
Argument type can take two values in `summary.cval`:
"sd" (default): mean values of the cross-validated scores are reported, as well as means plus or minus standard deviations.
"quantiles": median values, 25% and 75% quantiles of the cross-validated scores are reported.
Argument type can take two values in `summary.bootstrap`:
"weights" (default): statistics about the block-weight vectors are reported.
"loadings": statistics about the block-loading vectors are reported.
Examples
## Summary of an rgcca object
data(Russett)
blocks <- list(
agriculture = Russett[, seq(3)],
industry = Russett[, 4:5],
politic = Russett[, 6:8]
)
C <- matrix(c(0, 0, 1, 0, 0, 1, 1, 1, 0), 3, 3)
res <- rgcca(blocks,
connection = C, ncomp = rep(2, 3), tau = c(1, 1, 1),
scheme = "factorial", scale = TRUE, verbose = FALSE
)
summary(res)
#> Call: method='rgcca', superblock=FALSE, scale=TRUE, scale_block='inertia',
#> init='svd', bias=TRUE, tol=1e-08, NA_method='na.ignore', ncomp=c(2,2,2),
#> response=NULL, comp_orth=TRUE
#> There are J = 3 blocks.
#> The design matrix is:
#> agriculture industry politic
#> agriculture 0 0 1
#> industry 0 0 1
#> politic 1 1 0
#>
#> The factorial scheme is used.
#> Sum_{j,k} c_jk g(cov(X_j a_j, X_k a_k) = 0.5346
#>
#> The regularization parameter used for agriculture is: 1
#> The regularization parameter used for industry is: 1
#> The regularization parameter used for politic is: 1
#>
## Summary of an rgcca_cv object
res <- rgcca_cv(blocks,
response = 3, method = "rgcca", par_type = "tau",
par_value = c(0, 0.2, 0.3), n_run = 1, n_cores = 1,
verbose = TRUE
)
summary(res)
#> Call: method='rgcca', superblock=FALSE, scale=TRUE, scale_block=TRUE, init='svd',
#> bias=TRUE, tol=1e-08, NA_method='na.ignore', ncomp=c(1,1,1), response=3,
#> comp_orth=TRUE
#> There are J = 3 blocks.
#> The design matrix is:
#> agriculture industry politic
#> agriculture 0 0 1
#> industry 0 0 1
#> politic 1 1 0
#>
#> The factorial scheme is used.
#>
#> Tuning parameters (tau) used:
#> agriculture industry politic
#> 1 0 0.200 0.300
#> 2 0 0.178 0.267
#> 3 0 0.156 0.233
#> 4 0 0.133 0.200
#> 5 0 0.111 0.167
#> 6 0 0.089 0.133
#> 7 0 0.067 0.100
#> 8 0 0.044 0.067
#> 9 0 0.022 0.033
#> 10 0 0.000 0.000
#>
#> Validation: kfold with 5 folds and 1 run(s))
#> Prediction model: lm
#>
#> Tuning parameters Mean RMSE Sd
#> 1 Set 1 1.10 0.216
#> 2 Set 2 1.11 0.215
#> 3 Set 3 1.11 0.214
#> 4 Set 4 1.11 0.212
#> 5 Set 5 1.11 0.210
#> 6 Set 6 1.11 0.208
#> 7 Set 7 1.11 0.206
#> 8 Set 8 1.12 0.203
#> 9 Set 9 1.12 0.199
#> 10 Set 10 1.12 0.197
#>
#> The best combination is: Set 1 for a mean RMSE of 1.1
## Summary of an rgcca_permutation object
perm.out <- rgcca_permutation(blocks,
par_type = "tau",
n_perms = 5, n_cores = 1,
verbose = TRUE
)
summary(perm.out)
#> Call: method='rgcca', superblock=FALSE, scale=TRUE, scale_block=TRUE, init='svd',
#> bias=TRUE, tol=1e-08, NA_method='na.ignore', ncomp=c(1,1,1), response=NULL,
#> comp_orth=TRUE
#> There are J = 3 blocks.
#> The design matrix is:
#> agriculture industry politic
#> agriculture 0 1 1
#> industry 1 0 1
#> politic 1 1 0
#>
#> The factorial scheme is used.
#>
#> Tuning parameters (tau) used:
#> agriculture industry politic
#> 1 1.000 1.000 1.000
#> 2 0.889 0.889 0.889
#> 3 0.778 0.778 0.778
#> 4 0.667 0.667 0.667
#> 5 0.556 0.556 0.556
#> 6 0.444 0.444 0.444
#> 7 0.333 0.333 0.333
#> 8 0.222 0.222 0.222
#> 9 0.111 0.111 0.111
#> 10 0.000 0.000 0.000
#>
#> Tuning parameters Criterion Permuted criterion sd zstat p-value
#> 1 1.00/1.00/1.00 0.644 0.0948 0.0651 8.43 0
#> 2 0.89/0.89/0.89 0.685 0.1021 0.0693 8.41 0
#> 3 0.78/0.78/0.78 0.731 0.1108 0.0740 8.39 0
#> 4 0.67/0.67/0.67 0.783 0.1211 0.0792 8.36 0
#> 5 0.56/0.56/0.56 0.842 0.1336 0.0851 8.33 0
#> 6 0.44/0.44/0.44 0.910 0.1495 0.0916 8.31 0
#> 7 0.33/0.33/0.33 0.990 0.1705 0.0986 8.31 0
#> 8 0.22/0.22/0.22 1.085 0.2006 0.1055 8.38 0
#> 9 0.11/0.11/0.11 1.204 0.2510 0.1081 8.82 0
#> 10 0.00/0.00/0.00 1.429 0.4167 0.0919 11.01 0
#> The best combination is: 0.00/0.00/0.00 for a z score of 11 and a p-value of 0
## Summary of an rgcca_bootstrap object
fit.rgcca <- rgcca(blocks, ncomp = c(2, 1, 2))
boot.out <- rgcca_bootstrap(fit.rgcca, n_boot = 20, n_cores = 2,
verbose = TRUE)
#> Bootstrap samples sanity check...
#> OK
summary(boot.out)
#> Call: method='rgcca', superblock=FALSE, scale=TRUE, scale_block='inertia',
#> init='svd', bias=TRUE, tol=1e-08, NA_method='na.ignore', ncomp=c(2,1,2),
#> response=NULL, comp_orth=TRUE
#> There are J = 3 blocks.
#> The design matrix is:
#> agriculture industry politic
#> agriculture 0 1 1
#> industry 1 0 1
#> politic 1 1 0
#>
#> The factorial scheme is used.
#>
#> Extracted statistics from 20 bootstrap samples.
#> Block-weight vectors for component 1:
#> estimate mean sd lower_bound upper_bound bootstrap_ratio pval
#> gini 0.661 0.6424 0.0537 0.54401 0.717 12.300 0.0000
#> farm 0.742 0.7280 0.0402 0.64648 0.790 18.444 0.0000
#> rent 0.117 0.0892 0.2180 -0.33455 0.387 0.538 0.5385
#> gnpr 0.732 0.7266 0.0497 0.65407 0.821 14.715 0.0000
#> labo -0.682 -0.6832 0.0555 -0.75615 -0.569 -12.288 0.0000
#> inst 0.249 0.2524 0.1372 0.00582 0.445 1.816 0.0526
#> ecks 0.661 0.6462 0.0776 0.45913 0.745 8.520 0.0000
#> death 0.708 0.7000 0.0737 0.60750 0.859 9.605 0.0000
#> adjust.pval
#> gini 0.0000
#> farm 0.0000
#> rent 0.5799
#> gnpr 0.0000
#> labo 0.0000
#> inst 0.0819
#> ecks 0.0000
#> death 0.0000
#>
## Summary of an rgcca_stability object
fit.sgcca <- rgcca(blocks, sparsity = c(.8, .9, .6))
res <- rgcca_stability(fit.sgcca, n_boot = 10, verbose = TRUE)
#> Bootstrap samples sanity check...
#> OK
summary(res)
#> Fitted SGCCA model.
#> The algorithm converged to a stationnary point after 2 iterations.
#>