I need to add supplementary variables to my Multiple Correspondence Analysis in R. I need to use ExPosition library for eigenvalues correction and plot both the active and supplementary variables using the coordinates output. This is my code:
data(poison)
mca_active <- poison[3:4]
mca_supp <- poison[5:7]
MCA = epMCA(mca_active, make_data_nominal = TRUE, DESIGN = NULL, make_design_nominal = TRUE,
masses = NULL, weights = NULL, hellinger = FALSE,
symmetric = TRUE, correction = c("b"), graphs = FALSE, k = 0)
#creating df from coordinates
coord <- as.data.frame(MCA[["ExPosition.Data"]][["fj"]])
#plotting
library(tidyverse)
library(ggplot2)
library(ggrepel)
coord_for_plot <- coord %>%
select(V1, V2)
ggplot(coord_for_plot, aes(x=V1, y=V2)) +
geom_point() + geom_text_repel(label = rownames(coord_for_plot)) +
geom_vline(xintercept = 0) +geom_hline(yintercept = 0) +
labs(x = "Dim 1", y = "Dim 2")
How can i add supp variables in my code?