6.8.2.1.9. statsmodels.sandbox.stats.contrast_tools.dummy_product

statsmodels.sandbox.stats.contrast_tools.dummy_product(d1, d2, method='full')[source]

dummy variable from product of two dummy variables

Parameters:

d1, d2 : ndarray

two dummy variables, assumes full set for methods ‘drop-last’ and ‘drop-first’

method : {‘full’, ‘drop-last’, ‘drop-first’}

‘full’ returns the full product, encoding of intersection of categories. The drop methods provide a difference dummy encoding: (constant, main effects, interaction effects). The first or last columns of the dummy variable (i.e. levels) are dropped to get full rank dummy matrix.

Returns:

dummy : ndarray

dummy variable for product, see method