import statsmodels.formula.api as sm code example Example: import statsmodels.api as sm import statsmodels.api as sm model = OLS(X,y)