将statsmodels.formula.api导入为smf
模型= smf.ols(公式='diff〜lag_1 + lag_2 + lag_3 + lag_4 + lag_5 + lag_6 + lag_7 + lag_8 + lag_9 + lag_10 + lag_11 + lag_12',data = df_supervised,missing ='drop')< / p>
model_fit = model.fit()
regression_adj_rsq = model_fit.rsquared_adj 打印(regression_adj_rsq)