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).
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).
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.
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.
Returns
a list with 1) cubeOfCovariance
a cube of KI by I covariance matrices; and 2) codecubeOfDistance
a cube of KI by I
(squared) Euclidean distance matrices.
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.
Examples
# use the data from the BeersProjectiveMapping datasetdata("BeersProjectiveMapping")# Create the I*J_k*K brick of datazeBrickOfData <- projMap2Cube( BeersProjectiveMapping$ProjectiveMapping, shape ='flat', nVars =2)# Create the cubes of Covariance and Distance cubes <- createCubeOfCovDis(zeBrickOfData$cubeOfData)