T Test
T Test
Statistics
T-test
The Student’s t-test is a statistical test that
compares the mean and standard deviation of
two samples to see if there is a significant
difference between them.
TYPES
Example
A group of 100 people took an IQ test. Are they
different from the population average? Do they
have above average IQ?
Types of T-tests
2. Independent samples t-test
– Compares the mean scores of two different
groups of subjects
– Also known as 2-samples t test
Example
Are Science scores different between students
with high fitness and low fitness?
Types of T-tests
3. Dependent samples t-test
– Compares the mean scores for the same
group of subjects on two different
occasions
– also known as paired samples t test or
repeated measures t-test
Example
Is the group different before and after a
treatment?
EXERCISE
Determine which type of t-test is necessary for each
given hypothesis / study.
EXERCISE
Determine which type of t-test is necessary for each
given hypothesis / study.
4.
EXERCISE
Determine which type of t-test is necessary for each
given hypothesis.
TYPES
H o ; 100 H A ; 100
Null Hypothesis Alternative Hypothesis
0.05
if there was none
Sample Problem
1 sample t test
In the population, the average IQ is 100. A team of scientists wants to test a
new medication to see if it has either a positive or negative effect on
intelligence, or no effect at all. A sample of 30 participants who have taken
the medication has a mean of 140 with a standard deviation of 20. Did the
medication affect intelligence? Alpha = 0.05
n – 1 = 30 – 1 = 29
n – number of sample
Degrees of freedom – 29 ; this has an effect on what
critical value is to be used.
Sample Problem
1 sample t test
In the population, the average IQ is 100. A team of scientists wants to test a
new medication to see if it has either a positive or negative effect on
intelligence, or no effect at all. A sample of 30 participants who have taken
the medication has a mean of 140 with a standard deviation of 20. Did the
medication affect intelligence? Alpha = 0.05
4. State Decision rule
x 140 100
t 20
s
30
n
Sample Problem
1 sample t test
In the population, the average IQ is 100. A team of scientists wants to test a new
medication to see if it has either a positive or negative effect on intelligence, or no
effect at all. A sample of 30 participants who have taken the medication has a mean
of 140 with a standard deviation of 20. Did the medication affect intelligence?
Alpha = 0.05
6. State results
If t is less than -2.045 or greater than 2.045, reject the null
hypothesis.
t = 10.96
DECISION: Reject Ho
The medication has no significant effect on intelligence,
the difference we see in the two means may be due to
chance and sampling error. - REJECTED
Sample Problem
1 sample t test
In the population, the average IQ is 100. A team of scientists wants to test a new
medication to see if it has either a positive or negative effect on intelligence, or no
effect at all. A sample of 30 participants who have taken the medication has a mean
of 140 with a standard deviation of 20. Did the medication affect intelligence?
Alpha = 0.05
7. State Conclusion
DECISION: Reject Ho
The medication has no significant effect on intelligence,
the difference we see in the two means may be due to chance
and sampling error. – REJECTED
H o ; A B H A ; A B
Null Hypothesis Alternative Hypothesis
The tests scores of Class A and Class The tests scores of Class A and
B are of no significant difference, the Class B are of significant
difference we see in the two difference, the observed
means may be due to chance and differences are most likely not due
sampling error. to chance or sampling error.
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they performed any
differently on the tests he gave that semester. Class A had 25 students with an
average score of 70, standard deviation 15. Class B had 20 with an average score of
74, standard deviation 25. Using alpha 0.05, did these two classes perform
differently on the tests?
0.05
if there was none
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they performed any
differently on the tests he gave that semester. Class A had 25 students with an
average score of 70, standard deviation 15. Class B had 20 with an average score of
74, standard deviation 25. Using alpha 0.05, did these two classes perform
differently on the tests?
3. Calculate Degrees of Freedom
Degrees of Freedom for Independent Samples T test
df (n1 1) (n2 1)
df (25 1) (20 1)
df 43
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they
performed any differently on the tests he gave that semester. Class A had
25 students with an average score of 70, standard deviation 15. Class B
had 20 with an average score of 74, standard deviation 25. Using alpha
0.05, did these two classes perform differently on the tests?
4. State Decision rule
t
x1 x2 1 2 Since we are testing the null
hypothesis where μ1 = μ2,
2 2 and in the null hypothesis
s s
p
p
μ1 – μ2 = 0, we leave it out
n1 n2 of the equation.
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they performed any
differently on the tests he gave that semester. Class A had 25 students with an
average score of 70, standard deviation 15. Class B had 20 with an average score of
74, standard deviation 25. Using alpha 0.05, did these two classes perform
differently on the tests?
SS1 SS2 5400 11875
5. Calculate Test Statistic s
2
401 .74
df1 df2
p
24 19
t
x1 x2 SS1 s12 df1 (152 )(24) 5400
n1 n2 t
70 74 0.67
401 .74 401.74
25 20
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they performed any
differently on the tests he gave that semester. Class A had 25 students with an
average score of 70, standard deviation 15. Class B had 20 with an average score of
74, standard deviation 25. Using alpha 0.05, did these two classes perform
differently on the tests?
6. State Results
DECISION RULE: If t is less than -2.0167 or greater than
2.0167, reject the null hypothesis.
t = - 0.67 ( in between – 2.0167 and 2.0167)
DECISION: Do not reject Ho.
The tests scores of Class A and Class B are of no significant
difference, the difference we see in the two means may be due to
chance and sampling error. - ACCEPT ED
Sample Problem
Independent Samples t test
A statistics teacher wants to compare his two classes to see if they performed any
differently on the tests he gave that semester. Class A had 25 students with an average
score of 70, standard deviation 15. Class B had 20 with an average score of 74,
standard deviation 25. Using alpha 0.05, did these two classes perform differently on
the tests?
6. State Conclusion
DECISION: Do not reject Ho.
The tests scores of Class A and Class B are of no significant
difference, the difference we see in the two means may be due to
chance and sampling error. – ACCEPTED
0.05
Sample Problem
Dependent Samples t test
Researchers want to test a new anti-hunger weight loss pill. They
have 10 people rate their hunger both before and after taking the
pill. Does the pill do anything? Use alpha = 0.05
3. Calculate Degrees of Freedom
df N 1
df 10 1 N – total number
of participants
df 9
Sample Problem
Dependent Samples t test
Researchers want to test a new anti-hunger weight loss pill. They
have 10 people rate their hunger both before and after taking the
pill. Does the pill do anything? Use alpha = 0.05
4. State Decision Rule
- In the T-table (2-tailed test), find
the intersection of df = 9 and
α = 0.05.
2.2622
DECISION RULE: If t is less than
2.0167 -2.2622 or greater than 2.0167, reject the
null hypothesis.
- 2.2622 0 2.2622
Sample Problem
Dependent Samples t test
Researchers want to test a new anti-hunger weight loss pill. They
have 10 people rate their hunger both before and after taking the
pill. Does the pill do anything? Use alpha = 0.05
5. Calculate Test Statistic
2
d n
9 7 2 4
2
10 6 4 16
7 5 2 4 sD
5 4 1 1 n 1
7 4 3 9
5
9
6
7
-1
2
1
4 49
17
2
6 5 1 1
sD 10 1.49
8 5 3 9
10 1
7 7 0 0
∑ 17 49
X 1.7 4.9
Sample Problem
Dependent Samples t test
BEFORE AFTER DIFFERENCE D D2
9 7 2 4 XD
10
7
6
5
4
2
16
4
t sD
5 4 1 1 n
7 4 3 9
1.7
t 3.61
5 6 -1 1
9 7 2 4
6 5 1 1 1.49
8 5 3 9 10
7 7 0 0
∑ 17 49
X 1.7 4.9
Sample Problem
Dependent Samples t test
Researchers want to test a new anti-hunger weight loss pill. They have 10
people rate their hunger both before and after taking the pill. Does the pill
do anything? Use alpha = 0.05
6. State Results
DECISION RULE: If t is less than -2.2622 or greater than 2.2622, reject the
null hypothesis.
t = 3.61( exceeded 2.2622)
DECISION: Reject Ho.
There is no significant difference in the rate of hunger of the
samples before and after taking the weight loss pills, the difference
we see in the two means may be due to chance and sampling error.
r. - - REJECTED
Sample Problem
Dependent Samples t test
Researchers want to test a new anti-hunger weight loss pill. They have 10
people rate their hunger both before and after taking the pill. Does the pill
do anything? Use alpha = 0.05
7. State Conclusion
DECISION: Reject Ho.
There is no significant difference in the rate of hunger of the
samples before and after taking the weight loss pills, the difference
we see in the two means may be due to chance and sampling error.
r. - - REJECTED