Report if robust covariance matrix in regression
This commit is contained in:
parent
6206723713
commit
5cd04c3f6c
@ -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_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}
|
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(
|
return RegressionResult(
|
||||||
result,
|
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(),
|
dep, result.nobs, result.df_model, datetime.now(),
|
||||||
terms,
|
terms,
|
||||||
result.llf, llnull,
|
result.llf, llnull,
|
||||||
|
Loading…
Reference in New Issue
Block a user