def f_value_multivariate(ER, EF, dfnum, dfden):
if isinstance(ER, (int, float)):<EOL><INDENT>ER = array([[ER]])<EOL><DEDENT>if isinstance(EF, (int, float)):<EOL><INDENT>EF = array([[EF]])<EOL><DEDENT>n_um = (linalg.det(ER) - linalg.det(EF)) / float(dfnum)<EOL>d_en = linalg.det(EF) / float(dfden)<EOL>return n_um / d_en<EOL>
Returns a multivariate F-statistic.

Parameters
----------
ER : ndarray
    Error associated with the null hypothesis (the Restricted model).
    From a multivariate F calculation.
EF : ndarray
    Error associated with the alternate hypothesis (the Full model)
    From a multivariate F calculation.
dfnum : int
    Degrees of freedom the Restricted model.
dfden : int
    Degrees of freedom associated with the Restricted model.

Returns
-------
fstat : float
    The computed F-statistic.