phi {psych}R Documentation

Find the phi coefficient of correlation between two dichotomous variables


Given a 1 x 4 vector or a 2 x 2 matrix of frequencies, find the phi coefficient of correlation. Typical use is in the case of predicting a dichotomous criterion from a dichotomous predictor.


phi(t, digits = 2)


t a 1 x 4 vector or a 2 x 2 matrix
digits round the result to digits


In many prediction situations, a dichotomous predictor (accept/reject) is validated against a dichotomous criterion (success/failure). Although a polychoric correlation estimates the underlying Pearson correlation as if the predictor and criteria were continuous and bivariate normal variables, the phi coefficient is the Pearson applied to a matrix of 0's and 1s.

For a very useful discussion of various measures of association given a 2 x 2 table, and why one should probably prefer the Yule coefficient, see Warren (2008).

Given a two x two table of counts
a b a+b
c d c+d
a+c b+d a+b+c+d

convert all counts to fractions of the total and then \ Phi = a- (a+b)*(a+c)/sqrt((a+b)(c+d)(a+c)(b+d) )


phi coefficient of correlation


William Revelle with modifications by Leo Gurtler


Warrens, Matthijs (2008), On Association Coefficients for 2x2 Tables and Properties That Do Not Depend on the Marginal Distributions. Psychometrika, 73, 777-789.

See Also

phi2poly ,Yule, Yule2phi


x <- matrix(c(40,5,20,20),ncol=2)

[Package psych version 1.0-68 Index]