Fits a multiple correspondence analysis (MCA). The default is to take each input variable as nominal. Through restrictions on the transformations (ordinal in conjunction with splines) various generalizations of MCA can be achieved.
homals(data, ndim = 2, levels = "nominal", ordinal, knots, ties = "s",
degrees = -1, missing = "s", normobj.z = TRUE, active = TRUE, itmax = 1000,
eps = 1e-6, verbose = FALSE)
Optimally transformed scores
Induced correlation matrix
Eigenvalues of induced correlation matrix
Object scores (rows)
Optimally scaled data matrix (first dimension)
Category quantifications
Discimination matrices
Average discrimination matrix
Component weights
Component loadings
Number of iterations
Loss function value
Original data frame
Numerical data frame
Number of extracted dimensions
Function call
Input data frame: n observations, m variables
Number of dimensions to be computed
A vector of length m denoting basic scale levels ("nominal"
, "ordinal"
, "metric"
; see details
If knots are specified manually, a boolean vector of length m denotes which variables should be ordinally restricted or not (see details)
Scale levels can be specified manually using splines (see knotsGifi
). If knots is set, this overrides level
(see details)
How ties should be handled: primary ("p"
), secondary ("s"
), or tertiary ("t"
)
Spline degrees. If different degrees should be used across variables, a vector of length m can be specified. The default value of -1 indicates nominal scale level (overrides the ordinal argument).
How missing values should be handled: multiple ("m"
), single ("s"
), or average ("a"
)
Which variables should be active or inactive (also as vector of length m)
If TRUE
, object scores are z-scores, if FALSE
, they are restricted to SS of 1.
Maximum number of iterations
Convergence criterion
Iteration printout
The measurement (or scale) levels of the variables are incorporated via spline transformations. If the user only needs simple scale levels like nominal, ordinal, and metric, a corresponding vector can be specified in the levels
argument without setting knots
and ordinal
. The corresponding spline transformations (unrestricted, monotone, and linear) are then created internally. If all scale level transformations are the same, ordinal
can be a single value. For more advanced transformations such as polynomial or more flexible splines, the knots
and ordinal
arguments need to be specified instead of levels
.
Gifi, A. (1990). Nonlinear Multivariate Analysis. New York: Wiley.
De Leeuw, J., Mair, P., Groenen, P. J. F. (2017). Multivariate Analysis with Optimal Scaling.
princals
, plot.homals
## multiple CA
fithart <- homals(hartigan)
fithart
summary(fithart)
Run the code above in your browser using DataLab