I am trying calculate a correlation across multiple variables. Most of my variables are continuous, but one of them is binary. I would like to produce a single matrix with all of my variables in the matrix. But my code is not working. Here is my code:
cor.test(df[, c('sat','pba','cte_certs', 'course_credits', "college.going")], use="complete.obs")
Here is what my data frame looks like:
How should I set up my code to calculate the point biserial correlation across these vars?
One way to do it:
1. Check for normality:
We assume all our interval variables are normally distributed:
2. Do the point biserial correlation:
The correlation matrix
3. As an add-on: Visualize it: