statsmodels.stats.multivariate_tools.cc_stats#

statsmodels.stats.multivariate_tools.cc_stats(x1, x2, demean=True, return_object=False)[source]#

MANOVA statistics based on canonical correlation coefficient

Calculates Pillai’s Trace, Wilk’s Lambda, Hotelling’s Trace and Roy’s Largest Root.

Parameters:
x1, x2array_like, 2-D

Two 2-dimensional data arrays, observations in rows, variables in columns.

demeanbool, optional

If demean is true, then the mean is subtracted from each variable.

return_objectbool, optional

If False (default), the results are returned as a dict with the legacy keys used by this function (“canonical correlation coefficient”, “eigenvalues”, “Pillai’s Trace”, “Wilk’s Lambda”, “Hotelling’s Trace”, “Roy’s Largest Root”, “df_resid”, “df_m”). If True, a CCStatsResult instance is returned instead, which exposes the same values as named attributes.

Returns:
dict or CCStatsResult

By default, a dict with the legacy keys described above. If return_object is True, a CCStatsResult with the same values as attributes.

See also

cancorr

Canonical correlation coefficients used by these statistics.

cc_ranktest

Rank tests based on the smallest canonical correlations.

Notes

Same as canon in Stata.

Missing: F-statistics and p-values.

Can produce nans, for example, if x1 and x2 are (numerically) singular or perfectly correlated, in which case a canonical correlation equals one and Hotelling's Trace and the underlying eigenvalues are infinite or not a number.