def standardised_score(my_pop): my_mean = mean(my_pop) my_sd = popstand(my_pop) standardised_score = float(list()) for x in my_pop: my_score = (x - my_mean) / my_sd standardised_score.append(my_score) return standardised_score
def confidence_interval(numbers): num_value = len(numbers) result = popstand(numbers) result2 = squareroot(num_value) sample_error = division(result2, result) margin_error = multiplication( 1.96, sample_error) # 1.96=z_value for 95% confidence interval result4 = addition(result, margin_error) result5 = subtraction(margin_error, result) return result4, result5
def confidence(self): d = [] for row in self.data.data: d.append(row['v']) self.result = popstand(d) return self.result