PCAOS | R Documentation |
Perform PCAOS
PCAOS( data, level.scale = rep("num", ncol(data)), nb.comp = 2, maxiter = 100, threshold = 1e-06, D = 1, supp.var = NULL, print = TRUE, init = "rdm" )
data |
a data frame with n rows (individuals) and p columns (numeric, nominal and/or ordinal variables) |
level.scale |
vector(length p) giving the nature of each variable. Possible values: "nom", "ord", "num". The order of categories for an ordinal variable is indicated by it's level. |
nb.comp |
number of components of the model (by default 2) |
maxiter |
maximum number of iterations |
threshold |
threshold for assessing convergence |
D |
degree of the relation between quantified variables and components (only for numeric variables, default = 1) |
supp.var |
a vector indicating the indexes of the supplementary variables |
print |
boolean (TRUE by default), if TRUE convergence information and order of the categories of ordinal variables are printed. |
init |
Intitialization strategy, possible values are :
|
Dimension reduction
weigths : list of weights of the variables (loadings and weights are the same in PCA-like model)
components : data.frame with individuals scores for each dimension
inertia : percentage and cumulative percentage of variance of the quantified variables explained
Quantifications
quantified.data : optimally quantified variables
quantification.categories.nom : list of optimally quantified categories (nominal variables)
quantification.categories.ord : list of optimally quantified categories (ordinal variables)
level.scale : nature of scaling choosen for each variable
data : orginal dataset
Algorithm
summary : summary of the number of variables according to their nature
loss.tot : global loss for all variables
stockiter : evolution of the criterion for each ieration
Supplementary variables
var.supp : original supplementary variables
level.scale.supp : level of scaling of supplementary variables
coord.supp.num : coordinates of supplementary numeric variables (correlation with components)
coord.supp.quali : coordinates of qualitatve variables (barycenters)
Martin PARIES (Maintainer: martin.paries@oniris-nantes.fr)
Evelyne Vigneau
Stephanie Bougeard
Paries, Bougeard, Vigneau (2022), Multivariate analysis of Just-About-Right data with optimal scaling approach. Food Quality and Preference (submit)
data (antibiotic) # Level of scaling of each variable # Manually level.scale <- rep(NA,ncol(antibiotic)) #Setting level.scale argument level.scale[c(3,4)] <- "num" level.scale[c(6:14)] <- "nom" level.scale[c(1,15)] <- "ord" # Or using nature.variables() level.scale <- rep(NA,ncol(antibiotic)) res.nature <- nature.variables(antibiotic) level.scale [res.nature$p.numeric] <- "num" level.scale [res.nature$p.quali] <- "nom" #Warning; the ordinal nature of variables can not be detected automaticaly. level.scale[c(1,15)] <- "ord" # PCAOS res.PCAOS <- PCAOS( data = antibiotic, level.scale = level.scale, nb.comp = 2) # Plot (individuals) plot.PCAOS( x = res.PCAOS, choice = "ind", coloring.indiv = antibiotic$Atb.conso, size.legend = 12, size.label = 4 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.