Packages

class TTest extends AnyRef

The TTest class is used to test whether the means, 'μ1' and 'μ2', of two data samples, 'x' and 'y', are different, 'μ1 ≠ μ2', using a Two-Sample, Independent t-test. Assumes samples are drawn from Normal distributions. The error in the test is measured by the conditional probability 'p' that a "difference is detected" when there "actually is none".

p = P(different | μ1 = μ2)

The power of the test is the ability to detect actual differences. '1 - power' is measured by the conditional probability 'q' that a "difference is not detected" when there "actually is one".

q = P(! different | μ1 ≠ μ2)

These are called type I (measured by p) and type II (measured by q) errors.

See also

en.wikipedia.org/wiki/Type_I_and_type_II_errors -----------------------------------------------------------------------------

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TTest
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TTest(x: VectorD, y: VectorD, pooled: Boolean = true)

    x

    the first sample's vector of data

    y

    the second sample's vector of data

    pooled

    whether the variances can be assumed to be the same (hence pooled)

Value Members

  1. def df: Double

    Compute the effective degrees of freedom: For pooled, it is the sum of the two degrees of freedom of the samples after their means are estimated.

    Compute the effective degrees of freedom: For pooled, it is the sum of the two degrees of freedom of the samples after their means are estimated.

    df = df1 + df2 = n1 + n2 - 2

    while for unequal variances, it is the scaled weighted harmonic mean of the two degrees of freedom.

    See also

    stats.stackexchange.com/questions/116511/ explanation-for-non-integer-degrees-of-freedom-in-t-test-with-unequal-variances/116556#116556

  2. def different(p: Double, α: Double = 0.05): Boolean

    Determine whether the difference in the two means is statistically significant.

    Determine whether the difference in the two means is statistically significant.

    p

    the probability of a type I error

    α

    the desired sigificance level

  3. def p(t: Double, df: Double): Double

    Compute the probability of a type I error using the Student's t distribution.

    Compute the probability of a type I error using the Student's t distribution.

    t

    the value of the Student's t statistic

    df

    the effective degrees of freedom

    See also

    scalation.random.CDF.studentTCDF

  4. def q(t: Double, df: Double): Double

    Compute the probability of a type II error using the Noncentral t distribution.

    Compute the probability of a type II error using the Noncentral t distribution.

    t

    the value of the Student's t statistic

    df

    the effective degrees of freedom

    See also

    scalation.random.CDF.noncentralTCDF

  5. def same(q: Double, β: Double = 0.1): Boolean

    Determine whether the difference in the two means is statistically insignificant.

    Determine whether the difference in the two means is statistically insignificant. Note, typically this is a weaker test than 'different'.

    q

    the probability of a type II error

    β

    the desired power level (β = 1 - power)

  6. def se: Double

    Compute the standard error for mean difference.

  7. def t(se: Double): Double

    Compute the Student's t statistic.