예제 #1
0
    def test_pointbiserialr(self):
        "Testing pointbiserialr"

        data1 = [self.PB, self.APB]
        data2 = [self.L, self.A]
        results = (0.8627635262664034, 9.8591235557031489e-007)

        i = 0
        for d in data1:
            self.assertEquals(stats.pointbiserialr(d, data2[i])[i], results[i])
            i += 1
예제 #2
0
 def test_pointbiserialr(self):
     "Testing pointbiserialr"
     
     data1 = [ self.PB, self.APB ]
     data2 = [ self.L, self.A ]
     results = (0.8627635262664034, 9.8591235557031489e-007)
     
     i = 0
     for d in data1:
       self.assertEquals( stats.pointbiserialr( d, data2[i] )[i], results[i] )
       i += 1
예제 #3
0
apb = N.array(pb)

print('paired:')
#stats.paired(l,m)
#stats.paired(a,b)

print()
print()
print('pearsonr:')
print(stats.pearsonr(l, m))
print(stats.pearsonr(a, b))
print('spearmanr:')
print(stats.spearmanr(l, m))
print(stats.spearmanr(a, b))
print('pointbiserialr:')
print(stats.pointbiserialr(pb, l))
print(stats.pointbiserialr(apb, a))
print('kendalltau:')
print(stats.kendalltau(l, m))
print(stats.kendalltau(a, b))
print('linregress:')
print(stats.linregress(l, m))
print(stats.linregress(a, b))

print('\nINFERENTIAL')
print('ttest_1samp:')
print(stats.ttest_1samp(l, 12))
print(stats.ttest_1samp(a, 12))
print('ttest_ind:')
print(stats.ttest_ind(l, m))
print(stats.ttest_ind(a, b))
 def evaluate( self, *args, **params):
     return _stats.pointbiserialr(*args, **params)
예제 #5
0
apb = N.array(pb)

print 'paired:'
#stats.paired(l,m)
#stats.paired(a,b)

print
print
print 'pearsonr:'
print stats.pearsonr(l,m)
print stats.pearsonr(a,b)
print 'spearmanr:'
print stats.spearmanr(l,m)
print stats.spearmanr(a,b)
print 'pointbiserialr:'
print stats.pointbiserialr(pb,l)
print stats.pointbiserialr(apb,a)
print 'kendalltau:'
print stats.kendalltau(l,m)
print stats.kendalltau(a,b)
print 'linregress:'
print stats.linregress(l,m)
print stats.linregress(a,b)

print '\nINFERENTIAL'
print 'ttest_1samp:'
print stats.ttest_1samp(l,12)
print stats.ttest_1samp(a,12)
print 'ttest_ind:'
print stats.ttest_ind(l,m)
print stats.ttest_ind(a,b)
예제 #6
0
print stats.apearsonr(array(x), array(y))

print "\n\nSpearman's r"

x = [4, 1, 9, 8, 3, 5, 6, 2, 7]
y = [3, 2, 8, 6, 5, 4, 7, 1, 9]
print '\nSHOULD BE +0.85 on the dot (N=9) ... Basic Stats 1st ed, p.193'
print stats.spearmanr(x, y)
print stats.aspearmanr(array(x), array(y))

print '\n\nPoint-Biserial r'

gender = [1, 1, 1, 1, 2, 2, 2, 2, 2, 2]
score = [35, 38, 41, 40, 60, 65, 65, 68, 68, 64]
print '\nSHOULD BE +0.981257 (N=10) ... Basic Stats 1st ed, p.197'
print stats.pointbiserialr(gender, score)
print stats.apointbiserialr(array(gender), array(score))

print '\n\nLinear Regression'

x = [1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
y = [2, 4, 4, 6, 2, 4, 7, 8, 6, 8, 7]
print '\nSHOULD BE 1.44, 1.47, 0.736, ???, 1.42 (N=11)... Basic Stats 1st ed, p.211-2'
print stats.linregress(x, y)
print stats.alinregress(array(x), array(y))

print '\n\nChi-Square'

fo = [10, 40]
print '\nSHOULD BE 18.0, <<<0.01 (df=1) ... Basic Stats 1st ed. p.457'
print stats.chisquare(fo)
print "\n\nSpearman's r"

x = [4,1,9,8,3,5,6,2,7]
y = [3,2,8,6,5,4,7,1,9]
print '\nSHOULD BE +0.85 on the dot (N=9) ... Basic Stats 1st ed, p.193'
print stats.spearmanr(x,y)
print stats.aspearmanr(array(x),array(y))


print '\n\nPoint-Biserial r'

gender = [1,1,1,1,2,2,2,2,2,2]
score  = [35, 38, 41, 40, 60, 65, 65, 68, 68, 64]
print '\nSHOULD BE +0.981257 (N=10) ... Basic Stats 1st ed, p.197'
print stats.pointbiserialr(gender,score)
print stats.apointbiserialr(array(gender),array(score))


print '\n\nLinear Regression'

x = [1,1,2,2,2,3,3,3,4,4,4]
y = [2,4,4,6,2,4,7,8,6,8,7]
print '\nSHOULD BE 1.44, 1.47, 0.736, ???, 1.42 (N=11)... Basic Stats 1st ed, p.211-2'
print stats.linregress(x,y)
print stats.alinregress(array(x),array(y))

print '\n\nChi-Square'

fo = [10,40]
print '\nSHOULD BE 18.0, <<<0.01 (df=1) ... Basic Stats 1st ed. p.457'
예제 #8
0
apb = N.array(pb)

print 'paired:'
#stats.paired(l,m)
#stats.paired(a,b)

print
print
print 'pearsonr:'
print stats.pearsonr(l, m)
print stats.pearsonr(a, b)
print 'spearmanr:'
print stats.spearmanr(l, m)
print stats.spearmanr(a, b)
print 'pointbiserialr:'
print stats.pointbiserialr(pb, l)
print stats.pointbiserialr(apb, a)
print 'kendalltau:'
print stats.kendalltau(l, m)
print stats.kendalltau(a, b)
print 'linregress:'
print stats.linregress(l, m)
print stats.linregress(a, b)

print '\nINFERENTIAL'
print 'ttest_1samp:'
print stats.ttest_1samp(l, 12)
print stats.ttest_1samp(a, 12)
print 'ttest_ind:'
print stats.ttest_ind(l, m)
print stats.ttest_ind(a, b)