Learn R Programming

SciencesPo (version 1.3.9)

calc.Phi: The Phi Coefficient for 2 x 2 Tables

Description

Computes the Phi coefficient for 2 x 2 tables.

Usage

calc.Phi(x, y = NULL, ...)

## S3 method for class 'default': calc.Phi(x, y = NULL, ...)

Arguments

x
A vector or a matrix.
y
A vector that is ignored if x is a matrix and required if x is a vector.
...
Extra parameters pass to the table function.

Details

Phi is seldom applied for indexing a 2 x 2 table, because the researcher will typically want to contrast the two proportions as an increment or ratio, not with a correlation coefficient. Alternatives to Phi are the Pearson's C; Tschuprow's T, and Cramer's V.

References

Friendly, Michael (2000) Visualizing Categorical Data. SAS Institute Inc., p. 63.

Examples

Run this code
# Admission to Berkeley graduate programs:
Berkeley <- data.frame(
expand.grid(GENDER=c("Male", "Female"),
ADMIT=c("Admitted", "Rejected")),
Freq=c(1198,557,1493,1278))

tab = as.table(rbind(c(1198,557), c(1493,1278)))
calc.Phi(tab)

Run the code above in your browser using DataLab