matrices.ResponseMatrix

matrices.ResponseMatrix(term)

Response matrix for a model.

Parameters

term : Response

The term that represents the response in the model.

Attributes

design_matrix : np.array

A 2-dimensional numpy array containing the values of the response.

name : str

The name of the response term.

kind : str

The kind of the response. Can be "numeric", "categoric" or "proportion".

Methods

Name Description
as_dataframe Returns self.design_matrix as a pandas.DataFrame.
evaluate Evaluates self.term inside the data mask provided by data and

as_dataframe

matrices.ResponseMatrix.as_dataframe()

Returns self.design_matrix as a pandas.DataFrame.

evaluate

matrices.ResponseMatrix.evaluate(data, env)

Evaluates self.term inside the data mask provided by data and updates self.design_matrix and self.name.

Parameters

data : pandas.DataFrame

The data frame where variables are taken from.

env : Environment

The environment where values and functions are taken from.