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

# cogent.maths.stats.chisqprob

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)

```        bg_char, L0 = max(col0.items(), key=value_of)
LLR = 2 * (math.log(L1) - math.log(L0))
pvalue = stats.chisqprob(LLR, df)
# XXX DBG
logging.info("%s/%s %d : H0=%g, H1=%g, LLR=%g, p=%g"
```

```LR = 2 * (lf.getLogLikelihood() - null_lnL)
df = lf.getNumFreeParams() - null_nfp
P = stats.chisqprob(LR, df)
print "Likelihood ratio statistic = ", LR
print "degrees-of-freedom = ", df
```

```from cogent.maths.stats.special import (lgam, log_one_minus, one_minus_exp,
MACHEP)
from cogent.maths.stats import chisqprob
from cogent.maths.stats.ks import psmirnov2x, pkstwo
from cogent.maths.stats.special import Gamma
```
```    else:
# give chisqprob the kw statistic, degrees of freedom = (num groups - 1)
p_value = chisqprob(H/D, num_groups-1)
return H/D, p_value
## End functions for kruskal_wallis test
```
```    # calculate homogeneity
x_2 = ((ns-3)*(zs-z_bar)**2).sum()
h_val = chisqprob(x_2, len(ns)-1)
return rho, h_val

```

```from qiime.pycogent_backports.test import (cscore)
# cogent imports
from cogent.maths.stats import chisqprob
from cogent.maths.stats.distribution import zprob, tprob

```
```        X2 = 15.26352
pop_r = .547825
hval = chisqprob(X2, len(ns)-1)
obs_p_rho, obs_hval = fisher_population_correlation(rs, ns)
self.assertFloatEqual(obs_p_rho, pop_r)
```

```                                             ndtri)
from cogent.maths.stats.special import log_one_minus, one_minus_exp, MACHEP
from cogent.maths.stats import chisqprob
from cogent.maths.stats.ks import psmirnov2x, pkstwo
from cogent.maths.stats.special import Gamma
```
```        # give chisqprob the kw statistic, degrees of freedom = (num groups -
# 1)
p_value = chisqprob(H / D, num_groups - 1)
return H / D, p_value
# End functions for kruskal_wallis test
```
```    # calculate homogeneity
x_2 = ((ns - 3) * (zs - z_bar) ** 2).sum()
h_val = chisqprob(x_2, len(ns) - 1)
return rho, h_val

```

```from qiime.pycogent_backports.test import (cscore)
# cogent imports
from cogent.maths.stats import chisqprob
from cogent.maths.stats.distribution import zprob, tprob

```
```        X2 = 15.26352
pop_r = .547825
hval = chisqprob(X2, len(ns) - 1)
obs_p_rho, obs_hval = fisher_population_correlation(rs, ns)
self.assertFloatEqual(obs_p_rho, pop_r)
```