TTest Algorithm

Performed on a set of non-negative numbers and labels of size N. There must be two specific labels. Label 1 must be 1 and label 2 must be 2. There can also be any other labels that will be ignored.

T value

  1. Find the number and sum of each group.
    • Na: number of values in group 1
    • Nb: number of values in group 2
    • N: Na + Nb
    • Sa: $\sum X_i$
    • Sb: $\sum Y_i$
  2. Compute the sample mean of each group.
    • Ma: $\frac{Sa}{Na}$
    • Mb: $\frac{Sb}{Nb}$
  3. Compute the sum of squared deviates for each group.
    • SSa: $\sum {X_i}^2 - \frac{(\sum X_i)^2}{N}$
    • SSb: $\sum {Y_i}^2 - \frac{(\sum Y_i)^2}{N}$
  4. Estimate the variance (Var): $\frac{SSa + SSb}{N - 2}$
  5. Estimate the standard deviation (Stdev): $\sqrt{\frac{Var}{Na} + \frac{Var}{Nb}}$
  6. t: $\frac{Ma - Mb}{Stdev}$

T probability

  • P-value: $probt(t, N - 2)$

-- WillGray - 23 Jul 2004
Edit | Attach | Print version | History: r7 | r4 < r3 < r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r2 - 23 Jul 2004, WillGray
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback