You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG/REF: Regression Results use_t wrong if cov_type='nonrobust' #5331
I'm not sure anymore about the below.
AFAICS, use_t is still handled through get_robustcov_results if cov_type is not 'nonrobust'
TheilRegressionResults subclasses RegressionResults but RegressionResults but setting use_t is/seems broken.
Use_t support in TheilGLS will be added by #5296, but the current RegressionResults.__init__ doesn't handle this case. This can cause problems for other subclasses and is not TheilGLS specific.
if cov_type == 'nonrobust':
self.cov_type = 'nonrobust'
self.cov_kwds = {
'description': 'Standard Errors assume that the ' +
'covariance matrix of the errors is correctly ' +
'specified.'}
if use_t is None:
self.use_t = True # TODO: class default
else:
if cov_kwds is None:
cov_kwds = {}
if 'use_t' in cov_kwds:
# TODO: we want to get rid of 'use_t' in cov_kwds
use_t_2 = cov_kwds.pop('use_t')
if use_t is None:
use_t = use_t_2
# TODO: warn or not?
self.get_robustcov_results(cov_type=cov_type, use_self=True,
use_t=use_t, **cov_kwds)
I'm not sure what's going on
TheilGLS does not use the cov_type in the RegressionResults instantiation which implies cov_type='nonrobust'
changed the title [-]REF: Regression Results use_t wrong if cov_type='nonrobust'[/-][+]BUG/REF: Regression Results use_t wrong if cov_type='nonrobust'[/+]on Oct 19, 2018
Fixed by commit d6491c3 (same day as filing), which made self.use_t = use_t unconditional in RegressionResults.init (statsmodels/regression/linear_model.py) rather than only inside the "if use_t is None" branch. Closing as fixed.
Activity
josef-pkt commentedon Oct 19, 2018
There is a bug if cov_type='nonrobust', then
self.use_tis never set if use_t is not None:[-]REF: Regression Results use_t wrong if cov_type='nonrobust'[/-][+]BUG/REF: Regression Results use_t wrong if cov_type='nonrobust'[/+]BUG: RegressionResults attach use_t if not None, see statsmodels#5331
BUG: RegressionResults attach use_t if not None, see statsmodels#5331
BUG: RegressionResults attach use_t if not None, see statsmodels#5331
bashtage commentedon Jul 30, 2026
Fixed by commit d6491c3 (same day as filing), which made self.use_t = use_t unconditional in RegressionResults.init (statsmodels/regression/linear_model.py) rather than only inside the "if use_t is None" branch. Closing as fixed.