| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>TTest (Apache Commons Math 3.3 API)</title> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="TTest (Apache Commons Math 3.3 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/TTest.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../../org/apache/commons/math3/stat/inference/TestUtils.html" title="class in org.apache.commons.math3.stat.inference"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../../org/apache/commons/math3/stat/inference/WilcoxonSignedRankTest.html" title="class in org.apache.commons.math3.stat.inference"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/commons/math3/stat/inference/TTest.html" target="_top">Frames</a></li> |
| <li><a href="TTest.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.commons.math3.stat.inference</div> |
| <h2 title="Class TTest" class="title">Class TTest</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.commons.math3.stat.inference.TTest</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public class <span class="strong">TTest</span> |
| extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">An implementation for Student's t-tests. |
| <p> |
| Tests can be:<ul> |
| <li>One-sample or two-sample</li> |
| <li>One-sided or two-sided</li> |
| <li>Paired or unpaired (for two-sample tests)</li> |
| <li>Homoscedastic (equal variance assumption) or heteroscedastic |
| (for two sample tests)</li> |
| <li>Fixed significance level (boolean-valued) or returning p-values. |
| </li></ul></p> |
| <p> |
| Test statistics are available for all tests. Methods including "Test" in |
| in their names perform tests, all other methods return t-statistics. Among |
| the "Test" methods, <code>double-</code>valued methods return p-values; |
| <code>boolean-</code>valued methods perform fixed significance level tests. |
| Significance levels are always specified as numbers between 0 and 0.5 |
| (e.g. tests at the 95% level use <code>alpha=0.05</code>).</p> |
| <p> |
| Input to tests can be either <code>double[]</code> arrays or |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive"><code>StatisticalSummary</code></a> instances.</p><p> |
| Uses commons-math <a href="../../../../../../org/apache/commons/math3/distribution/TDistribution.html" title="class in org.apache.commons.math3.distribution"><code>TDistribution</code></a> |
| implementation to estimate exact p-values.</p></div> |
| <dl><dt><span class="strong">Version:</span></dt> |
| <dd>$Id: TTest.java 1416643 2012-12-03 19:37:14Z tn $</dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#TTest()">TTest</a></strong>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#df(double, double, double, double)">df</a></strong>(double v1, |
| double v2, |
| double n1, |
| double n2)</code> |
| <div class="block">Computes approximate degrees of freedom for 2-sample t-test.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(double[], double[])">homoscedasticT</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Computes a 2-sample t statistic, under the hypothesis of equal |
| subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(double, double, double, double, double, double)">homoscedasticT</a></strong>(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</code> |
| <div class="block">Computes t test statistic for 2-sample t-test under the hypothesis |
| of equal subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">homoscedasticT</a></strong>(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2)</code> |
| <div class="block">Computes a 2-sample t statistic, comparing the means of the datasets |
| described by two <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive"><code>StatisticalSummary</code></a> instances, under the |
| assumption of equal subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(double[], double[])">homoscedasticTTest</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the input arrays, under the assumption that |
| the two samples are drawn from subpopulations with equal variances.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(double[], double[], double)">homoscedasticTTest</a></strong>(double[] sample1, |
| double[] sample2, |
| double alpha)</code> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that <code>sample1</code> |
| and <code>sample2</code> are drawn from populations with the same mean, |
| with significance level <code>alpha</code>, assuming that the |
| subpopulation variances are equal.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(double, double, double, double, double, double)">homoscedasticTTest</a></strong>(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</code> |
| <div class="block">Computes p-value for 2-sided, 2-sample t-test, under the assumption |
| of equal subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">homoscedasticTTest</a></strong>(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the datasets described by two StatisticalSummary |
| instances, under the hypothesis of equal subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#pairedT(double[], double[])">pairedT</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Computes a paired, 2-sample t-statistic based on the data in the input |
| arrays.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#pairedTTest(double[], double[])">pairedTTest</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i> p-value</i>, associated with a paired, two-sample, two-tailed t-test |
| based on the data in the input arrays.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#pairedTTest(double[], double[], double)">pairedTTest</a></strong>(double[] sample1, |
| double[] sample2, |
| double alpha)</code> |
| <div class="block">Performs a paired t-test evaluating the null hypothesis that the |
| mean of the paired differences between <code>sample1</code> and |
| <code>sample2</code> is 0 in favor of the two-sided alternative that the |
| mean paired difference is not equal to 0, with significance level |
| <code>alpha</code>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])">t</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Computes a 2-sample t statistic, without the hypothesis of equal |
| subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double, double[])">t</a></strong>(double mu, |
| double[] observed)</code> |
| <div class="block">Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula"> |
| t statistic </a> given observed values and a comparison constant.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double, double, double, double)">t</a></strong>(double m, |
| double mu, |
| double v, |
| double n)</code> |
| <div class="block">Computes t test statistic for 1-sample t-test.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double, double, double, double, double, double)">t</a></strong>(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</code> |
| <div class="block">Computes t test statistic for 2-sample t-test.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">t</a></strong>(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats)</code> |
| <div class="block">Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula"> |
| t statistic </a> to use in comparing the mean of the dataset described by |
| <code>sampleStats</code> to <code>mu</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">t</a></strong>(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2)</code> |
| <div class="block">Computes a 2-sample t statistic </a>, comparing the means of the datasets |
| described by two <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive"><code>StatisticalSummary</code></a> instances, without the |
| assumption of equal subpopulation variances.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double[], double[])">tTest</a></strong>(double[] sample1, |
| double[] sample2)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the input arrays.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double[], double[], double)">tTest</a></strong>(double[] sample1, |
| double[] sample2, |
| double alpha)</code> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that <code>sample1</code> |
| and <code>sample2</code> are drawn from populations with the same mean, |
| with significance level <code>alpha</code>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, double[])">tTest</a></strong>(double mu, |
| double[] sample)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a one-sample, two-tailed t-test |
| comparing the mean of the input array with the constant <code>mu</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, double[], double)">tTest</a></strong>(double mu, |
| double[] sample, |
| double alpha)</code> |
| <div class="block">Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that the mean of the population from |
| which <code>sample</code> is drawn equals <code>mu</code>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, double, double, double)">tTest</a></strong>(double m, |
| double mu, |
| double v, |
| double n)</code> |
| <div class="block">Computes p-value for 2-sided, 1-sample t-test.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, double, double, double, double, double)">tTest</a></strong>(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</code> |
| <div class="block">Computes p-value for 2-sided, 2-sample t-test.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">tTest</a></strong>(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a one-sample, two-tailed t-test |
| comparing the mean of the dataset described by <code>sampleStats</code> |
| with the constant <code>mu</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary, double)">tTest</a></strong>(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats, |
| double alpha)</code> |
| <div class="block">Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that the mean of the |
| population from which the dataset described by <code>stats</code> is |
| drawn equals <code>mu</code>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)">tTest</a></strong>(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2)</code> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the datasets described by two StatisticalSummary |
| instances.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary, double)">tTest</a></strong>(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2, |
| double alpha)</code> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that |
| <code>sampleStats1</code> and <code>sampleStats2</code> describe |
| datasets drawn from populations with the same mean, with significance |
| level <code>alpha</code>.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="TTest()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>TTest</h4> |
| <pre>public TTest()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="pairedT(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>pairedT</h4> |
| <pre>public double pairedT(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a paired, 2-sample t-statistic based on the data in the input |
| arrays. The t-statistic returned is equivalent to what would be returned by |
| computing the one-sample t-statistic <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double, double[])"><code>t(double, double[])</code></a>, with |
| <code>mu = 0</code> and the sample array consisting of the (signed) |
| differences between corresponding entries in <code>sample1</code> and |
| <code>sample2.</code> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The input arrays must have the same length and their common length |
| must be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a></code> - if the arrays are empty</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a></code> - if the length of the arrays is not equal</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="pairedTTest(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>pairedTTest</h4> |
| <pre>public double pairedTTest(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i> p-value</i>, associated with a paired, two-sample, two-tailed t-test |
| based on the data in the input arrays. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the mean of the paired |
| differences is 0 in favor of the two-sided alternative that the mean paired |
| difference is not equal to 0. For a one-sided test, divide the returned |
| value by 2.</p> |
| <p> |
| This test is equivalent to a one-sample t-test computed using |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double, double[])"><code>tTest(double, double[])</code></a> with <code>mu = 0</code> and the sample |
| array consisting of the signed differences between corresponding elements of |
| <code>sample1</code> and <code>sample2.</code></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the p-value depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The input array lengths must be the same and their common length must |
| be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value for t-test</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a></code> - if the arrays are empty</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a></code> - if the length of the arrays is not equal</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="pairedTTest(double[], double[], double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>pairedTTest</h4> |
| <pre>public boolean pairedTTest(double[] sample1, |
| double[] sample2, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a paired t-test evaluating the null hypothesis that the |
| mean of the paired differences between <code>sample1</code> and |
| <code>sample2</code> is 0 in favor of the two-sided alternative that the |
| mean paired difference is not equal to 0, with significance level |
| <code>alpha</code>. |
| <p> |
| Returns <code>true</code> iff the null hypothesis can be rejected with |
| confidence <code>1 - alpha</code>. To perform a 1-sided test, use |
| <code>alpha * 2</code></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The input array lengths must be the same and their common length |
| must be at least 2. |
| </li> |
| <li> <code> 0 < alpha < 0.5 </code> |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if the null hypothesis can be rejected with |
| confidence 1 - alpha</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoDataException.html" title="class in org.apache.commons.math3.exception">NoDataException</a></code> - if the arrays are empty</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a></code> - if the length of the arrays is not equal</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="t(double, double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>public double t(double mu, |
| double[] observed) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula"> |
| t statistic </a> given observed values and a comparison constant. |
| <p> |
| This statistic can be used to perform a one sample t-test for the mean. |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array length must be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - comparison constant</dd><dd><code>observed</code> - array of values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>observed</code> is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of <code>observed</code> is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="t(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>public double t(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula"> |
| t statistic </a> to use in comparing the mean of the dataset described by |
| <code>sampleStats</code> to <code>mu</code>. |
| <p> |
| This statistic can be used to perform a one sample t-test for the mean. |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li><code>observed.getN() ≥ 2</code>. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - comparison constant</dd><dd><code>sampleStats</code> - DescriptiveStatistics holding sample summary statitstics</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>sampleStats</code> is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticT(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticT</h4> |
| <pre>public double homoscedasticT(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a 2-sample t statistic, under the hypothesis of equal |
| subpopulation variances. To compute a t-statistic without the |
| equal variances hypothesis, use <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])"><code>t(double[], double[])</code></a>. |
| <p> |
| This statistic can be used to perform a (homoscedastic) two-sample |
| t-test to compare sample means.</p> |
| <p> |
| The t-statistic is</p> |
| <p> |
| <code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code> |
| </p><p> |
| where <strong><code>n1</code></strong> is the size of first sample; |
| <strong><code> n2</code></strong> is the size of second sample; |
| <strong><code> m1</code></strong> is the mean of first sample; |
| <strong><code> m2</code></strong> is the mean of second sample</li> |
| </ul> |
| and <strong><code>var</code></strong> is the pooled variance estimate: |
| </p><p> |
| <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code> |
| </p><p> |
| with <strong><code>var1</code></strong> the variance of the first sample and |
| <strong><code>var2</code></strong> the variance of the second sample. |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="t(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>public double t(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a 2-sample t statistic, without the hypothesis of equal |
| subpopulation variances. To compute a t-statistic assuming equal |
| variances, use <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(double[], double[])"><code>homoscedasticT(double[], double[])</code></a>. |
| <p> |
| This statistic can be used to perform a two-sample t-test to compare |
| sample means.</p> |
| <p> |
| The t-statistic is</p> |
| <p> |
| <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code> |
| </p><p> |
| where <strong><code>n1</code></strong> is the size of the first sample |
| <strong><code> n2</code></strong> is the size of the second sample; |
| <strong><code> m1</code></strong> is the mean of the first sample; |
| <strong><code> m2</code></strong> is the mean of the second sample; |
| <strong><code> var1</code></strong> is the variance of the first sample; |
| <strong><code> var2</code></strong> is the variance of the second sample; |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="t(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>public double t(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a 2-sample t statistic </a>, comparing the means of the datasets |
| described by two <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive"><code>StatisticalSummary</code></a> instances, without the |
| assumption of equal subpopulation variances. Use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"><code>homoscedasticT(StatisticalSummary, StatisticalSummary)</code></a> to |
| compute a t-statistic under the equal variances assumption. |
| <p> |
| This statistic can be used to perform a two-sample t-test to compare |
| sample means.</p> |
| <p> |
| The returned t-statistic is</p> |
| <p> |
| <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code> |
| </p><p> |
| where <strong><code>n1</code></strong> is the size of the first sample; |
| <strong><code> n2</code></strong> is the size of the second sample; |
| <strong><code> m1</code></strong> is the mean of the first sample; |
| <strong><code> m2</code></strong> is the mean of the second sample |
| <strong><code> var1</code></strong> is the variance of the first sample; |
| <strong><code> var2</code></strong> is the variance of the second sample |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The datasets described by the two Univariates must each contain |
| at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sampleStats1</code> - StatisticalSummary describing data from the first sample</dd><dd><code>sampleStats2</code> - StatisticalSummary describing data from the second sample</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample statistics are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticT(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticT</h4> |
| <pre>public double homoscedasticT(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></pre> |
| <div class="block">Computes a 2-sample t statistic, comparing the means of the datasets |
| described by two <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive"><code>StatisticalSummary</code></a> instances, under the |
| assumption of equal subpopulation variances. To compute a t-statistic |
| without the equal variances assumption, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"><code>t(StatisticalSummary, StatisticalSummary)</code></a>. |
| <p> |
| This statistic can be used to perform a (homoscedastic) two-sample |
| t-test to compare sample means.</p> |
| <p> |
| The t-statistic returned is</p> |
| <p> |
| <code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code> |
| </p><p> |
| where <strong><code>n1</code></strong> is the size of first sample; |
| <strong><code> n2</code></strong> is the size of second sample; |
| <strong><code> m1</code></strong> is the mean of first sample; |
| <strong><code> m2</code></strong> is the mean of second sample |
| and <strong><code>var</code></strong> is the pooled variance estimate: |
| </p><p> |
| <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code> |
| </p><p> |
| with <strong><code>var1</code></strong> the variance of the first sample and |
| <strong><code>var2</code></strong> the variance of the second sample. |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The datasets described by the two Univariates must each contain |
| at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sampleStats1</code> - StatisticalSummary describing data from the first sample</dd><dd><code>sampleStats2</code> - StatisticalSummary describing data from the second sample</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t statistic</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample statistics are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public double tTest(double mu, |
| double[] sample) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a one-sample, two-tailed t-test |
| comparing the mean of the input array with the constant <code>mu</code>. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the mean equals |
| <code>mu</code> in favor of the two-sided alternative that the mean |
| is different from <code>mu</code>. For a one-sided test, divide the |
| returned value by 2.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a> |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array length must be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - constant value to compare sample mean against</dd><dd><code>sample</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample array is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the array is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, double[], double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public boolean tTest(double mu, |
| double[] sample, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that the mean of the population from |
| which <code>sample</code> is drawn equals <code>mu</code>. |
| <p> |
| Returns <code>true</code> iff the null hypothesis can be |
| rejected with confidence <code>1 - alpha</code>. To |
| perform a 1-sided test, use <code>alpha * 2</code></p> |
| <p> |
| <strong>Examples:</strong><br><ol> |
| <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at |
| the 95% level, use <br><code>tTest(mu, sample, 0.05) </code> |
| </li> |
| <li>To test the (one-sided) hypothesis <code> sample mean < mu </code> |
| at the 99% level, first verify that the measured sample mean is less |
| than <code>mu</code> and then use |
| <br><code>tTest(mu, sample, 0.02) </code> |
| </li></ol></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the one-sample |
| parametric t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a> |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array length must be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - constant value to compare sample mean against</dd><dd><code>sample</code> - array of sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample array is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the array is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public double tTest(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a one-sample, two-tailed t-test |
| comparing the mean of the dataset described by <code>sampleStats</code> |
| with the constant <code>mu</code>. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the mean equals |
| <code>mu</code> in favor of the two-sided alternative that the mean |
| is different from <code>mu</code>. For a one-sided test, divide the |
| returned value by 2.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The sample must contain at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - constant value to compare sample mean against</dd><dd><code>sampleStats</code> - StatisticalSummary describing sample data</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>sampleStats</code> is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, org.apache.commons.math3.stat.descriptive.StatisticalSummary, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public boolean tTest(double mu, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that the mean of the |
| population from which the dataset described by <code>stats</code> is |
| drawn equals <code>mu</code>. |
| <p> |
| Returns <code>true</code> iff the null hypothesis can be rejected with |
| confidence <code>1 - alpha</code>. To perform a 1-sided test, use |
| <code>alpha * 2.</code></p> |
| <p> |
| <strong>Examples:</strong><br><ol> |
| <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at |
| the 95% level, use <br><code>tTest(mu, sampleStats, 0.05) </code> |
| </li> |
| <li>To test the (one-sided) hypothesis <code> sample mean < mu </code> |
| at the 99% level, first verify that the measured sample mean is less |
| than <code>mu</code> and then use |
| <br><code>tTest(mu, sampleStats, 0.02) </code> |
| </li></ol></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the one-sample |
| parametric t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a> |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The sample must include at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mu</code> - constant value to compare sample mean against</dd><dd><code>sampleStats</code> - StatisticalSummary describing sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>sampleStats</code> is <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public double tTest(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the input arrays. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the two means are |
| equal in favor of the two-sided alternative that they are different. |
| For a one-sided test, divide the returned value by 2.</p> |
| <p> |
| The test does not assume that the underlying popuation variances are |
| equal and it uses approximated degrees of freedom computed from the |
| sample data to compute the p-value. The t-statistic used is as defined in |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])"><code>t(double[], double[])</code></a> and the Welch-Satterthwaite approximation |
| to the degrees of freedom is used, |
| as described |
| <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm"> |
| here.</a> To perform the test under the assumption of equal subpopulation |
| variances, use <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(double[], double[])"><code>homoscedasticTTest(double[], double[])</code></a>.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the p-value depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value for t-test</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticTTest(double[], double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticTTest</h4> |
| <pre>public double homoscedasticTTest(double[] sample1, |
| double[] sample2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the input arrays, under the assumption that |
| the two samples are drawn from subpopulations with equal variances. |
| To perform the test without the equal variances assumption, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double[], double[])"><code>tTest(double[], double[])</code></a>.</p> |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the two means are |
| equal in favor of the two-sided alternative that they are different. |
| For a one-sided test, divide the returned value by 2.</p> |
| <p> |
| A pooled variance estimate is used to compute the t-statistic. See |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(double[], double[])"><code>homoscedasticT(double[], double[])</code></a>. The sum of the sample sizes |
| minus 2 is used as the degrees of freedom.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the p-value depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value for t-test</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double[], double[], double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public boolean tTest(double[] sample1, |
| double[] sample2, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that <code>sample1</code> |
| and <code>sample2</code> are drawn from populations with the same mean, |
| with significance level <code>alpha</code>. This test does not assume |
| that the subpopulation variances are equal. To perform the test assuming |
| equal variances, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(double[], double[], double)"><code>homoscedasticTTest(double[], double[], double)</code></a>. |
| <p> |
| Returns <code>true</code> iff the null hypothesis that the means are |
| equal can be rejected with confidence <code>1 - alpha</code>. To |
| perform a 1-sided test, use <code>alpha * 2</code></p> |
| <p> |
| See <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])"><code>t(double[], double[])</code></a> for the formula used to compute the |
| t-statistic. Degrees of freedom are approximated using the |
| <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm"> |
| Welch-Satterthwaite approximation.</a></p> |
| <p> |
| <strong>Examples:</strong><br><ol> |
| <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at |
| the 95% level, use |
| <br><code>tTest(sample1, sample2, 0.05). </code> |
| </li> |
| <li>To test the (one-sided) hypothesis <code> mean 1 < mean 2 </code>, |
| at the 99% level, first verify that the measured mean of <code>sample 1</code> |
| is less than the mean of <code>sample 2</code> and then use |
| <br><code>tTest(sample1, sample2, 0.02) </code> |
| </li></ol></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li> |
| <li> <code> 0 < alpha < 0.5 </code> |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if the null hypothesis can be rejected with |
| confidence 1 - alpha</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticTTest(double[], double[], double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticTTest</h4> |
| <pre>public boolean homoscedasticTTest(double[] sample1, |
| double[] sample2, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that <code>sample1</code> |
| and <code>sample2</code> are drawn from populations with the same mean, |
| with significance level <code>alpha</code>, assuming that the |
| subpopulation variances are equal. Use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double[], double[], double)"><code>tTest(double[], double[], double)</code></a> to perform the test without |
| the assumption of equal variances. |
| <p> |
| Returns <code>true</code> iff the null hypothesis that the means are |
| equal can be rejected with confidence <code>1 - alpha</code>. To |
| perform a 1-sided test, use <code>alpha * 2.</code> To perform the test |
| without the assumption of equal subpopulation variances, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(double[], double[], double)"><code>tTest(double[], double[], double)</code></a>.</p> |
| <p> |
| A pooled variance estimate is used to compute the t-statistic. See |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])"><code>t(double[], double[])</code></a> for the formula. The sum of the sample |
| sizes minus 2 is used as the degrees of freedom.</p> |
| <p> |
| <strong>Examples:</strong><br><ol> |
| <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at |
| the 95% level, use <br><code>tTest(sample1, sample2, 0.05). </code> |
| </li> |
| <li>To test the (one-sided) hypothesis <code> mean 1 < mean 2, </code> |
| at the 99% level, first verify that the measured mean of |
| <code>sample 1</code> is less than the mean of <code>sample 2</code> |
| and then use |
| <br><code>tTest(sample1, sample2, 0.02) </code> |
| </li></ol></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The observed array lengths must both be at least 2. |
| </li> |
| <li> <code> 0 < alpha < 0.5 </code> |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sample1</code> - array of sample data values</dd><dd><code>sample2</code> - array of sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if the null hypothesis can be rejected with |
| confidence 1 - alpha</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the arrays are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the length of the arrays is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public double tTest(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the datasets described by two StatisticalSummary |
| instances. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the two means are |
| equal in favor of the two-sided alternative that they are different. |
| For a one-sided test, divide the returned value by 2.</p> |
| <p> |
| The test does not assume that the underlying population variances are |
| equal and it uses approximated degrees of freedom computed from the |
| sample data to compute the p-value. To perform the test assuming |
| equal variances, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"><code>homoscedasticTTest(StatisticalSummary, StatisticalSummary)</code></a>.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the p-value depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The datasets described by the two Univariates must each contain |
| at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sampleStats1</code> - StatisticalSummary describing data from the first sample</dd><dd><code>sampleStats2</code> - StatisticalSummary describing data from the second sample</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value for t-test</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample statistics are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticTTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticTTest</h4> |
| <pre>public double homoscedasticTTest(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Returns the <i>observed significance level</i>, or |
| <i>p-value</i>, associated with a two-sample, two-tailed t-test |
| comparing the means of the datasets described by two StatisticalSummary |
| instances, under the hypothesis of equal subpopulation variances. To |
| perform a test without the equal variances assumption, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#tTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"><code>tTest(StatisticalSummary, StatisticalSummary)</code></a>. |
| <p> |
| The number returned is the smallest significance level |
| at which one can reject the null hypothesis that the two means are |
| equal in favor of the two-sided alternative that they are different. |
| For a one-sided test, divide the returned value by 2.</p> |
| <p> |
| See <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticT(double[], double[])"><code>homoscedasticT(double[], double[])</code></a> for the formula used to |
| compute the t-statistic. The sum of the sample sizes minus 2 is used as |
| the degrees of freedom.</p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the p-value depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a> |
| </p><p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The datasets described by the two Univariates must each contain |
| at least 2 observations. |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sampleStats1</code> - StatisticalSummary describing data from the first sample</dd><dd><code>sampleStats2</code> - StatisticalSummary describing data from the second sample</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value for t-test</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample statistics are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>public boolean tTest(<a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats1, |
| <a href="../../../../../../org/apache/commons/math3/stat/descriptive/StatisticalSummary.html" title="interface in org.apache.commons.math3.stat.descriptive">StatisticalSummary</a> sampleStats2, |
| double alpha) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></pre> |
| <div class="block">Performs a |
| <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm"> |
| two-sided t-test</a> evaluating the null hypothesis that |
| <code>sampleStats1</code> and <code>sampleStats2</code> describe |
| datasets drawn from populations with the same mean, with significance |
| level <code>alpha</code>. This test does not assume that the |
| subpopulation variances are equal. To perform the test under the equal |
| variances assumption, use |
| <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#homoscedasticTTest(org.apache.commons.math3.stat.descriptive.StatisticalSummary, org.apache.commons.math3.stat.descriptive.StatisticalSummary)"><code>homoscedasticTTest(StatisticalSummary, StatisticalSummary)</code></a>. |
| <p> |
| Returns <code>true</code> iff the null hypothesis that the means are |
| equal can be rejected with confidence <code>1 - alpha</code>. To |
| perform a 1-sided test, use <code>alpha * 2</code></p> |
| <p> |
| See <a href="../../../../../../org/apache/commons/math3/stat/inference/TTest.html#t(double[], double[])"><code>t(double[], double[])</code></a> for the formula used to compute the |
| t-statistic. Degrees of freedom are approximated using the |
| <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm"> |
| Welch-Satterthwaite approximation.</a></p> |
| <p> |
| <strong>Examples:</strong><br><ol> |
| <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at |
| the 95%, use |
| <br><code>tTest(sampleStats1, sampleStats2, 0.05) </code> |
| </li> |
| <li>To test the (one-sided) hypothesis <code> mean 1 < mean 2 </code> |
| at the 99% level, first verify that the measured mean of |
| <code>sample 1</code> is less than the mean of <code>sample 2</code> |
| and then use |
| <br><code>tTest(sampleStats1, sampleStats2, 0.02) </code> |
| </li></ol></p> |
| <p> |
| <strong>Usage Note:</strong><br> |
| The validity of the test depends on the assumptions of the parametric |
| t-test procedure, as discussed |
| <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> |
| here</a></p> |
| <p> |
| <strong>Preconditions</strong>: <ul> |
| <li>The datasets described by the two Univariates must each contain |
| at least 2 observations. |
| </li> |
| <li> <code> 0 < alpha < 0.5 </code> |
| </li></ul></p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>sampleStats1</code> - StatisticalSummary describing sample data values</dd><dd><code>sampleStats2</code> - StatisticalSummary describing sample data values</dd><dd><code>alpha</code> - significance level of the test</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if the null hypothesis can be rejected with |
| confidence 1 - alpha</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if the sample statistics are <code>null</code></dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooSmallException.html" title="class in org.apache.commons.math3.exception">NumberIsTooSmallException</a></code> - if the number of samples is < 2</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if <code>alpha</code> is not in the range (0, 0.5]</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd></dl> |
| </li> |
| </ul> |
| <a name="df(double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>df</h4> |
| <pre>protected double df(double v1, |
| double v2, |
| double n1, |
| double n2)</pre> |
| <div class="block">Computes approximate degrees of freedom for 2-sample t-test.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v1</code> - first sample variance</dd><dd><code>v2</code> - second sample variance</dd><dd><code>n1</code> - first sample n</dd><dd><code>n2</code> - second sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>approximate degrees of freedom</dd></dl> |
| </li> |
| </ul> |
| <a name="t(double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>protected double t(double m, |
| double mu, |
| double v, |
| double n)</pre> |
| <div class="block">Computes t test statistic for 1-sample t-test.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - sample mean</dd><dd><code>mu</code> - constant to test against</dd><dd><code>v</code> - sample variance</dd><dd><code>n</code> - sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t test statistic</dd></dl> |
| </li> |
| </ul> |
| <a name="t(double, double, double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>t</h4> |
| <pre>protected double t(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</pre> |
| <div class="block">Computes t test statistic for 2-sample t-test. |
| <p> |
| Does not assume that subpopulation variances are equal.</p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m1</code> - first sample mean</dd><dd><code>m2</code> - second sample mean</dd><dd><code>v1</code> - first sample variance</dd><dd><code>v2</code> - second sample variance</dd><dd><code>n1</code> - first sample n</dd><dd><code>n2</code> - second sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t test statistic</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticT(double, double, double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>homoscedasticT</h4> |
| <pre>protected double homoscedasticT(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2)</pre> |
| <div class="block">Computes t test statistic for 2-sample t-test under the hypothesis |
| of equal subpopulation variances.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m1</code> - first sample mean</dd><dd><code>m2</code> - second sample mean</dd><dd><code>v1</code> - first sample variance</dd><dd><code>v2</code> - second sample variance</dd><dd><code>n1</code> - first sample n</dd><dd><code>n2</code> - second sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>t test statistic</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>protected double tTest(double m, |
| double mu, |
| double v, |
| double n) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre> |
| <div class="block">Computes p-value for 2-sided, 1-sample t-test.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - sample mean</dd><dd><code>mu</code> - constant to test against</dd><dd><code>v</code> - sample variance</dd><dd><code>n</code> - sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if n is not greater than 1</dd></dl> |
| </li> |
| </ul> |
| <a name="tTest(double, double, double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>tTest</h4> |
| <pre>protected double tTest(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></pre> |
| <div class="block">Computes p-value for 2-sided, 2-sample t-test. |
| <p> |
| Does not assume subpopulation variances are equal. Degrees of freedom |
| are estimated from the data.</p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m1</code> - first sample mean</dd><dd><code>m2</code> - second sample mean</dd><dd><code>v1</code> - first sample variance</dd><dd><code>v2</code> - second sample variance</dd><dd><code>n1</code> - first sample n</dd><dd><code>n2</code> - second sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></code> - if the estimated degrees of freedom is not |
| strictly positive</dd></dl> |
| </li> |
| </ul> |
| <a name="homoscedasticTTest(double, double, double, double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>homoscedasticTTest</h4> |
| <pre>protected double homoscedasticTTest(double m1, |
| double m2, |
| double v1, |
| double v2, |
| double n1, |
| double n2) |
| throws <a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a>, |
| <a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></pre> |
| <div class="block">Computes p-value for 2-sided, 2-sample t-test, under the assumption |
| of equal subpopulation variances. |
| <p> |
| The sum of the sample sizes minus 2 is used as degrees of freedom.</p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>m1</code> - first sample mean</dd><dd><code>m2</code> - second sample mean</dd><dd><code>v1</code> - first sample variance</dd><dd><code>v2</code> - second sample variance</dd><dd><code>n1</code> - first sample n</dd><dd><code>n2</code> - second sample n</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>p-value</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</a></code> - if an error occurs computing the p-value</dd> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></code> - if the estimated degrees of freedom is not |
| strictly positive</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/TTest.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../../org/apache/commons/math3/stat/inference/TestUtils.html" title="class in org.apache.commons.math3.stat.inference"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../../org/apache/commons/math3/stat/inference/WilcoxonSignedRankTest.html" title="class in org.apache.commons.math3.stat.inference"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/commons/math3/stat/inference/TTest.html" target="_top">Frames</a></li> |
| <li><a href="TTest.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2003–2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |