Exemplo n.º 1
0
    def cochran(sd, data, rnge):
        z = zScore.zScore(data)
        p = PopulationProportion.proportion(sd, data, rnge)
        e = MarginError.marginError(sd, data)
        q = 1 - p

        cochran = (Exponentiation.sqr(z, 2) * p * q) / Exponentiation.sqr(e, 2)

        return cochran
    def sampleSize(sd, data):

        e = MarginError.margin(sd, data)
        stdDev = StandardDeviation.standardDeviation(data)
        val = (1.96 * stdDev) / e
        sample = Exponentiation.exponent(val, 2)

        return sample
    def sampleSize(sd, data, percentage):
        z = Zscore.zscore(sd, data)
        e = MarginError.margin(sd, data)
        p = percentage
        q = 1 - p
        val = z / e
        sample = Exponentiation.exponent(val, 2) * p * q

        return sample
Exemplo n.º 4
0
    def sampleSize(sd, data, percentage):
        z = zScore.zScore(sd)
        e = MarginError.marginError(sd, data)
        p = percentage
        q = 1 - p
        val = z/e
        sample = Exponentiation.sqr(val, 2) * p * q

        return sample
Exemplo n.º 5
0
 def test_MathOperations_exponentiation(self):
     self.assertEqual(4, Exponentiation.exponentiation(2, 2))
Exemplo n.º 6
0
 def test_MathOperations_exponentiation(self):
     self.assertEqual(8, Exponentiation.power(2, 3))
Exemplo n.º 7
0
 def test_MathOperations_exponent(self):
     self.assertEqual(81, Exponentiation.exponent(9, 2))
Exemplo n.º 8
0
 def test_MathOperations_exponentiation(self):
     Exponentiation.power(2, 2)
     self.assertEqual(4, Exponentiation.power(2, 2))
Exemplo n.º 9
0
 def Exponentiation(self, a, b):
     self.Result = Exponentiation.exponentiation(a, b)
     return self.Result
Exemplo n.º 10
0
def Power(a, b):
    return Exponentiation.power(a, b)
Exemplo n.º 11
0
 def Power(self, a, b):
     self.Result = Exponentiation.power(a, b)
     return math.pow(a, b)
 def test_MathOperations_Exponentiation(self):
     self.assertEqual(16, Exponentiation.power(4, 2))
Exemplo n.º 13
0
 def test_MathOperations_Exponentiation(self):
     self.assertEqual(27, Exponentiation.exponentiation(3, 3))
Exemplo n.º 14
0
 def Power(self, a, b):
     self.Result = Exponentiation.power(a, b)
Exemplo n.º 15
0
 def Exponent(self, a, b):
     self.Result = Exponentiation.sqr(a, b)
     return self.Result