

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>statsmodels.regression.recursive_ls.RecursiveLSResults.t_test_pairwise &#8212; statsmodels v0.10.1 documentation</title>
    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity" href="statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity.html" />
    <link rel="prev" title="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test" href="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test.html" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />
<link rel="stylesheet" href="../_static/facebox.css" type="text/css" />
<script type="text/javascript" src="../_static/scripts.js">
</script>
<script type="text/javascript" src="../_static/facebox.js">
</script>
<script type="text/javascript">
$.facebox.settings.closeImage = "../_static/closelabel.png"
$.facebox.settings.loadingImage = "../_static/loading.gif"
</script>

<script>
$(document).ready(function() {
  $.getJSON("../../versions.json", function(versions) {
    var dropdown = document.createElement("div");
    dropdown.className = "dropdown";
    var button = document.createElement("button");
    button.className = "dropbtn";
    button.innerHTML = "Other Versions";
    var content = document.createElement("div");
    content.className = "dropdown-content";
    dropdown.appendChild(button);
    dropdown.appendChild(content);
    $(".header").prepend(dropdown);
    for (var i = 0; i < versions.length; i++) {
      if (versions[i].substring(0, 1) == "v") {
        versions[i] = [versions[i], versions[i].substring(1)];
      } else {
        versions[i] = [versions[i], versions[i]];
      };
    };
    for (var i = 0; i < versions.length; i++) {
      var a = document.createElement("a");
      a.innerHTML = versions[i][1];
      a.href = "../../" + versions[i][0] + "/index.html";
      a.title = versions[i][1];
      $(".dropdown-content").append(a);
    };
  });
});
</script>


  </head><body>
<div class="headerwrap">
    <div class = "header">
        
        <a href = "../index.html">
<img src="../_static/statsmodels_hybi_banner.png" alt="Logo"
    style="padding-left: 15px"/></a>
        
    </div>
</div>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity.html" title="statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test.html" title="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test"
             accesskey="P">previous</a> |</li>
<li><a href ="../install.html">Install</a></li> &nbsp;|&nbsp;
<li><a href="https://groups.google.com/forum/?hl=en#!forum/pystatsmodels">Support</a></li> &nbsp;|&nbsp;
<li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> &nbsp;|&nbsp;
<li><a href="../dev/index.html">Develop</a></li> &nbsp;|&nbsp;
<li><a href="../examples/index.html">Examples</a></li> &nbsp;|&nbsp;
<li><a href="../faq.html">FAQ</a></li> &nbsp;|&nbsp;

          <li class="nav-item nav-item-1"><a href="../regression.html" >Linear Regression</a> |</li>
          <li class="nav-item nav-item-2"><a href="statsmodels.regression.recursive_ls.RecursiveLSResults.html" accesskey="U">statsmodels.regression.recursive_ls.RecursiveLSResults</a> |</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            




  <div class="section" id="statsmodels-regression-recursive-ls-recursivelsresults-t-test-pairwise">
<h1>statsmodels.regression.recursive_ls.RecursiveLSResults.t_test_pairwise<a class="headerlink" href="#statsmodels-regression-recursive-ls-recursivelsresults-t-test-pairwise" title="Permalink to this headline">¶</a></h1>
<p>method</p>
<dl class="method">
<dt id="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test_pairwise">
<code class="sig-prename descclassname">RecursiveLSResults.</code><code class="sig-name descname">t_test_pairwise</code><span class="sig-paren">(</span><em class="sig-param">term_name</em>, <em class="sig-param">method='hs'</em>, <em class="sig-param">alpha=0.05</em>, <em class="sig-param">factor_labels=None</em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.regression.recursive_ls.RecursiveLSResults.t_test_pairwise" title="Permalink to this definition">¶</a></dt>
<dd><p>perform pairwise t_test with multiple testing corrected p-values</p>
<p>This uses the formula design_info encoding contrast matrix and should
work for all encodings of a main effect.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>result</strong><span class="classifier">result instance</span></dt><dd><p>The results of an estimated model with a categorical main effect.</p>
</dd>
<dt><strong>term_name</strong><span class="classifier">str</span></dt><dd><p>name of the term for which pairwise comparisons are computed.
Term names for categorical effects are created by patsy and
correspond to the main part of the exog names.</p>
</dd>
<dt><strong>method</strong><span class="classifier">str or list of strings</span></dt><dd><p>multiple testing p-value correction, default is ‘hs’,
see stats.multipletesting</p>
</dd>
<dt><strong>alpha</strong><span class="classifier">float</span></dt><dd><p>significance level for multiple testing reject decision.</p>
</dd>
<dt><strong>factor_labels</strong><span class="classifier">None, list of str</span></dt><dd><p>Labels for the factor levels used for pairwise labels. If not
provided, then the labels from the formula design_info are used.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>results</strong><span class="classifier">instance of a simple Results class</span></dt><dd><p>The results are stored as attributes, the main attributes are the
following two. Other attributes are added for debugging purposes
or as background information.</p>
<ul class="simple">
<li><p>result_frame : pandas DataFrame with t_test results and multiple
testing corrected p-values.</p></li>
<li><p>contrasts : matrix of constraints of the null hypothesis in the
t_test.</p></li>
</ul>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Status: experimental. Currently only checked for treatment coding with
and without specified reference level.</p>
<p>Currently there are no multiple testing corrected confidence intervals
available.</p>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">res</span> <span class="o">=</span> <span class="n">ols</span><span class="p">(</span><span class="s2">&quot;np.log(Days+1) ~ C(Weight) + C(Duration)&quot;</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pw</span> <span class="o">=</span> <span class="n">res</span><span class="o">.</span><span class="n">t_test_pairwise</span><span class="p">(</span><span class="s2">&quot;C(Weight)&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pw</span><span class="o">.</span><span class="n">result_frame</span>
<span class="go">         coef   std err         t         P&gt;|t|  Conf. Int. Low</span>
<span class="go">2-1  0.632315  0.230003  2.749157  8.028083e-03        0.171563</span>
<span class="go">3-1  1.302555  0.230003  5.663201  5.331513e-07        0.841803</span>
<span class="go">3-2  0.670240  0.230003  2.914044  5.119126e-03        0.209488</span>
<span class="go">     Conf. Int. Upp.  pvalue-hs reject-hs</span>
<span class="go">2-1         1.093067   0.010212      True</span>
<span class="go">3-1         1.763307   0.000002      True</span>
<span class="go">3-2         1.130992   0.010212      True</span>
</pre></div>
</div>
</dd></dl>

</div>





          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="statsmodels.regression.recursive_ls.RecursiveLSResults.t_test.html"
                        title="previous chapter">statsmodels.regression.recursive_ls.RecursiveLSResults.t_test</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity.html"
                        title="next chapter">statsmodels.regression.recursive_ls.RecursiveLSResults.test_heteroskedasticity</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/generated/statsmodels.regression.recursive_ls.RecursiveLSResults.t_test_pairwise.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2009-2018, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.1.2.
    </div>
  </body>
</html>