View source: R/list2CubeOfCov.R
list2CubeOfCovDis | R Documentation |
list2CubeOfCovDis
compute a cube of covariance and a cube of
(squared) Euclidean distance
between the items (rows) a matrix of measurements
comprising K 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)
Data |
a matrix of dimensions I items by J quantitative variables (structured in K blocks of J_k variables each). No Default. |
Judges |
a J components character vector identifiying the variables corresponding to each block of variables. No Default. |
scale |
(Default: |
center |
(Default: |
ev.scale |
(Default: |
The input of list2CubeOfCovDis
is a
I items by J quantitative variables
that are organized in K blocks (i.e., submatrices)
each comprising J_k variables (with sum J_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
.
a list with 1) cubeOfCovariance
a cube of K I by I covariance matrices;
and 2) codecubeOfDistance
a cube of K I by I
(squared) Euclidean distance
matrices.
Herve Abdi
list2CubeOfCov
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.