Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.stats.distribution.tprob

All Samples(18)  |  Call(9)  |  Derive(0)  |  Import(9)

```from __future__ import division
import warnings
from cogent.maths.stats.distribution import chi_high, z_low, z_high, zprob, \
t_high, t_low, tprob, f_high, f_low, fprob, binomial_high, binomial_low, \
ndtri
```
```        return t_low(t, df)
else:
return tprob(t,df)

def reverse_tails(tails):
```

```from __future__ import division
import warnings
from cogent.maths.stats.distribution import chi_high, z_low, z_high, zprob, \
t_high, t_low, tprob, f_high, f_low, fprob, binomial_high, binomial_low, \
ndtri
```
```        return t_low(t, df)
else:
return tprob(t,df)

def reverse_tails(tails):
```

```from __future__ import division
import warnings
from cogent.maths.stats.distribution import (chi_high, z_low, z_high, zprob,
t_high, t_low, tprob, f_high, f_low, fprob, binomial_high, binomial_low,
ndtri)
```
```        return t_low(t, df)
else:
return tprob(t,df)

def reverse_tails(tails):
```
```        try:
ts = corr*((df/(1.-corr**2))**.5)
return tprob(ts, df) #two tailed test because H0 is corr=0
except (ValueError, FloatingPointError, ZeroDivisionError):
# something unpleasant happened, most likely r or rho where +- 1
```

```from __future__ import division
import warnings
from cogent.maths.stats.distribution import (chi_high, z_low, z_high, zprob,
t_high, t_low, tprob, f_high, f_low, fprob, binomial_high, binomial_low,
ndtri)
```
```        return t_low(t, df)
else:
return tprob(t, df)

```
```        try:
ts = corr * ((df / (1. - corr ** 2)) ** .5)
return tprob(ts, df)  # two tailed test because H0 is corr=0
except (ValueError, FloatingPointError, ZeroDivisionError):
# something unpleasant happened, most likely r or rho where +- 1
```

```
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.distribution import z_low, z_high, zprob, chi_low, \
chi_high, t_low, t_high, tprob, poisson_high, poisson_low, poisson_exact, \
binomial_high, binomial_low, binomial_exact, f_low, f_high, fprob, \
```

```
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.distribution import z_low, z_high, zprob, chi_low, \
chi_high, t_low, t_high, tprob, poisson_high, poisson_low, poisson_exact, \
binomial_high, binomial_low, binomial_exact, f_low, f_high, fprob, \
```

```# cogent imports
from cogent.maths.stats import chisqprob
from cogent.maths.stats.distribution import zprob, tprob

__author__ = "Rob Knight"
```
```        n = 12
ts = 5.45618 # only 5 sig figs in sokal and rohlf
exp = tprob(ts, n-2)
obs = assign_correlation_pval(r, n, 'parametric_t_distribution')
self.assertFloatEqual(exp, obs, eps=10**-5)
```

```# cogent imports
from cogent.maths.stats import chisqprob
from cogent.maths.stats.distribution import zprob, tprob

__author__ = "Rob Knight"
```
```        n = 12
ts = 5.45618  # only 5 sig figs in sokal and rohlf
exp = tprob(ts, n - 2)
obs = assign_correlation_pval(r, n, 'parametric_t_distribution')
self.assertFloatEqual(exp, obs, eps=10 ** -5)
```

```from copy import copy
from cogent.maths.stats.test import correlation,spearman,correlation_test
from cogent.maths.stats.distribution import tprob,t_high
from biom.table import table_factory,DenseOTUTable

```
```
if tails == 'two-tailed':
prob = tprob(t,n-2)
elif tails == 'high':
prob = t_high(t,n-2)
```