is it possible to check Czuprow's coefficient of the convergence in R package? just wondering - is it possible to calculate Czuprow's coefficient of the convergence in R package? if so, is there some dedicated package for that purpose?
thanks in advance
 A: This coefficient is a statistic about a two-way table with (say) $m$ rows, $n$ columns, and a total count of $N$.  It is defined as
$$\sqrt{\frac{\chi^2}{N(m-1)(n-1)}}$$
where $\chi^2$ is the chi-squared statistic for the table. It is interpreted as a measure of association between the row and column variables, with larger values indicating more association.  Although its value is always between $0$ and $1$, it can get close to $1$ only for two-by-two tables with large values of $N$.  With random variation (such as multinomial or Poisson variation in the entries), it tends to be far smaller than $1$ even when the variables are perfectly associated.
R code can very easily be written to emulate the chi-squared test in the stats package:
Czuprow <- function(..) {
  f <- chisq.test(..)
  sqrt(f$statistic / (sum(f$observed)*f$parameter))
}

Although you might get warning messages in some cases, they usually refer to computation of the chi-squared test p-value, which is irrelevant.
For example, the command
Czuprow(matrix(c(4,0,1,8), 2))

produces the result $0.671984$.
To get a sense of how to interpret this statistic, consider running a simulation.  For instance, simulations of (a) independent variables and (b) very nearly dependent variables for $m=5$, $n=8$ produced this histogram of results:

The red line shows the Czuprow coefficient for a perfectly dependent $5$ by $8$ table containing only values of $\lambda=10$ and $0$.  The histogram for nearly-dependent tables is spread between $0.2$ and $0.3$.  The histogram for nearly independent tables is clustered near $0$.
n.row <- 5
n.col <- 8
lambda <- 10
#
# Independent variables
#
x <- rgamma(n.row, lambda)
y <- rgamma(n.col, lambda)
w <- outer(x, y)
sim <- replicate(10^4, {
  Czuprow(matrix(rpois(n.row*n.col, w), nrow=n.row))
})
#
# Dependent variables
#
u <- matrix(0, n.row, n.col)
u[floor(seq(1, n.row*n.col, length.out=max(n.row, n.col))) ] <- lambda
w <- u + rgamma(n.row*n.col, lambda, scale=1/lambda)
sim.2 <- replicate(10^4, {
  Czuprow(matrix(rpois(n.row*n.col, w), nrow=n.row))
})
z <- Czuprow(u)

hist(c(sim, sim.2), breaks=seq(0, max(z, sim, sim.2), length.out=100), freq=FALSE,
     xlab="Czuprow coefficient")
abline(v=z, col="Red")

