list2CubeOfCovDis function

compute a cube of covariance and a cube of distance between the items (rows) of a matrix of measurements comprising KK different blocks of possibly different number of variables.

compute a cube of covariance and a cube of distance between the items (rows) of a matrix of measurements comprising KK different blocks of possibly different number of variables.

list2CubeOfCovDis

compute a cube of covariance and a cube of (squared) Euclidean distance between the items (rows) a matrix of measurements comprising KK different blocks of possibly different number of variables. The variables describing the items can scaled to norm 1 and centered. The whole matrix for a block can be scaled by its first eigenvalue (a la DISTATIS). Blocks can have different number of variables and when all blocks have same number of variables list2CubeOfCovDis

is a more efficient alternative

list2CubeOfCovDis(Data, Judges, scale = TRUE, center = TRUE, ev.scale = TRUE)

Arguments

  • Data: a matrix of dimensions II items by JJ quantitative variables (structured in KK blocks of JkJ_k variables each). No Default.

  • Judges: a JJ components character vector identifiying the variables corresponding to each block of variables. No Default.

  • scale: (Default: TRUE), when TRUE

    scale to norm 1 each column for each slice.

  • center: (Default: TRUE), when TRUE

    centers each column.

  • ev.scale: (Default: TRUE), when TRUE

    normalizes each slice (i.e., each II items by JJ matrix) so that its first eigenvalue is equal to 1.

Returns

a list with 1) cubeOfCovariance

a cube of KK II by II covariance matrices; and 2) codecubeOfDistance

a cube of KK II by II

(squared) Euclidean distance matrices.

Details

The input of list2CubeOfCovDis is a II items by JJ quantitative variables that are organized in KK blocks (i.e., submatrices) each comprising JkJ_k variables (with sum Jk=JJ_k = J).

By default list2CubeOfCovDis

centers and normalizes each column for each block and then normalize each covariance matrix such that the first eigenvalue of each covariance matrix (for a given block) is equal to 1.

A distatis analysis of the Distance matrices with the option Distance = TRUE will give the same results as the distatis analysis of the Covariance matrices with the option Distance = FALSE.

Examples

path2file <- system.file("extdata", "BeersFlashProfile.xlsx", package = 'DistatisR') # read the data in the excel file with read.df.excel beerDataFlash <- read.df.excel(path = path2file, sheet = 'Rankings')$df.data # Extract the namers of the judges (first 2 characters) JudgesVars <- colnames(beerDataFlash) zeJudges <- substr(JudgesVars,1,2) # call list2CubeOfCovDis test.list2 <- list2CubeOfCovDis(Data = beerDataFlash , Judges = zeJudges)

See Also

list2CubeOfCov

Author(s)

Herve Abdi

  • Maintainer: Herve Abdi
  • License: GPL-2
  • Last published: 2022-12-05

Useful links