CA3variants: Correspondence Analysis variants for three-way contingency...

View source: R/CA3variants.R

CA3variantsR Documentation

Correspondence Analysis variants for three-way contingency tables

Description

This function performs four variants of three-way correspondence analysis (CA). It does the three-way symmetrical CA, when ca3type = "CA3", and three-way non-symmetrical CA, when ca3type = "NSCA3", by using the Tucker3 decomposition. It also performs ordered three-way symmetrical CA, when ca3type = "OCA3", and ordered three-way non-symmetrical CA, when ca3type = "ONSCA3", by using the Trivariate Moment Decomposition. The non-symmetrical variants consider the three variables asymmetrically related, such that one of the variables is the response to be predicted given the other two variables. It calculates the coordinates and inertia values of the chosen analyses. Furthermore, it allows to look at the index (Pearson's chi-squared or Marcotorchino's tau) partition.

Usage

CA3variants(Xdata, dims = c(p, q, r), ca3type = "CA3", test = 10^-6, 
resp = "row", norder = 3, sign = TRUE)

Arguments

Xdata

The three-way data. It can be a R object array or raw data (n individuals by three categorical variables, for an example, see museum data). When a three-way non-symmetrical variant is performed, by default, the response variable is the row variable when an array is given, or the first of three columns when a raw data set is given. For changing, consider the parameter resp = "col" or resp = "tube".

dims

The number of components for the first, second and third mode. By default, no dims is given. When using an ordered variant of three-way CA recall to consider the complete dimension, i.e. the number of components for the first, second and third mode must be equal to the number of rows, columns and tubes, respectively.

ca3type

The specification of the analysis to be performed. If ca3type = "CA3", then a three-way symmetrical correspondence analysis will be performed (default analysis). If ca3type = "NSCA3", then three-way non-symmetrical correspondence analysis will be performed. If ca3type = "OCA3", then ordered three-way symmetrical correspondence analysis will be performed. If ca3type = "ONSCA3", then ordered three-way non-symmetrical correspondence analysis will be performed.

test

Threshold used in the algorithm for stopping it after the convergence of the solutions.

resp

The input parameter for specifying in non-symmetrical three-way correspondence analysis variants (ca3type = "NSCA3" and ca3type = "ONSCA3") what is the response variable (logically antecendent to the others). By default, resp = "row", but it could be resp = "col" or resp = "tube".

norder

The input parameter for specifying the number of ordered variable when ca3type = "OCA3" or ca3type = "ONSCA3". By default, all three variables are ordered norder = 3. When norder = 1, you assume that the ordered variable is the column variable. When norder = 2, you assume that the ordered variables are the row and column variable.

sign

The input parameter for changing the sign to the components according to the core sign.

Details

This function recall internally many other functions, depending on the setting of the input parameters. After performing three-way symmetric or non-symmetric correspondence analysis, it recall two functions for printing and plotting the results. These two important functions are print.CA3variants and plot.CA3variants.

Value

The value of output returned depends on the kind of analysis performed. For a detailed description of the output one can see:
the output value of ca3basic if the input parameter is ca3type="CA3"; the output value of nsca3basic if the input parameter is ca3type="NSCA3"; the output value of oca3basic if the input parameter is ca3type="OCA3" the output value of onsca3basic if the input parameter is ca3type="ONSCA3"

Author(s)

Rosaria Lombardo, Eric J Beh and Michel van de Velden.

References

Beh EJ and Lombardo R (2014) Correspondence Analysis, Theory, Practice and New Strategies. John Wiley & Sons.
Kroonenberg PM (1994) The TUCKALS line: a suite of programs for three-way data analysis. Computational Statistics and Data Analysis, 18, 73–96.
Lombardo R, Beh EJ and Kroonenberg PM (2021) Symmetrical and Non-Symmetrical Variants of Three-Way Correspondence Analysis for Ordered Variables. Statistical Science, 36 (4), 542-561.

Examples



data(ratrank)
CA3variants(Xdata = ratrank, dims = c(p=2,q=2,r=1), ca3type = "CA3") 
data(happy)
CA3variants(Xdata = happy, dims = c(p=2,q=2,r=2), ca3type = "NSCA3") 
CA3variants(Xdata = happy, dims = c(p=3,q=5,r=4), ca3type = "OCA3") 
CA3variants(Xdata = happy, dims = c(p=3,q=5,r=4), ca3type = "ONSCA3") 

CA3variants documentation built on Oct. 10, 2022, 5:07 p.m.