projMap2Cube function

\ reshape a data matrix from projective mapping into a brick of data for a distatis analysis.

\ reshape a data matrix from projective mapping into a brick of data for a distatis analysis.

projMap2Cube

reshapes a data matrix from projective mapping into a brick of data for a distatis analysis. With II products, JJ variables, and KK blocks (assessors), the original data can be 1) "flat" (e.g., II rows as products, columns as KK blocks of JJ Variables) or 2) "long" "flat" (e.g., KK blocks of II rows as products by assessors, columns as JJ Variables).

projMap2Cube(Data, shape = "flat", nVars = 2, nBlocks = NULL)

Arguments

  • Data: a data matrix that can be II rows by JKJ*K columns (when "flat") or IKI*K rows by JJ columns when "long".
  • shape: (Default: flat when "flat" the data matrix has dimensions II rows by JKJ*K columns; when "long" the data matrix has dimensions IKI*K rows by JJ columns.
  • nVars: Number of variables (default = 2), relevant only when shape = "flat".
  • nBlocks: (Default = NULL) number of Blocks (i.e., KK) of II products. Relevant only when shape = "long".

Returns

An II by JJ by KK array (i.e., a brick) to be used to create a cube of distance or covariance.

Details

the output projMap2Cube (i.e., the brick of data) is used as input to the function cubeOfCov that will create the cubeOfDistance (or covariance) that will be used as input of distatis. projMap2Cube guesses the names of the products and variables from the rownames and columns of the data, but this guess needs to be verified.

Examples

# Use the data from the BeersProjectiveMapping dataset data("BeersProjectiveMapping") # Create the I*J_k*K brick of data dataBrick <- projMap2Cube(BeersProjectiveMapping$ProjectiveMapping, shape = 'flat', nVars = 2)

Author(s)

Herve Abdi

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

Useful links