Exemplo n.º 1
0
def MarginError(data):
    List = []
    SE = (StdDevSample(data) / (squareRoot(len(data))))
    for i in Z_scores(z_values(data)):
        ME = i * SE
        List.append(ME)

    return List
Exemplo n.º 2
0
def Sample_Correlation(list1, list2):
    n = len(list1)

    avg_x = average(list1)
    avg_y = average(list2)
    rod = 0
    x2 = 0
    y2 = 0
    for i in range(n):
        x = subtraction(list1[i], avg_x)
        y = subtraction(list2[i], avg_y)
        rod += product(x, y)
        x2 += square(x)
        y2 += square(y)

    return rod / squareRoot(x2 * y2)
Exemplo n.º 3
0
 def SquareRoot(self, a):
     if typeFunction(a) == True:
         self.result = squareRoot(a)
         return self.result
Exemplo n.º 4
0
 def test_squareRoot(self):
     self.assertEqual(5, squareRoot(25))
Exemplo n.º 5
0
def population_variance(data):
    x = StdDevPop(data)
    return squareRoot(x)
Exemplo n.º 6
0
def sample_variance(data):
    x = StdDevSample(data)
    return squareRoot(x)