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

    Function varTest

    • F test that the variances of two normal samples have a given ratio. Equivalent to R's var.test(). NaN values are dropped.

      Parameters

      Returns VarTestResult

      varTest([1, 3, 2, 5, 4], [2, 9, 4, 12, 7, 1]).statistic; // 0.13761467889908255
      

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

    • F test of two variances from a formula and a data frame. As R's var.test(formula, data): "y ~ g" compares the two levels of g (the first level is x). Only the variables of the formula count: the rows where one of them is missing are dropped.

      Parameters

      • formula: string

        "y ~ g".

      • data: DataFrame

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

      • Optionaloptions: VarTestOptions

      Returns VarTestResult