T Test
T Test
TOPIC: T TEST
Prepared by :Dr. Archana Sharma
3
An introduction to t-tests
5
When to use a t-test
• A t-test can only be used when comparing the means of two groups (a.k.a. pairwise
comparison). If you want to compare more than two groups, or if you want to do
multiple pairwise comparisons, use an ANOVA test or a post-hoc test.
• The t-test is a parametric test of difference, meaning that it makes the same assumptions
about your data as other parametric tests. The t-test assumes your data:
• are independent
• are (approximately) normally distributed.
• have a similar amount of variance within each group being compared (a.k.a.
homogeneity of variance)
• If your data do not fit these assumptions, you can try a nonparametric alternative to the
t-test, such as the Wilcoxon Signed-Rank test for data with unequal variances.
6
ABOUT t - test
• What type of t-test should I use?
• When choosing a t-test, you will need to consider two things: whether the groups
being compared come from a single population or two different populations, and
whether you want to test the difference in a specific direction.
• One-sample, two-sample, or paired t-test?
• If the groups come from a single population (e.g. measuring before and after an
experimental treatment), perform a paired t-test.
• If the groups come from two different populations (e.g. two different species, or
people from two separate cities), perform a two-sample t-test (a.k.a. independent t-
test).
• If there is one group being compared against a standard value (e.g. comparing the
acidity of a liquid to a neutral pH of 7), perform a one-sample t-test.
7
One-tailed or two-tailed t-test?
• If you only care whether the two populations are different from one
another, perform a two-tailed t-test.
• If you want to know whether one population mean is greater than or
less than the other, perform a one-tailed t-test.
• In your test of whether petal length differs by species:
• Your observations come from two separate populations (separate
species), so you perform a two-sample t-test.
• You don’t care about the direction of the difference, only whether
there is a difference, so you choose to use a two-tailed t-test.
8
Performing a t-test
• The t-test estimates the true difference between two group means using the ratio of the
difference in group means over the pooled standard error of both groups. You can calculate it
manually using a formula, or use statistical analysis software.
9
continue
10
( or) if tcal> ttab
11
The value of
12
13
Test for equality of two means (Independent Samples)
• Given two sets of sample observation x11,x12,x13…x1n . Similarly x21,x22,x23…x2n of sizes n1 and n2 from the normal
population. 1. Using F-Test , test their variances
• (i)Variances are Equal:
• Ho:., µ1=µ2
• H1 µ1≠µ2 (or µ1<µ2or µ1>µ2)
14
Variances are equal
15
16
We conclude that the medicines A and also B do not differ
significantly.
17
Example 3: The summary of the results of an yield trial on onion with two methods of propagation is given
below. Determine whether the methods differ with regard to onion yield. The onion yield is given in Kg/plot.
18
19
continue
20
THANK YOU
21