rStats.js v1.3.0
    検索インデックスを準備しています...

    Function Anova

    • Type II または Type III の、線形モデルの項の検定です。R の car::Anova() と同等です。lm の当てはめに car::Anova(fit, type = 2) または type = 3 を使ったときと同じく、列は Sum Sq、Df、F value、Pr(>F) で、行は項 (Type III では、モデルに切片があるときは先頭が (Intercept)) と Residuals です。

      Type II は、各項を、その項を含む項を除いた他のすべての項の後で検定します (car の周辺性。対比には依存しません)。Type III は、モデル自身の行列の各列の組を、他のすべての列の後で検定します。そのため対比に依存します (contr.sum が通常の選択です)。

      エラーは car と同じです: residual df = 0、residual sum of squares is 0 (within rounding error)、および Type III の場合のみ there are aliased coefficients in the model。切片だけのモデルの Type II は、警告つきで Type III の表になります。

      Parameters

      戻り値 AnovaTable

      const data = { y: [4.2, 5.1, 6.3, 5.8, 7.9, 8.4, 6.1, 7.2], A: ["a", "a", "b", "b", "a", "a", "b", "b"], B: ["p", "q", "p", "q", "p", "q", "p", "q"] };
      const t = Anova(lm("y ~ A * B", data, { contrasts: { A: "contr.sum", B: "contr.sum" } }), { type: 3 });
      t.rowNames; // ["(Intercept)", "A", "B", "A:B", "Residuals"]