6.8.2.2.1. statsmodels.sandbox.stats.contrast_tools.DummyTransform

class statsmodels.sandbox.stats.contrast_tools.DummyTransform(d1, d2)[source]

Conversion between full rank dummy encodings

y = X b + u b = C a a = C^{-1} b

y = X C a + u

define Z = X C, then

y = Z a + u

contrasts:

R_b b = r

R_a a = R_b C a = r

where R_a = R_b C

Here C is the transform matrix, with dot_left and dot_right as the main methods, and the same for the inverse transform matrix, C^{-1}

Note:
  • The class was mainly written to keep left and right straight.
  • No checking is done.
  • not sure yet if method names make sense

C such that d1 C = d2, with d1 = X, d2 = Z

should be (x, z) in arguments ?

__init__(d1, d2)[source]

C such that d1 C = d2, with d1 = X, d2 = Z

should be (x, z) in arguments ?

6.8.2.2.1.1. Methods

__init__(d1, d2) C such that d1 C = d2, with d1 = X, d2 = Z
dot_left(a) b = C a
dot_right(x) z = x C
inv_dot_left(b) a = C^{-1} b
inv_dot_right(z) x = z C^{-1}