weight data to use MCA

694 views
Skip to first unread message

Primož

unread,
Mar 5, 2012, 8:20:35 AM3/5/12
to FactoMineR users
hi
I am rather new to R but factominer is nice solution
so I would like to run MCA but before I have to apply weight to my set
of data
any idea?
Thanks and regards Primož

François Husson

unread,
Mar 6, 2012, 11:27:03 AM3/6/12
to FactoMineR users
Hi
If you want to use weight on your individuals, you have to use the
argument row.w in the MCA function. The argument row.w is a vector of
weights. The length of this vector should be the number of
individuals.
Best
FH

Leu

unread,
Aug 5, 2016, 1:50:11 PM8/5/16
to FactoMineR users
Hi

I am rather new too. I have got a variable giving me the weight. How can I take it into my MCA?
Is there any command?

Thanks! L.

François Husson

unread,
Aug 7, 2016, 12:06:57 PM8/7/16
to FactoMineR users
Hi
You have to use the argument row.w in the MCA function.
FH

Leu

unread,
Aug 19, 2016, 8:05:34 AM8/19/16
to FactoMineR users
Hi

thank you. I've tried it this way (and row.w=9: 9 as well):

Dataset4.MCA<-Dataset4[, c("papoprof", "pafor09", "spk_p", "mapoprof", "mafor09", "spk_m", 
  "uni_pub", "fachl3", "wcal", "stufe_pub_uh")]
res<-MCA(Dataset4.MCA, ncp=5, ind.sup=NULL, row.w="wcal", quali.sup=10: 10, 
  graph = FALSE) 

But there is nothing changing. Also if I change something in the script  and run it again, it doesn't include or delete variables. What am I doing wrong? It should be possible to change some things through the skript, right?

François Husson

unread,
Aug 24, 2016, 3:25:22 AM8/24/16
to FactoMineR users
Hi
The weights are on the rows so you should have a vetor of weights which has the same length as the number of rows.
FH

Leu

unread,
Aug 24, 2016, 9:14:57 AM8/24/16
to FactoMineR users
Hi
ok, thank you. But I'm still not sure if I'm understanding right..

In my dataset there is a weighting variable. And to get a propre result, it should be involved in the analysis. Is it involved, when the vector just has the same length as the number of rows?

Kind regards
Leu

François Husson

unread,
Aug 24, 2016, 11:21:10 AM8/24/16
to FactoMineR users
You have to do:
res <- MCA(MyDataSet[,-ind.weight],row.w=MyDataSet[,ind.weight])

with ind.weight the index of the variable in your dataset that corresponds to the weight of the individuals.
FH

Leu

unread,
Aug 25, 2016, 5:01:54 AM8/25/16
to FactoMineR users
Ok, thank you. I tried it and I got the message, that ind.weight can't be found.

That's what I wrote:

res <- MCA(Dataset4.MCA[,-ind.weight],row.w=Dataset4.MCA[,ind.weight], ncp=5, quali.sup=9: 10, graph = FALSE)

Do I need to get an other package or do I have to define ind.weight to get the weighting variable from the Dataset into Dataset4?
Reply all
Reply to author
Forward
0 new messages