Statistics
Ttest
A Ttest is performed to compare the averages of two groups of
data. How do you know that the difference between the averages you observed is
"real"? It could be that you just happened to see a difference because your
sample size is small and by chance you ended up with larger numbers in one group
and smaller numbers in the other. The Ttest allows us to say with 95% certainty
whether they are truly different. Using Microsoft Excel, the following function
returns the probability associated with a Student's ttest:
=TTEST(Array1,Array2,Tails,Type)
Where
 Array1 is the range of data for the first group
 Array2 is the range of data for the second group
 Tails refers to a onetailed test or a twotailed test. If we have
background information that would allow us to predict that one group should
have a higher value, we use 1. If we really don't know which one should end up
being higher, we use 2.
 Type can be one of three things
 paired Ttest: Used when the same animals are used in groups 1 and 2,
and the measurement is repeated. Example: you measure respiration rate in
fish at rest, then the same fish during exercise.
 unpaired, equal variance: different animals are in each group, and the
variation within each group is about the same. To examine the variance of
each group, use =VAR(array1) and =VAR(array2) and eyeball the results.
Technically, an Ftest should be performed, but let's not go there right
now.
 unpaired, unequal variance: different animals are in each group, and the
variation within each group is different.
The number that you
get from the function is called the Pvalue, which ranges from 0 to 1 (if you
get a number outside these limits, then you have not set up the function
properly.) P represents the probablility that the two means are the same. If P
is high, then there is probably no difference between the two groups; if P is
low, then there may be a difference. By convention, we us 5% as a cutoff, so if
P is less than 0.05, we say that the difference between the means is
statistically significant because the chance that the averages are the
same is less than 5%. We can live with that level of uncertainty.
Example
Suppose we do an experiment wherein we measure respiration rate
in 17 fish at rest, then the same fish during exercise. We get the following
data:

A 
B 
1 
Respiration (/min) 
2 
Rest 
Exercise 
3 
78 
84 
4 
120 
92 
5 
88 
116 
6 
39 
100 
7 
80 
84 
8 
56 
104 
9 
52 
104 
10 
72 
120 
11 
96 
96 
12 
88 
162 
13 
90 
108 
14 
96 
156 
15 
80 
104 
16 
102 
138 
17 
100 
140 
18 
86 
122 
19 
84 
110 
Our experiment and data are set up as follows:
 Array1 is the range of data for the rest group (A3:A19)
 Array2 is the range of data for the exercise group (B3:B19)
 We know that exercise causes increased respiration in many species, so we
choose a onetailed test (1)
 The same animals are used both groups. A3 is for fish1 at rest, B3 is for
fish1 during exercise, and so on. Therefore we use a paired Ttest
(1)
Our formula is completed as follows:
=TTEST(A3:A19,B3:B19,1,1)
The result is 6.82779E05, or 6.82779 x 10^{5}, which translates as
0.0000683. This Pvalue means that we would expect to get these results by
random chance only about 0.007% of the time. The difference between the means is
highly significant. We can say that the two means are significantly
different. This is a term of artwe must never say this unless a
statistical test has actually shown it to be so.
[ 8/23/01 jrc]