createCubeOfCovDis: compute a cube of covariance and a cube of distance between...

View source: R/createCubeOfCovDis.R

createCubeOfCovDisR Documentation

compute a cube of covariance and a cube of distance between the items (rows) of a brick of measurements (when all blocks have the same number of variables).

Description

createCubeOfCovDis compute a cube of covariance and a cube of (squared) Euclidean distance between the items (rows) of a brick of measurements. The variables describing the items can scaled to norm 1 and centered. The whole matrix can be scaled by its first eigenvalue (a la DISTATIS). All "slices" of the brick should have the same number of variables. For different number of variables per block, see list2CubeOfCov.

Usage

createCubeOfCovDis(brickOfData, scale = TRUE, center = TRUE, ev.scale = TRUE)

Arguments

brickOfData

a I items by J quantitative variables by K assessors.

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 I items by J matrix) so that its first eigenvalue is equal to 1.

Details

The input of createCubeOfCovDis is a I items by J quantitative variables by K assessors (as obtained, e.g., from a projective mapping task).

By default createCubeOfCovDis centers and normalizes each column for each slice of the brick and then normalize each covariance matrix such that the first eigenvalue of each covariance matrix 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.

Value

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.

Author(s)

Herve Abdi

See Also

list2CubeOfCov

Examples


# use the data from the BeersProjectiveMapping dataset
data("BeersProjectiveMapping") 
# Create the I*J_k*K brick of data
zeBrickOfData <- projMap2Cube(
                     BeersProjectiveMapping$ProjectiveMapping, 
                     shape = 'flat',  nVars = 2)
# Create the cubes of Covariance and Distance                     
cubes <- createCubeOfCovDis(zeBrickOfData$cubeOfData)


DistatisR documentation built on Dec. 5, 2022, 9:05 a.m.