public static boolean testOddsRatio(int n11, int n12, int n21, int n22, boolean is_twoTailed, double aLevel) {
        if(n11<=0 || n12<=0 || n21<=0 || n22<=0) {
            throw new IllegalArgumentException("All the parameters must be positive.");
        }

        //standardize it
        double thita=((double)n11*n22)/(n12*n21);

        double z=Math.log(thita)/Math.sqrt(1.0/n11+1.0/n12+1.0/n21+1.0/n22);

        boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel);

        return rejectH0;
    }
public static boolean testOddsRatio ( int n11 , int n12 , int n21 , int n22 , boolean is_twoTailed , double aLevel ) { if ( n11 <= 0 || n12 <= 0 || n21 <= 0 || n22 <= 0 ) { throw new IllegalArgumentException ( "All the parameters must be positive." ) ; } double thita = ( ( double ) n11 * n22 ) / ( n12 * n21 ) ; double z = Math . log ( thita ) / Math . sqrt ( 1.0 / n11 + 1.0 / n12 + 1.0 / n21 + 1.0 / n22 ) ; boolean rejectH0 = checkCriticalValue ( z , is_twoTailed , aLevel ) ; return rejectH0 ; }
Independent Samples, 2x2 Tables Odds Ratio Test for Normal.
Requirements: Percentages

@param n11
@param n12
@param n21
@param n22
@param is_twoTailed
@param aLevel
@return