statsmodels.multivariate.multivariate_ols._MultivariateOLSResults.mv_test

_MultivariateOLSResults.mv_test(hypotheses=None, skip_intercept_test=False)[source]

Linear hypotheses testing

Parameters:
hypotheseslist[tuple]
Hypothesis `L*B*M = C` to be tested where B is the parameters in
regression Y = X*B. Each element is a tuple of length 2, 3, or 4:
  • (name, contrast_L)

  • (name, contrast_L, transform_M)

  • (name, contrast_L, transform_M, constant_C)

containing a string `name`, the contrast matrix L, the transform
matrix M (for transforming dependent variables), and right-hand side
constant matrix constant_C, respectively.
contrast_L2D array or an array of strings

Left-hand side contrast matrix for hypotheses testing. If 2D array, each row is an hypotheses and each column is an independent variable. At least 1 row (1 by k_exog, the number of independent variables) is required. If an array of strings, it will be passed to patsy.DesignInfo().linear_constraint based on exog_names.

transform_M2D array or an array of strings or None, optional

Left hand side transform matrix. If None or left out, it is set to a k_endog by k_endog identity matrix (i.e. do not transform y matrix). If an array of strings, it will be passed to patsy.DesignInfo().linear_constraint based on endog_names.

constant_C2D array or None, optional

Right-hand side constant matrix. if None or left out it is set to a matrix of zeros Must has the same number of rows as contrast_L and the same number of columns as transform_M

If `hypotheses` is None: 1) the effect of each independent variable
on the dependent variables will be tested. Or 2) if model is created
using a formula, `hypotheses` will be created according to
`design_info`. 1) and 2) is equivalent if no additional variables
are created by the formula (e.g. dummy variables for categorical
variables and interaction terms)
skip_intercept_testbool

If true, then testing the intercept is skipped, the model is not changed. Note: If a term has a numerically insignificant effect, then an exception because of emtpy arrays may be raised. This can happen for the intercept if the data has been demeaned.

Returns:
results: _MultivariateOLSResults

Notes

Tests hypotheses of the form

L * params * M = C

where params is the regression coefficient matrix for the linear model y = x * params, L is the contrast matrix, M is the dependent variable transform matrix and C is the constant matrix.


Last update: Dec 23, 2024