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, 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
def Exponent(self, a, b): self.Result = Exponentiation.sqr(a, b) return self.Result