コード例 #1
0
    def cochran(data, p=0.5):
        mrgnerror = MarginOfError.marginoferror(data)
        q = 1 - mrgnerror
        z = ZScore.zscore(data)

        return (Exponentiation.power(z, 2) * p * q) / Exponentiation.power(
            mrgnerror, 2)
コード例 #2
0
    def SimpleSample(sd, data, rnge):

        z = Zscore.zscore(data)
        p = PopulationProportion.proportion(sd, data, rnge)
        e = MarginError.margin(sd, data)
        q = 1 - p

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

        return SimpleSample
コード例 #3
0
    def sample(list,p = 0.5,ci = 0.95):

        e = Margin_Error.error(list,ci)
        q = 1-p
        z = Zscore.ZscoreCalculatorUsingAlpha(ci)
        #print("Zvalue is ", z)
        #print("error value is: ",e)

        result = (Exponentiation.power(z,2)*p*q)/Exponentiation.power(e,2)

        return result
コード例 #4
0
 def samplenostdev(data, p = 0.5):
     zval = ZScore.zscore(data)
     merror = MarginOfError.marginoferror(data)
     q = 1 - p
     pq = p*q
     num = Exponentiation.power((zval/(merror/100)),2)*pq
     return round(num, 2)
コード例 #5
0
 def SamplSizeCalc(cvalue, error, p=0.5):
     zvalue = Zscore.ZscoreCalculatorUsingAlpha(cvalue)
     #print("zvalue is ", zvalue)
     q = 1 - p
     pq = p * q
     #print('pq value is ',pq)
     temp = Exponentiation.power((zvalue / (error / 100)), 2) * pq
     return round(temp, 2)
コード例 #6
0
    def sampleSize(sd, data):

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

        return sample
コード例 #7
0
    def sampleSize(sd, data, percentage):
        z = Zscore.zscore(sd, data)
        e = MarginError.marginError(sd, data)
        p = percentage
        q = 1 - p
        val = z/e
        sample = Exponentiation.exponent(val, 2) * p * q

        return sample
コード例 #8
0
    def deviation_Calculator(data):
        newdata = []
        data.sort()
        n = len(data)
        mean = Mean.Mean_Calculator(data)
        for i in data:
            newdata.append(Exponentiation.power((i - mean),2))

        sum = Addition.sumList(newdata)
        return nthRoot.rooting(2,Division.divide(sum,n))
コード例 #9
0
    def stardardDev(data):
        n = len(data)
        mn = Mean.mean(data)
        newlist = []

        for i in data:
            newlist.append(Exponentiation.power(i - mn, 2))

        total = Addition.sumList(newlist)
        return nthroot.root(2, Division.divide(total, n))
コード例 #10
0
 def test_MathOperations_Exponentiation(self):
     self.assertEqual(16, Exponentiation.power(4, 2))
コード例 #11
0
 def exponent(self, a, b):
     self.Result = Exponentiation.exponent(a, b)
     return self.Result
コード例 #12
0
 def variance(data):
     return Exponentiation.power(StandardDeviation.stardardDev(data), 2)
コード例 #13
0
ファイル: Calculator.py プロジェクト: AtomIOI/CalculatorTwo
 def Power(self, a, b):
     self.Result = Exponentiation.power(a, b)
     return self.Result
コード例 #14
0
 def exponent(self, a, b):
     self.result = Exponentiation.power(a, b)
     return self.result
コード例 #15
0
 def samplestdev(data):
     zval = ZScore.zscore(data)
     stdDev = StandardDeviation.stardardDev(data)
     merror = MarginOfError.marginoferror(data)
     num = Exponentiation.power(((zval * stdDev) / (merror / 100)), 2)
     return round(num, 2)
コード例 #16
0
 def test_MO_exp(self):
     self.assertEqual(8, Exponentiation.power(2, 3))
コード例 #17
0
ファイル: Variance.py プロジェクト: hc388/calculator_Team
    def Variance_Calculator(data):

        return Exponentiation.power(
            Standard_Deviation.deviation_Calculator(data), 2)