它似乎不适用于这张名为 mytable 的表:
0 1 2 3 4 5 7
Click_No 242854 91661 102 21 65 51 291
Click_Yes 48274 20785 14 2 19 4 146
但是,它适用于这张桌子:
0 1 2 3 4 5 7
Row1 4 0 0 0 0 0 11
Row2 35 2 0 0 0 0 0
Row3 18364 14 0 0 0 0 0
Row4 13 0 0 0 0 0 7
Row5 1497 1521 6 0 0 0 0
Row6 686 2 0 0 0 0 393
Row7 270167 110512 110 23 84 54 0
Row8 1 0 0 0 0 0 26
Row9 361 395 0 0 0 1 0
我使用了以下FactoMineR
功能:
res.ca <- CA(mytable)
CA
不适用于特定类型的列联表?除了非常大的尺寸之外,我还没有阅读文献中的任何内容来暗示这一点。
Error generated when running summary(res.ca):
Call:
CA(X = mytable)
The chi square of independence between the two variables is equal to 297.3778 (p-value = 2.982623e-61 ).
Eigenvalues
Dim.1
Variance 1e-03
% of var. 1e+02
Cumulative % of var. 1e+02
Rows
Error in if (nrow(res$row$coord) > nbelements) cat(paste(" (the ", nbelements, :
argument is of length zero
In addition: Warning message:
In max(nchar(rownames(res[aux[1]][[1]]$coord))) :
no non-missing arguments to max; returning -Inf
编辑:
dput(mytable)
输出:
mytable <- structure(c(242854L, 48274L, 91661L, 20785L, 102L, 14L, 21L,
2L, 65L, 19L, 51L, 4L, 291L, 146L), .Dim = c(2L, 7L), .Dimnames = structure(list(
c("0", "1"), c("0", "1", "2", "3", "4", "5", "7")), .Names = c("",
"")), class = "table")