smile.stat.hypothesis
Class TTest
- java.lang.Object
-
- smile.stat.hypothesis.TTest
-
public class TTest extends java.lang.ObjectStudent's t test. A t-test is any statistical hypothesis test in which the test statistic has a Student's t distribution if the null hypothesis is true. It is applied when the population is assumed to be normally distributed but the sample sizes are small enough that the statistic on which inference is based is not normally distributed because it relies on an uncertain estimate of standard deviation rather than on a precisely known value.Among the most frequently used t tests are:
- A test of whether the mean of a normally distributed population has a value specified in a null hypothesis.
- A test of the null hypothesis that the means of two normally
distributed populations are equal. Given two data sets, each characterized
by its mean, standard deviation and number of data points, we can use some
kind of t test to determine whether the means are distinct, provided that
the underlying distributions can be assumed to be normal. All such tests
are usually called Student's t tests, though strictly speaking that name
should only be used if the variances of the two populations are also assumed
to be equal; the form of the test used when this assumption is dropped is
sometimes called Welch's t test. There are different versions of the t test
depending on whether the two samples are
- unpaired, independent of each other (e.g., individuals randomly assigned into two groups, measured after an intervention and compared with the other group),
- or paired, so that each member of one sample has a unique relationship with a particular member of the other sample (e.g., the same people measured before and after an intervention).
- A test of whether the slope of a regression line differs significantly from 0.
-
-
Field Summary
Fields Modifier and Type Field and Description doubledfThe degree of freedom of t-statistic.doublepvaluep-valuedoublett-statistic
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static TTestpairedTest(double[] x, double[] y)Given the paired arrays x and y, test if they have significantly different means.static TTesttest(double[] x, double mean)Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis.static TTesttest(double[] x, double[] y)Test if the arrays x and y have significantly different means.static TTesttest(double[] x, double[] y, boolean equalVariance)Test if the arrays x and y have significantly different means.static TTesttest(double r, int df)Test whether the Pearson correlation coefficient, the slope of a regression line, differs significantly from 0.
-
-
-
Field Detail
-
df
public double df
The degree of freedom of t-statistic.
-
t
public double t
t-statistic
-
pvalue
public double pvalue
p-value
-
-
Method Detail
-
test
public static TTest test(double[] x, double mean)
Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis. Small values of p-value indicate that the array has significantly different mean.
-
test
public static TTest test(double[] x, double[] y)
Test if the arrays x and y have significantly different means. The data arrays are assumed to be drawn from populations with unequal variances. Small values of p-value indicate that the two arrays have significantly different means.
-
test
public static TTest test(double[] x, double[] y, boolean equalVariance)
Test if the arrays x and y have significantly different means. Small values of p-value indicate that the two arrays have significantly different means.- Parameters:
equalVariance- true if the data arrays are assumed to be drawn from populations with the same true variance. Otherwise, The data arrays are allowed to be drawn from populations with unequal variances.
-
pairedTest
public static TTest pairedTest(double[] x, double[] y)
Given the paired arrays x and y, test if they have significantly different means. Small values of p-value indicate that the two arrays have significantly different means.
-
test
public static TTest test(double r, int df)
Test whether the Pearson correlation coefficient, the slope of a regression line, differs significantly from 0. Small values of p-value indicate a significant correlation.- Parameters:
r- the Pearson correlation coefficient.df- the degree of freedom. df = n - 2, where n is the number of samples used in the calculation of r.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG