def test_factor4(self):
    f = (['a', 'b', 'c'] * 10)
    fac = formula.Factor('ff', f)
    fac.namespace = {'ff': f}
    m = fac.main_effect(reference=2)
    m.namespace = fac.namespace
    r = np.array(([np.identity(3)] * 10))
    r.shape = (30, 3)
    r = r.T
    _m = np.array([(r[0] - r[2]), (r[1] - r[2])])
    assert_almost_equal(_m, m())
def test_factor4(self):
    f = (['a', 'b', 'c'] * 10)
    fac = formula.Factor('ff', f)
    fac.namespace = {'ff': f}
    m = fac.main_effect(reference=2)
    m.namespace = fac.namespace
    r = np.array(([np.identity(3)] * 10))
    r.shape = (30, 3)
    r = r.T
    _m = np.array([(r[0] - r[2]), (r[1] - r[2])])
    assert_almost_equal(_m, m())