scikits.statsmodels.tools.add_constant

scikits.statsmodels.tools.add_constant(data, prepend=False)

This appends a constant to the design matrix if prepend==False.

It checks to make sure a constant is not already included. If there is at least one column of ones then an array of the original design is returned.

Parameters :

data : array-like

data is the column-ordered design matrix

prepend : bool

True and the constant is prepended rather than appended.

Returns :

data : array

The original design matrix with a constant (column of ones) as the last column.

Previous topic

scikits.statsmodels.tools.unsqueeze

Next topic

scikits.statsmodels.tools.categorical

This Page