Re: [R] How to create a correlation table for categorical data???

2006-01-05 Thread Michael Dewey
At 19:07 04/01/06, fabio crepaldi wrote:
>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).

If they are ordered have you considered downloading the polycor package?


Michael Dewey
[EMAIL PROTECTED]
http://www.aghmed.fsnet.co.uk/home.html

__
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


[R] How to create a correlation table for categorical data???

2006-01-04 Thread fabio crepaldi
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