Closed mwood7 closed 3 years ago
Hey I found a workaround, so you can close and are welcome to include it in your documentation if that would be useful.
You can put the OLSResults object into the Wrapper object via (first 2 lines included for completeness - last 2 lines are the workaround):
mod1 = smf.ols('food_exp ~ income',data=food).fit()
mod2 = mod1.get_robustcov_results(cov_type='HC1')
import statsmodels.regression.linear_model as lm
mod2a = lm.RegressionResultsWrapper(mod2)
This then works with 'pystout(models=[mod1,mod2a], ...'
Cheers, Matt
Hey Matt,
Thanks for this! I am glad the solution worked. For full disclosure, I haven't had the time to update this in some while. I hope to expand it at some point in the near future though and make it more flexible. I will add this to the documentation next time I roll out an update.
Best, Lucas
I love the tables this produces, but have run into a problem today. I'm needing to use the method '.get_robustcov_results()' and it evidently returns 'OLSResults object' whereas OLS returns 'RegressionResultsWrapper' object.
In the Wrapper object, 'params' is a Series object, whereas in the OLSResults object, params is a NumPy array. Pystout crashes on line 324 (my version may be old)
So this isn't a problem with pystout at all, and if you want to just close it for that reason, I understand. If you know how to put a OLSResults object into a RegressionResultsWrapper, I'd be grateful (my limited searching hasn't turned up an answer). Thank you again for pystout - it's very useful.
Full example if you'd like to try it out: