aves: Method to simplify AVE

View source: R/analyse_sgcca.R

avesR Documentation

Method to simplify AVE

Description

This simplifies the AVE_X to make it easier to understand.

Usage

aves(x)

Arguments

x

rgcca or sgcca object

Details

It converts to a matrix where each row is a dimension and each column is a block.

Value

The same object with AVE_X simplified

Examples

data("Russett", package = "RGCCA")
X_agric <- as.matrix(Russett[, c("gini", "farm", "rent")])
X_ind <- as.matrix(Russett[, c("gnpr", "labo")])
X_polit <- as.matrix(Russett[ , c("inst", "ecks",  "death", "demostab",
                                  "dictator")])
A <- list(X_agric, X_ind, X_polit)
A <- lapply(A, function(x) scale2(x, bias = TRUE))
C <- matrix(c(0, 0, 1, 0, 0, 1, 1, 1, 0), 3, 3)
out <- RGCCA::rgcca(A, C, tau =rep(0, 3), scheme = "factorial",
                    scale = FALSE, verbose = FALSE, ncomp = rep(2, length(A)))
out$AVE
out <- aves(out)
out$AVE

llrs/inteRmodel documentation built on April 1, 2022, 4:04 p.m.