我有以下数据和代码:
product_code price quantity year
1 12 4 2015
1 7 3 2016
1 22 1 2016
1 7 12 2017
2 9 23 2015
2 11 33 2016
2 12 21 2015
# import modules
import pandas as pd
from linearmodels import PanelOLS
df = df.set_index(['product_code', 'year'])
mod = PanelOLS.from_formula('quantity ~ price + price:C(product_code)', data=df)
result = mod.fit(cov_type='clustered', cluster_entity=True)
如何格式化回归结果?我知道statsmodel有一些库,但它们与linearmodels不兼容