I am trying to save as PNG File the summary of some regressions that I am doing using the package linearmodels
from linearmodels.iv import IV2SLS
[...]
modelIV =IV2SLS.from_formula(formulaIV,Data).fit(cov_type='unadjusted')
print(modelIV.summary)
I tried to do this, but it is not working:
plt.rc('figure', figsize=(12, 7))
plt.text(0.01, 0.05, str(modelIV.summary()), {'fontsize': 10}, fontproperties = 'monospace')
plt.axis('off')
plt.tight_layout()
plt.savefig('iv_model.png')
Can you help me to figure out what is wrong? Thanks in advance!