Skip to content
Prev 54046 / 63424 Next

Are r2dtable and C_r2dtable behaving correctly?

It is not about "really arge total number of observations", but:

set.seed(4711);tabs <- r2dtable(1e6, c(2, 2), c(2, 2)); A11 <- vapply(tabs, function(x) x[1, 1], numeric(1));table(A11)

A11
     0      1      2 
166483 666853 166664 

There are three possible matrices, and these come out in proportions 1:4:1, the one with all cells filled with ones being
most common.

Cheers, Jari O.