Did I find the right examples for you? yes no

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

src/n/i/nipy-0.3.0/nipy/algorithms/statistics/tests/test_mixed_effects.py   nipy(Download)
import numpy.random as nr
 
from ..mixed_effects_stat import (
    one_sample_ttest, one_sample_ftest, two_sample_ttest, two_sample_ftest, 
    generate_data, t_stat, mfx_stat)
 
    # compute the test statistics
    t1, = mfx_stat(Y, V1, X, 1,return_t=True, 
                   return_f=False, return_effect=False, 
                   return_var=False)
    assert_true(t1.shape == (n_tests,))
    assert_true(t1.mean() < 5 / np.sqrt(n_tests))
    assert_true((t1.var() < 2) and (t1.var() > .5))
    t2, = mfx_stat(Y, V1, X * np.random.rand(3), 1)
    t2, = mfx_stat(Y, V1, X * np.random.rand(3), 1)
    assert_almost_equal(t1, t2)
    f, = mfx_stat(Y, V1, X, 1, return_t=False, return_f=True)
    assert_almost_equal(t1 ** 2, f)
    v2, = mfx_stat(Y, V1, X, 1, return_t=False, return_var=True)