Skip to content

BUG: t-test summary confidence interval range always shows [0.025 0.975] #3116

Closed

Description

@ChadFulton

Regardless of the given alpha, printed confidence interval range in t_test summary is [0.025 0.975], although the actual confidence interval itself does change appropriately.

Given:

np.random.seed(1234)
endog, exog = np.random.normal(size=(2, 100))
res = sm.OLS(endog, exog).fit()
test_res = res.t_test('x1 = 0')

then

print(test_res.summary(alpha=0.05))

produces:

                             Test for Constraints                             
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
c0             0.0822      0.102      0.807      0.421      -0.120       0.284
==============================================================================

but:

print(test_res.summary(alpha=0.482))

produces:

                             Test for Constraints                             
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
c0             0.0822      0.102      0.807      0.421       0.010       0.154
==============================================================================

Activity

  1. ChadFulton commented on Jul 17, 2016

    @ChadFulton
    MemberAuthor

    Presumably in contrast.py:L148 the call to summary_params needs to have the alpha argument:

    summ = summary_params((self, self.effect, self.sd, self.statistic,
                                       pvalues, self.conf_int(alpha)),
                                      yname=yname, xname=xname, use_t=use_t,
                                      title=title)
  2. added this to the 0.8 milestone on Jul 25, 2016
  3. josef-pkt commented on Aug 10, 2016

    @josef-pkt
    Member

    Yes, summary_params and summary_params_frame have an alpha keyword which was left out.

  4. josef-pkt commented on Aug 14, 2016

    @josef-pkt
    Member

    summary_params_frame doesn't use alpha in the column names, name is generic
    'Conf. Int. Low', 'Conf. Int. Upp.'

  5. added a commit that references this issue on Aug 14, 2016
    41580be
  6. added a commit that references this issue on Jan 27, 2017
    6c481f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions