@Test public void testTestPercentages() { logger.info("testPercentages"); double p1bar = 0.54; double p2bar = 0.61; int n1 = 1000; int n2 = 1000; boolean is_twoTailed = false; double aLevel = 0.05; boolean expResult = true; boolean result = NormalIndependentSamples.testPercentages(p1bar, p2bar, n1, n2, is_twoTailed, aLevel); assertEquals(expResult, result); }
public static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel) { if(n1<=0 || p1bar<0 || n2<=0 || p2bar<0) { throw new IllegalArgumentException("All the parameters must be positive."); } double z=(p1bar-p2bar)/Math.sqrt(p1bar*(1.0-p1bar)/n1+p2bar*(1.0-p2bar)/n2); boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel); return rejectH0; }
NormalIndependentSamples { public static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel) { if(n1<=0 || p1bar<0 || n2<=0 || p2bar<0) { throw new IllegalArgumentException("All the parameters must be positive."); } double z=(p1bar-p2bar)/Math.sqrt(p1bar*(1.0-p1bar)/n1+p2bar*(1.0-p2bar)/n2); boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel); return rejectH0; } }
NormalIndependentSamples { public static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel) { if(n1<=0 || p1bar<0 || n2<=0 || p2bar<0) { throw new IllegalArgumentException("All the parameters must be positive."); } double z=(p1bar-p2bar)/Math.sqrt(p1bar*(1.0-p1bar)/n1+p2bar*(1.0-p2bar)/n2); boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel); return rejectH0; }  }
NormalIndependentSamples { public static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel) { if(n1<=0 || p1bar<0 || n2<=0 || p2bar<0) { throw new IllegalArgumentException("All the parameters must be positive."); } double z=(p1bar-p2bar)/Math.sqrt(p1bar*(1.0-p1bar)/n1+p2bar*(1.0-p2bar)/n2); boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel); return rejectH0; }  static boolean testMeans(double xbar, double ybar, int n, int m, double stdx, double stdy, boolean is_twoTailed, double aLevel); static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel); static boolean testOddsRatio(int n11, int n12, int n21, int n22, boolean is_twoTailed, double aLevel); }
NormalIndependentSamples { public static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel) { if(n1<=0 || p1bar<0 || n2<=0 || p2bar<0) { throw new IllegalArgumentException("All the parameters must be positive."); } double z=(p1bar-p2bar)/Math.sqrt(p1bar*(1.0-p1bar)/n1+p2bar*(1.0-p2bar)/n2); boolean rejectH0=checkCriticalValue(z, is_twoTailed, aLevel); return rejectH0; }  static boolean testMeans(double xbar, double ybar, int n, int m, double stdx, double stdy, boolean is_twoTailed, double aLevel); static boolean testPercentages(double p1bar, double p2bar, int n1, int n2, boolean is_twoTailed, double aLevel); static boolean testOddsRatio(int n11, int n12, int n21, int n22, boolean is_twoTailed, double aLevel);  }