Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Why am I unable to use cor.test() for point-biserial data?

$
0
0

I'm solving a task in Andy's Discovering Statistics using R. It's about gender and arousal for certain films. The data frame used is called chickFlick, and it looks as follows:

    gender                 film arousal
1   Male Bridget Jones' Diary      22
2   Male Bridget Jones' Diary      13
3   Male Bridget Jones' Diary      16
4   Male Bridget Jones' Diary      10
5   Male Bridget Jones' Diary      18
6   Male Bridget Jones' Diary      24

When I executed this command:

> cor.test(chickFlick$gender,chickFlick$arousal)

It returned:

Error in cor.test.default(chickFlick$gender, chickFlick$arousal) : 
  'x' must be a numeric vector

However, I was doing exactly what the answer key says. I could change the gender levels into 0s and 1s, but the textbook doesn't say it's necessary. What went wrong?


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>