R Phi Coefficient Calculation
I have a dataframe in R and am trying to determine the Phi correlation coefficient between 2 binary (aka dichotomous: 0 or 1) variables, each one in a column (column1 and column2). I have installed the psych package and ran the code below but not working:
x = matrix(c(dataframe$column1, dataframe$column2),ncol=2)
phi (x)
Any suggestions for code?
Topic rstudio correlation binary r
Category Data Science