Skip to contents

This simplifies the AVE_X to make it easier to understand.

Usage

aves(x)

Arguments

x

rgcca or sgcca object

Value

The same object with AVE_X simplified

Details

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

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
#> $AVE_X
#> $AVE_X[[1]]
#>     comp1     comp2 
#> 0.2696404 0.5907840 
#> 
#> $AVE_X[[2]]
#>     comp1     comp2 
#> 0.8956496 0.1043504 
#> 
#> $AVE_X[[3]]
#>     comp1     comp2 
#> 0.4387091 0.1647263 
#> 
#> 
#> $AVE_outer_model
#> [1] 0.4793766 0.2804684
#> 
#> $AVE_inner_model
#> [1] 0.4834515 0.1338607
#> 
out <- aves(out)
out$AVE
#> $AVE_X
#>            [,1]      [,2]      [,3]
#> comp1 0.2696404 0.8956496 0.4387091
#> comp2 0.5907840 0.1043504 0.1647263
#> 
#> $AVE_outer_model
#> [1] 0.4793766 0.2804684
#> 
#> $AVE_inner_model
#> [1] 0.4834515 0.1338607
#>