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
CCStatsResultinstance is returned instead, which exposes the same values as named attributes.
- Returns:
dictorCCStatsResultBy default, a dict with the legacy keys described above. If
return_objectis True, aCCStatsResultwith the same values as attributes.
See also
cancorrCanonical correlation coefficients used by these statistics.
cc_ranktestRank 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 Traceand the underlyingeigenvaluesare infinite or not a number.