Hi,
I need to create the correlation table of a set of categorical data (sex,
marital_status, car_type, etc.) for a given population.
Basically what I'm looking for is a function like cor( ) working on factors
(and, if possible, considering NAs as a level).
To better express myself, the manual way should be:
1) to create a set of n-1 numeric dummies (whose assigned values are 0,1) for
each factor of n levels;
2) to cbind them into a data.frame;
3) to apply the cor( ) function to this data.frame.
But that takes time and I'll have to do it for several different datasets
with different levels... There must be a smartest and quickest way.
Is there anybody who can help me???
Many thanks guys,
bye.
Fabio
-
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html