Case Study: Wine tasting

library("FactoMineR")
## Warning: package 'FactoMineR' was built under R version 4.2.1
library("factoextra")
## Warning: package 'factoextra' was built under R version 4.2.1
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.2.1
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
data_MFA_Wine = read.csv("C:/Users/DELL/Downloads/Documents/CAOHOC/MANOVA/Tieets_10_MCA_cont/data_MFA_WineJurys.csv", sep = ';',header = TRUE,encoding="latin1")
data_MFA_Wine = as.data.frame(data_MFA_Wine)
rownames(data_MFA_Wine) <- data_MFA_Wine[,1]
data_MFA_Wine <- data_MFA_Wine[,-1]
data_MFA_Wine[,"Grade.variety"] = as.factor(data_MFA_Wine[,"Grade.variety"])
ExpertBlock <- data_MFA_Wine[,1:28]
StudentBlock <- data_MFA_Wine[,c(1,29:43)]
CusBlock <- data_MFA_Wine[,c(1,44:50)]
StuCusBlock <-  data_MFA_Wine[,c(1,29:50)]

Multi table problem

Tất cả các block dữ liệu đều được đánh trọng số như nhau (quan niệm cân bằng)

Balancing thẻ influence of each group of Var: > in PCA: normalizing balances each variable’s influence (when calculating distances between individuals i and I’) > in MFA, we balance in terms of groups –> 1st idea: divide each variable with group …

MFA is a weighted PCA * Calculatw the 1st eigenvalue lambda of the jth group of vars (j=1,…,n) * Do an overall PCA on the weighted table

res.mfa.expert = MFA(ExpertBlock, group=c(1,13,7,7), type=c("n",rep("s",3)), ncp=5, name.group=c("Grade-var","Oudour","Taste","Sensor"), num.group.sup=c(1))

res.mfa.stucus = MFA(StuCusBlock, group=c(1,14,8), type=c("n",rep("s",2)), ncp=5, name.group=c("Grade-var","Oudour","Taste"), num.group.sup=c(1))

Can not do this as it will generate error dimension

res.mfa.customer = MFA(CusBlock, group=c(1,7), type=c("n",rep("s",1)), ncp=5, name.group=c("Grade-var","Oudour"), num.group.sup=c(1))