Computes a confidence interval for a phi correlation. This function requires the frequency counts from a 2 x 2 contingency table for two dichotomous variables. This measure of association is usually most appropriate when both dichotomous variables are naturally dichotomous.
ci.phi(alpha, f00, f01, f10, f11)
alpha level for 1-alpha confidence
number of participants with y = 0 and x = 0
number of participants with y = 0 and x = 1
number of participants with y = 1 and x = 0
number of participants with y = 1 and x = 1
Returns a 1-row matrix. The columns are:
Estimate - estimate of phi correlation
SE - standard error
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
Bishop YMM, Fienberg SE, Holland PW (1975). Discrete Multivariate Analysis. MIT Press.
ci.phi(.05, 229, 28, 96, 24)
#> Estimate SE LL UL
#> [1,] 0.1229976 0.05746271 0.01037273 0.2356224
# Should return:
# Estimate SE LL UL
# [1,] 0.1229976 0.05746271 0.01037273 0.2356224