As I understood, Regression equation can be calculated by this functions:
import statsmodels.formula.api as smf
fg = smf.ols(formula='X ~ Y', data=data).fit()
we can also calculate from numpy polyfit function.
numpy.polyfit(x, y, degree)
as we can change the degree in numpy polyfit.
In ols function we can also add other independent variables as given below:
fg = smf.ols(formula='X ~ Y+Y1+Y2', data=data).fit()
So my question can we change the order/degree of fit in ols function ? or can we add another independent variables in numpy polyfit function?