I am trying to extract the within-group variance-covariance matrix to estimate the flatness in a MANOVA model in statsmodels using the following formula:
I've been reading through the statsmodels user guide, but haven't come across it. What I have managed so far is this:
resid = manova.mv_test().results['x1']['E']
n * (xbar_tot).T @ np.linalg.solve(?, resid) @ xbar_tot
In R, the same can be accomplished by calling:
n * t(xbar.tot) %*% solve(summary(mod, test="Wilks")$SS$Residuals) %*% xbar.tot
What I am missing is the first part of the inverse, the where I have the ?
in the code.