# R Phi Coefficient Calculation [closed]

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?

• For questions like this, it is helpful if you add more detail. I would start by adding more of your code so that a person that answers this question can see if maybe its an issue with the code before it. Also, please clarify how this is not working. Does it come with an error or produce a bad result? Sep 14 at 2:26