2

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")
4

1 に答える 1

2

問題は統計的であり、計算的ではないと思います。コレスポンデンス分析では、最大で min(j-1;i-1) 次元が生成されます。ここで、i は行数、j は列数 (つまり、2 つの変数のモダリティの数) です。aj=2;i=8 分割表の CA を実行しようとしています。1軸しか出力できません。これが、このエラーが発生する理由です。2 つのモダリティ変数で CA を使用しないでください。

このpの数学的説明があります。たとえば、Benzecry のコレスポンダンス分析ハンドブックの 84 を参照してください。CVでこれについて質問すると、より良い説明が得られる場合があります。

childrenのデータ セットの例を次に示しFactoMineRます。

library(FactoMineR)
data("children")
## Example from help("CA"), works fine
summary(CA(children, row.sup = 15:18, col.sup = 6:8))
## Example when we restrict the contingency table to the first two rows.
## Produces an error
summary(CA(children, row.sup = 3:18, col.sup = 6:8))
于 2016-01-18T09:48:29.753 に答える