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

    Function onewayTest

    • Test that several normal samples have equal means, without (default) or with the assumption of equal variances. Equivalent to R's oneway.test().

      Parameters

      • x: Sample | readonly Sample[]

        An array of samples, or one sample with group labels g.

      • Optionalg: readonly GroupLabel[] | OnewayTestOptions

        Group labels, parallel to x (or the options, when x is an array of samples).

        There is also a formula form, onewayTest("y ~ A + B", data, options) (next overload).

      • Optionaloptions: OnewayTestOptions

      Returns OnewayTestResult

      const r = onewayTest([[2.9, 3.0, 2.5, 2.6, 3.2], [3.8, 2.7, 4.0, 2.4], [2.8, 3.4, 3.7, 2.2, 2.0]]);
      r.statistic; // 0.39190547838578593 (Welch)
      r.parameter; // [2, 5.518701575163452]
      r.pValue; // 0.693185476837351
    • One-way analysis of means from a formula and a data frame. As R's oneway.test(formula, data): "y ~ A" has one group per level of A; with several factors, "y ~ A + B", the groups are the combinations of their levels present in the data (R's interaction(), the first factor varying fastest). Only the variables of the formula count: the rows where one of them is missing are dropped.

      Parameters

      Returns OnewayTestResult