brainstat.stats.terms.FixedEffect

class brainstat.stats.terms.FixedEffect(x=None, names=None, add_intercept=True, _check_categorical=True)[source]

Bases: object

Build a term object for a linear model.

Parameters
  • x (array-like or DataFrame, optional) – If None, the term is empty. Default is None.

  • names (str or list of str, optional) – Names for each column in x. If None, it defauts to {‘x0’, ‘x1’, …}. Default is None.

  • add_intercept (bool, optional) – If true, adds an intercept term. Defaults to True.

Variables
  • x (DataFrame) – Design matrix.

  • names (list of str) – Names of columns in the design matrix.

See also

MixedEffect

MixedEffect term

Examples

>>> t = FixedEffect()
>>> t.is_empty
True
>>> t1 = FixedEffect(np.arange(5), names='t1')
>>> t2 = FixedEffect(np.random.randn(5, 1), names=['t2'])
>>> t3 = t1 + t2
>>> t3.shape
(5, 3)
__init__(x=None, names=None, add_intercept=True, _check_categorical=True)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([x, names, add_intercept, …])

Initialize self.

Attributes

is_empty

is_scalar

matrix

names

tolerance