# Anyone know Multivariate OLS on Statsmodels? [closed]

I trying to run a mutivariate multiple regression using Statsmodels. Not sure if this is the best tool for this type of regression, so please do tell me if there's another package to which I should belooking. Below is a toy replication of the process (run in Colab).

import statsmodels.api as sm
import pandas as pd

sampleY = {'Maths': [90, 80, 70, 60, 50, 40, 30, 20], 'English': [77, 66, 55, 44, 33, 66, 44, 11]}
sampleX = {'Work': [76, 75, 72, 66, 66, 63, 62, 61] ,'Brains': [33, 66, 22, 44, 11, 66, 55, 11]}

Y = pd.DataFrame(sampleY,columns= ['Maths', 'English'])
X = pd.DataFrame(sampleX,columns= ['Work', 'Brains'])

linear_regression = sm._MultivariateOLS(Y,Xc)
#linear_regression = sm.OLS(Y,Xc) - this one works, but of course only with a single DV, i.e. Y = pd.DataFrame(sampleY,columns= ['Maths'])
fitted_model = linear_regression.fit()

fitted_model.summary()


However which way I try to ensure that statsmodels is fully loaded - git clone, importing the one module specifically, etc. I get

AttributeError: module 'statsmodels.api' has no attribute '_MultivariateOLS'

If I run an OLS (i.e. multiple regression, not multivariate), instead, all works fine. Stumped.

• You are not doing something wrong, just what you look for is not there. Please see my answer for a few more details. – usεr11852 Aug 16 '19 at 9:25

At the time of writing this (Aug-2019) there is no MultivariateOLS in actual terms. That's why the _ infront of the call; it signifies that it is mostly a placeholder and should not be directly called by a user. Right now, only MultivariateTestResults is operational as it acts as the back-end for MANOVA.