apply the weight data to the MCA function

480 views Asked by At

I have a data set of 25 qualitative variables and the 26th variable corresponds to the weight assigned to each individual.

I used the MCA function from the FactoMiner package, and to take into account the weighting I added the option row.w. here is my code :

res.mca <- MCA(Vague5_ACM[,-26],
              row.w = Vague5_ACM[,26],
              quali.sup = 1:2,
              graph=T)

however, adding the row. w option gives me an error message :

Error in MCA(Vague5_ACM[, -26], row.w = Vague5_ACM[, 26], quali.sup = 1:2, : length of vector row.w should be the number of active rows

How to solve this problem?

1

There are 1 answers

0
Narimene LOUATI On

Finally, I found the solution :

in my data vector with the weights, an individual had a weight = 0. so, I deleted it from my data, and and I kept only the active observations != 0.