statsmodels.multivariate.manova.MANOVA.mv_test

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

线性假设检验

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:
  • (名称, contrast_L)

  • (名称, contrast_L, transform_M)

  • (名称, 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

假设检验的左侧对比矩阵。 如果是二维数组,每一行是一个假设,每一列是一个自变量。至少需要1行(1乘以k_exog,即自变量的数量)。 如果是一个字符串数组,它将被传递给patsy.DesignInfo().linear_constraint。

transform_M2D array or an array of strings or None, optional

左侧变换矩阵。 如果为None或省略,则设置为k_endog x k_endog的单位矩阵(即不对y矩阵进行变换)。 如果是一个字符串数组,它将被传递给patsy.DesignInfo().linear_constraint。

constant_C2D array or None, optional

右侧常数矩阵。 如果为None或省略,则设置为零矩阵 必须与contrast_L具有相同的行数,并与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

如果为真,则跳过对截距的测试,模型不会改变。 注意:如果某个项具有数值上不显著的影响,则可能会因为空数组而引发异常。如果数据已经被去均值化,这种情况可能会发生在截距上。

Returns:
results: MultivariateTestResults

注释

测试线性假设

L * 参数 * M = 0

其中 params 是线性模型 y = x * params 的回归系数矩阵

如果未使用公式接口指定模型,则假设检验将依次对每个包含的外生变量进行。在大多数包含分类变量的应用中,指定模型时应优先使用from_formula接口,因为它在指定假设时提供了关于模型的知识。


Last update: Oct 16, 2024