Enum UnconditionedExactTest.Method

    • Enum Constant Detail

      • Z_POOLED

        public static final UnconditionedExactTest.Method Z_POOLED
        Uses the test statistic from a Z-test using a pooled variance.

        \[ T(X) = \frac{\hat{p}_0 - \hat{p}_1}{\sqrt{\hat{p}(1 - \hat{p}) (\frac{1}{m} + \frac{1}{n})}} \]

        where \( \hat{p}_0 = a / m \), \( \hat{p}_1 = b / n \), and \( \hat{p} = (a+b) / (m+n) \) are the estimators of \( p_0 \), \( p_1 \) and the pooled probability \( p \) assuming \( p_0 = p_1 \).

        The more extreme tables are identified using the AlternativeHypothesis:

        • greater: \( T(X) \ge T(X_0) \)
        • less: \( T(X) \le T(X_0) \)
        • two-sided: \( | T(X) | \ge | T(X_0) | \)

        The use of the Z statistic was suggested by Suissa and Shuster (1985). This method is uniformly more powerful than Fisher's test for balanced designs (\( m = n \)).

      • Z_UNPOOLED

        public static final UnconditionedExactTest.Method Z_UNPOOLED
        Uses the test statistic from a Z-test using an unpooled variance.

        \[ T(X) = \frac{\hat{p}_0 - \hat{p}_1} {\sqrt{ \frac{\hat{p}_0(1 - \hat{p}_0)}{m} + \frac{\hat{p}_1(1 - \hat{p}_1)}{n}} } \]

        where \( \hat{p}_0 = a / m \) and \( \hat{p}_1 = b / n \).

        The more extreme tables are identified using the AlternativeHypothesis as per the Z_POOLED method.

      • BOSCHLOO

        public static final UnconditionedExactTest.Method BOSCHLOO
        Uses the p-value from Fisher's exact test. This is also known as Boschloo's test.

        The p-value for Fisher's test is computed using using the AlternativeHypothesis. The more extreme tables are identified using \( p(X) \le p(X_0) \).

        This method is always uniformly more powerful than Fisher's test.

        See Also:
        FisherExactTest
    • Method Detail

      • values

        public static UnconditionedExactTest.Method[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UnconditionedExactTest.Method c : UnconditionedExactTest.Method.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UnconditionedExactTest.Method valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null