Section 7.9 Biserial and Point-Biserial Correlations
Now, what about if you have logical variables? T/F, Yes/No, M/F, etc? How can we run a correlation on them if they are not numeric? Great question! What we can do is turn them into βnumericβ values, turning them into 0βs and 1βs, and then run a correlation.
# What do you do when you have a biserial (you're either dead or alive)
# Or when you have a point-biserial (failed by 1 pts vs failed by 42 pts vs passed by 4pts)
examData$college_binary <- ifelse(examData$first_generation_college_student=="No",0,1)
cor.test(examData$exam_score, examData$college_binary)
Pearson's product-moment correlation
data: examData$exam_score and examData$college_binary
t = 0.30181, df = 98, p-value = 0.7634
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.1669439 0.2255416
sample estimates:
cor
0.0304735
From this, we can see that being a first generation college student does not significantly correlate with exam scores.
