### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Internal Classes »
- scikits.statsmodels.model.LikelihoodModelResults »

# scikits.statsmodels.model.LikelihoodModelResults.t_test

`LikelihoodModelResults.``t_test`(r_matrix, scale=None)

  Compute a tcontrast/t-test for a row vector array.

  Parameters: | r_matrix : array-like A length p row vector specifying the linear restrictions. scale : float, optional An optional scale to use. Default is the scale specified by the model fit. scale : scalar

  See also

  `t`
    method to get simpler t values
  `f_test`
    for f tests

  Examples

      >>> import numpy as np
      >>> import scikits.statsmodels as sm
      >>> data = sm.datasets.longley.Load()
      >>> data.exog = sm.add_constant(data.exog)
      >>> results = sm.OLS(data.endog, data.exog).fit()
      >>> r = np.zeros_like(results.params)
      >>> r[4:6] = [1,-1]
      >>> print r
      [ 0.  0.  0.  0.  1. -1.  0.]

  r tests that the coefficients on the 5th and 6th independent variable are the same.

  >>>T_Test = results.t_test(r) >>>print T_test <T contrast: effect=-1829.2025687192481, sd=455.39079425193762, t=-4.0167754636411717, p=0.0015163772380899498, df_denom=9> >>> T_test.effect -1829.2025687192481 >>> T_test.sd 455.39079425193762 >>> T_test.t -4.0167754636411717 >>> T_test.p 0.0015163772380899498

### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Internal Classes »
- scikits.statsmodels.model.LikelihoodModelResults »