Anda di halaman 1dari 21

The t- test

This test was invented by a called WS Gosset (1867-


1937), but preferred to keep anonymous so wrote
under the name Student.
require 2 samples which may be fromthe same
population.
These samples need not be of equal #, nor are
they paired.
H0: The 2 samples are from the same
population - any differences are due to chance
H1: The 2 samples come from different
populations.
2
Perbandingan dua nilai tengan (means)
Goal: to compare the mean of a numerical variable for
different groups.
Tests one categorical vs. one numerical variable
Example:
gender (M, F) vs. height
Paired vs. 2 sample
comparisons
Data from the two groups are
paired
There is a one-to-one
correspondence between the
individuals in the two groups
Paired designs
Paired designs
Each member of the pair shares much in common with the
other, except for the tested categorical variable
Example: identical twins raised in different environments
Can use the same individual at different points in time
Example: before, after medical treatment
We have many pairs
In each pair, there is one member that has one treatment
and another who has another treatment
Treatment can mean group
Paired comparisons - setup
To compare two groups, we use the mean of the
difference between the two members of each pair
STUDENTS T TEST
The students t test is used to see if to sets of data differ significantly.
The method assumes that the results follow the normal distribution (also
called student's t-distribution) if the null hypothesis is true.
This null hypothesis will usually stipulate that there is no significant
difference between the means of the two data sets.
It is best used to try and determine whether there is a difference between
two independent sample groups. For the test to be applicable, the sample
groups must be completely independent, and it is best used when the sample
size is too small to use more advanced methods.
Before using this type of test it is essential to plot the sample data from he
two samples and make sure that it has a reasonably normal distribution, or
the students t test will not be suitable.
It is also desirable to randomly assign samples to the groups, wherever
possible.
The Use of the Null Hypothesis
Is the difference in two sample populations due to chance or a
real statistical difference?
The null hypothesis assumes that there will be no difference
or no change or no effect of the experimental treatment.
If treatment A is no better than treatment B then the null
hypothesis is supported.
If there is a significant difference between A and B then the
null hypothesis is rejected...
Test statistic > critical value
P < alpha
Reject the null hypothesis
Statistically significant
Sample
Null hypothesis
The population mean
is equal to
o
One-sample t-test
Test statistic
t =

Y
o
s/

n
Null distribution
t with n-1 df
compare
How unusual is this test statistic?
P < 0.05
P > 0.05
Reject H
o
Fail to reject H
o
T-test
T-test determines the probability that the null
hypothesis concerning the means of two small
samples is correct
The probability that two samples are
representative of a single population
(supporting null hypothesis) OR two different
populations (rejecting null hypothesis)
The theory...
You have 2 samples which may be from 1
distribution or 2. To assess the likelihood, find
how many s.d.s the means of the 2 populations
are apart:
How many S.D.s?
Calculate t = (1 - 2) / pooled sd
1
2
The t test is a parametric test - it
assumes the data are normally
distributed.
(
(

+
+
+

=
2 1
2 1
2
2 1
2 2
2
1 1
2 1
2
) 1 ( ) 1 (
n n
n n
n n
s n s n
X X
t
Two Sample Difference of Means T-Test
2
2 1
2 2
2
1 1
2
) 1 ( ) 1 (
+
+
n n
s n s n
Sp2 =
Pooled variance of the two groups
(

+
2 1
2 1
n n
n n
= common standard deviation of two groups
The nominator of the equation captures difference in
means,
while the denominator captures the variation within
and between each group
Contoh
Test on verbal test scores by gender:
Females: mean = 50.9, variance = 47.553, n=6
Males: mean =41.5, variance = 49.544, n=10
(

+
+
+

=
) 10 ( 6
10 6
2 10 6
544 . 49 ) 1 10 ( 553 . 47 ) 1 6 (
5 . 41 9 . 50
t
| | ) 26667 (. 826 . 48
4 . 9
= t
02 . 13
4 . 9
= t 605 . 2
608 . 3
4 . 9
= = t
Now what do we do with this obtained
value?
Steps of Testing and Significance
1. Statement of null hypothesis: if there is not one then how can you be
wrong?
2. Set Alpha Level of Risk: .10, .05, .01
3. Selection of appropriate test statistic: T-test.
4. Computation of statistical value: get obtained value.
5. Compare obtained value to critical value:
6. Comparison of the obtained and critical values.
7. If obtained value is more extreme than critical value, you may reject
the null hypothesis. In other words, you have significant results.
8. If point seven above is not true, obtained is lower than critical, then
null is not rejected.
T table of values (5% = 0.05)
For example:
For 10 degrees of freedom
(2N-2)
The chart value to compare
your t value to is 2.228
If your calculated t value is
between
+2.228 and -2.228
Then accept the null
hypothesis the mean are
similar
If your t value falls outside
+2.228 and -2.228 (larger
than 2.228 or smaller than -
2.228)
Fail to reject the null
hypothesis (accept the
alternative hypothesis) there
is a significant difference.

Anda mungkin juga menyukai