rStats.js v1.3.0
    Preparing search index...

    Function etaSquared

    • Eta squared of the terms of an analysis-of-variance table (partial by default, or generalized), with confidence intervals from the noncentral F distribution. Equivalent to effectsize::eta_squared() in R. It takes a table of anova() or Anova(); a fit from lm() with a formula is replaced by its anova() table.

      Repeated measures: for a fit of aov() with an Error() term (or its aovSummary) each term is measured against the residual of its error stratum, the totals add up all strata, and the result has the stratum of each row in groups; for a result of aovEz, the same from car's univariate tests (rows as afex's table).

      Parameters

      Returns AnovaEffectSizeTable

      const data = { y: [2.1, 3.9, 6.2, 7.8, 10.1, 11.8], g: ["a", "a", "b", "b", "c", "c"] };
      etaSquared(anova(lm("y ~ g", data))).colNames; // ["Eta2", "CI", "CI_low", "CI_high"]
      const long = {
      y: [5, 7, 8, 4, 6, 9, 6, 8, 8, 5, 5, 7],
      W: ["a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c"],
      id: ["s1", "s1", "s1", "s2", "s2", "s2", "s3", "s3", "s3", "s4", "s4", "s4"],
      };
      etaSquared(aov("y ~ W + Error(id/W)", long)).groups; // ["id:W"]