# 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
• Sa: • Sb: • SSa: • SSb: 2. Compute the sample mean of each group.
• Ma: • Mb: 3. Compute the variance for each group.
4. Estimate the variance
• varA: • varB: • Var: 5. Estimate the standard deviation (stDev): 6. t: #### T probability

• P-value: #### Permutation T probability I (BH Step-Up Procedure without adjustment)

1. Calculate raw P value based on original grouping of each gene.
N = totalGene = 2. Randomly regrouping each gene.
The size in each group stays the same as the original, each sample only appears once in each group, number of regrouping depends on user.
3. For each regrouped gene, recalculate P value. = 4. Count if less than or equals to for each gene.
count = number of <= 5. Calculate permutation P value.
PP-value = 6. Rank PP-value by ascending order, calculate unadjusted T probability of each gene from the gene with largest rank to smallest rank.
P-value = *PP-value
if >=1, then set = 1
if > , then = #### Permutation T probability II (BH Step-Up Procedure with adjustment)

1. Calculate raw T value based on original grouping of each gene.
N = totalGene : 2. Randomly regrouping each gene.
The size in each group stays the same as the original, each sample only appears once in each group, number of regrouping depends on user.
3. For each regrouped gene, recalculate T value. : 4. for each , calculate number of T values of all permuted genes >= count = permuted T value of all genes >= 5. Estimate P-value of estP-value = 6. Rank estP-value by ascending order, calculate adjusted T probability of each gene from the gene with largest rank to smallest rank.
P-value = *estP-value
if >=1, then set = 1
if > , then = #### summary of running time

 sample size group size permutation time running time 10 5 vs. 5 252 0.01 10 5 vs. 5 5,000 0.406 20 10 vs. 10 10,000 0.56 20 10 vs. 10 1,847,560 87.746 50 25 vs. 25 10,000 1.261 50 25 vs. 25 50,000 14.703

-- WillGray - 23 Jul 2004

Topic revision: r5 - 15 May 2009, WillGray

• Biostatistics Webs Copyright © 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