[R] nominal data

Unung Istopo Hartanto unung at enciety.com
Wed Jun 9 10:39:01 CEST 2004


Hi,

try ?cor

but. I doubt it's your problem, and I think there's an another way to
make correlation with nominal data, not used ?cor. But, i've been
explore it yet.

ex. :
cbind(c("one","one","two","three","two","three"),c("one","three","three","three","two","two")) -> test

> test
     [,1]    [,2]
[1,] "one"   "one"
[2,] "one"   "three"
[3,] "two"   "three"
[4,] "three" "three"
[5,] "two"   "two"
[6,] "three" "two"

> data.frame(test)
     X1    X2
1   one   one
2   one three
3   two three
4 three three
5   two   two
6 three   two

> data.frame(test) -> data

> cor(data$X1,data$X2)
[1] 0.5940885

I hope this helps,

Unung

On Wed, 2004-06-09 at 15:15, Bianca wrote:
> Hi,
> 
> I am a new user of R. I have 2 series of nominal data (2 series of answers
> for the same question) and I want to calculate the correlation between these
> 2 series. I've tried to use the correlation function (corr, ...) but all are
> for numeric data... Does anyone know what function should I use for the
> nominal data?
> 
> Thanks a lot,
> Bianca
>




More information about the R-help mailing list