From 5cd04c3f6c5dff7c7f68e9ffbb5900c18cb68b5d Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 16 Oct 2022 02:31:23 +1100 Subject: [PATCH] Report if robust covariance matrix in regression --- yli/regress.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/yli/regress.py b/yli/regress.py index 75f8abd..eeb7cc6 100644 --- a/yli/regress.py +++ b/yli/regress.py @@ -444,9 +444,17 @@ def regress( header_entries = np.vectorize(str.strip)(np.concatenate(np.split(np.array(result.summary().tables[0].data), 2, axis=1))) header_dict = {x[0]: x[1] for x in header_entries} + # Get full name to display + if model_class is sm.Logit: + full_name = 'Logistic Regression' + else: + full_name = '{} Regression'.format(model_class.__name__) + if fit_kwargs.get('cov_type', 'nonrobust') != 'nonrobust': + full_name = 'Robust {}'.format(full_name) + return RegressionResult( result, - 'Logistic Regression' if model_class is sm.Logit else '{} Regression'.format(model_class.__name__), model_class.__name__, header_dict['Method:'], + full_name, model_class.__name__, header_dict['Method:'], dep, result.nobs, result.df_model, datetime.now(), terms, result.llf, llnull,