data(body.df)
z = table(body.df$ethnicity, body.df$married)
rowdistr(z)
rowdistr(z, comp = "between")
rowdistr(z, comp = "within")
## from matrix of counts
z = matrix(c(4, 3, 2, 6, 47, 20, 40, 62, 11, 8, 7, 22, 3, 0, 1, 10), 4, 4)
rowdistr(z)
Run the code above in your browser using DataLab