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

    Function propTest

    • Test of equal or given proportions. Equivalent to R's prop.test().

      As R, warnings has "Chi-squared approximation may be incorrect" where an expected count of the table of successes and failures (n p or n (1 - p), p the given or the pooled proportion) is below 5.

      Parameters

      • x: number | readonly number[] | readonly (readonly number[])[]

        Numbers of successes, or a table of rows [successes, failures].

      • Optionaln: number | readonly number[] | PropTestOptions

        Numbers of trials (omitted, and the options passed in its place, when x is a table).

      • options: PropTestOptions = {}

      Returns PropTestResult

      propTest([83, 90, 129, 70], [86, 93, 136, 82]).pValue; // equality of four proportions
      propTest(15, 20, { p: 0.5 }).confInt;