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

    Function bartlettTest

    • Bartlett's test that the variances of several normal samples are equal. Equivalent to R's bartlett.test(). Takes a list of samples. NaN and infinite values are dropped, as in R.

      Parameters

      • groups: readonly Sample[]

        The samples (at least two), each with at least two finite values.

      Returns BartlettTestResult

      bartlettTest([[1, 3, 2, 5], [2, 9, 4, 12, 7], [3, 3.5, 4, 2]]).statistic;
      

      There is also a formula form, bartlettTest("y ~ g", data) (next overload).

    • Bartlett's test from a formula and a data frame. As R's bartlett.test(formula, data): "y ~ g", one group per level of g, in the order of the levels. Only the variables of the formula count: the rows where one of them is missing are dropped.

      Parameters

      • formula: string

        "y ~ g" (one variable on each side).

      • data: DataFrame

        The data frame: an object of columns (null or NaN for a missing value).

      Returns BartlettTestResult