Anda di halaman 1dari 9

4/30/2013

When to use the independent samples t-test


The independent samples t-test is probably the single most widely used test in statistics. It is used to compare differences between separate groups. In social sciences, these groups are often composed by randomly assigning research participants to conditions. However, this test can also be used to explore differences in naturally occurring groups. For example, we may be interested in differences of emotional intelligence between males and females.

Independent 2 Samples t-Test

Distribution of Differences between means


H0: 1 = 2 H1 : 1 = 2 Variance Sum Law: The variance of the sum or difference of two independent variables is equal to the sum of their variances.

The t statistic

Pooling Variances
The previous equation is appropriate when sample size are equal, it can be improved for unequal sample sizes. This equation will provide a better estimate of the population variances. One of the assumption for the t test is that the variances are equal (homogeneity of variance)
5

Pooling Variances
If we want a better estimate of , namely and , it seems appropriate to attain an average of these two values. But a simple average is not suitable because it gives equal weight to both values. (not suitable because sample size not the same)

4/30/2013

The t equation again

Degrees of freedom (df)


df = (n1 1) + (n2 1)

Example 1
Kalau kita bahagikan dua kumpulan kepada 2 jenis diet yang berbeza:
diet nasi lemak diet teh tarik

Example 1 (cont.)
Pada akhir minggu, kita mengukur perubahan berat badan. Diet yang mana menyebabkan peningkatan berat badan yang lebih? Maka, hipotesis nol ialah: Ho: wt. gain diet nasi lemak =wt. gain diet teh tarik

Subjek dimasukkan secara rawak dalam kump diet nasi lemak dan kump teh tarik untuk satu minggu. Ini mungkin tidak beretika kerana nasi lemak mestilah makan bersama teh tarik! Tetapi ini hanyalah contoh.

Example 1 (cont.)
Why? The null hypothesis is the opposite of what we hope to find. In this case, our research hypothesis is that there ARE differences between the 2 diets. Therefore, our null hypothesis is that there are NO differences between these 2 diets.
11

6 Langkah Ujian Hipotesis


1. 2. 3. 4. 5. 6. Tulis Hipotesis Tetapkan alpha ( ) Buat pengiraan Dapatkan critical value Lakarkan kawasan penolakan hipotesis nol Buat Keputusan dan tulis kesimpulan

4/30/2013

Formula
The formula for the independent samples t-test is:

Example 1 (cont.)
The first step in calculating the independent samples t-test is to calculate the variance and mean in each condition. In the previous example, there are a total of 10 people, with 5 in each condition. Since there are different people in each condition, these samples are independent of one another; giving rise to the name of the test.
14

, df = (n1-1) + (n2-1)

13

Example 1 (cont.)
The variances and means are calculated separately for each condition (nasi lemak and teh tarik). In short, we take each observed weight gain for the nasi lemak condition, subtract it from the mean gain of the nasi lemak dieters and square the result.
15

Example 3.1 (cont.)


Column 3 Column 4

X1 : nasi lemak 1 2 2 2 3

X2 : teh tarik 3 4 4 4 5

( 1 1 ) 2 ( 2 2 ) 2
1 0 0 0 1
2

1 0 0 0 1

1 =

2 =
2 sx =

( )
n 1

0.5

0.5

16

Formula
The formula for the independent samples t-test is:

Example 3.1 (cont.)


From the calculations previously, we have everything that is needed to find the t.
, df = (5-1) + (5-1) = 8

, df = (n1-1) + (n2-1)

After calculating the t value, we need to know if it is large enough to reject the null hypothesis.
17 18

4/30/2013

Some theory
The t is calculated under the assumption, called the null hypothesis, that there are no differences between the nasi lemak and teh tarik diet. If this were true, when we repeatedly sample 10 people from the population and put them in our 2 diets, most often we would calculate a t of 0.
19

Some theory - Why?


Look again at the formula for the t. Most often the numerator (X1-X2) will be 0, because the mean of the two conditions should be the same under the null hypothesis. That is, weight gain is the same under both the nasi lemak and teh tarik diet.
20

Some theory - Why (cont.)


Sometimes the weight gain might be a bit higher under the nasi lemak diet, leading to a positive t value. In other samples of 10 people, weight gain might be a little higher under the teh tarik diet, leading to a negative t value. The important point, however, is that under the null hypothesis we should expect that most t values that we compute are close to 0.
21

Some theory (cont.)


Our computed t-value is not 0, but it is in fact negative (t(8) = -4.47). Although the t-value is negative, this should not bother us. Remember that the t-value is only - 4.47 because we named the nasi lemak diet X1 and the teh tarik diet X2.

This is, of course, completely arbitrary.


If we had reversed our order of calculation, with the nasi lemak diet as X2 and the teh tarik diet as X1, then our calculated t-value would be positive 4.47.
22

Example 1 (again) Calculations


The calculated t-value is 4.47 (notice, Ive eliminated the unnecessary - sign), and the degrees of freedom are 8. In the research question we did not specify which diet should cause more weight gain, therefore this t-test is a so-called 2-tailed t.

Example 1 (again) Calculations


In the last step, we need to find the critical value for a 2-tailed t with 8 degrees of freedom. This is available from tables that are in the back of any Statistics textbook. Look in the back for Critical Values of the tdistribution, or something similar. The value you should find is: C.V. t(8), 2-tailed = 2.306.
23 24

4/30/2013

The 95& Confidence Interval?

Example 1 (cont.)
The calculated t-value of 4.47 is larger in magnitude than the C.V. of 2.31, therefore we can reject the null hypothesis. Even for a results section of journal article, this language is a bit too formal and general. It is more important to state the research result, namely:

Participants on the teh tarik diet (M=4.000.5) gained significantly more weight than those on the nasi lemak diet (M=2.000.5), t(8) = -4.47, p < 0.05, 95%CI= -0.968, -3.031.
25 26

Example 1 (concluding comment)


Repeat from previous slide:

Example 2
IQ score after training is given to a special class (smart students) and normal class students.
Special Class 24.0 148.87 35 Normal Class 16.5 139.16 29

Participants on the teh tarik diet (M = 4.00) gained significantly more weight than those on the nasi lemak diet (M = 2.00), t(8) = 4.47, p < 0.05. Making this conclusion requires inspection of the t tables.

mean Var n

27

28

The F Max Test


Test for differences in variances. Assumptions:
Data sampled randomly Data are normally distributed

The F Max Test


Tetapkan hipotesis. df = n-1 k = bilangan kumpulans Kirakan Fmax dan bandingkan dengan Fmax kritikal anda. Buat kesimpulan. Nak guna pool variance atau tidak?
29 30

4/30/2013

95% Confidence Interval

Example 3 - of the two-sample t, Empathy by College Major


Suppose we have a professionally developed test of empathy. The test has people view film clips and guess what people in the clips are feeling. Scores come from comparing what people guess to what the people in the films said they felt at the time. We want to know whether Psychology majors have higher scores on average to this test than do Physics majors. No direction, we just want to know if there is a difference. So we find some (N=15) of each major and give each the test. Results look like this:
31

Empathy Scores
Person
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Psychology
10 12 13 10 8 15 13 14 10 12 10 12 13 10 8

Physics
8 14 12 8 12 9 10 11 12 13 8 14 12 8 12

Output SPSS

34

Check your answers Now Lets use SPSS to run our Analysis

35

36

4/30/2013

Example 1 Using SPSS


As long as this p-value falls below the standard of 0.05, we can declare a significant difference between our mean values. Since .002 is below .05 we can conclude: Participants on the teh tarik diet (M = 4.00) gained significantly more weight than those on the nasi lemak diet (M = 2.00), t(8) = 4.47, p < 0.01 (two-tailed).
37

Example 1 Using SPSS (cont.)


Repeat from previous slide:

Participants on the the tarik diet (M = 4.00) gained significantly more weight than those on the nasi lemak diet (M = 2.00), t(8) = 4.47, p < 0.01 (two-tailed).

In APA style we normally only display significance to 2 significant digits. Therefore, the probability is displayed as p<0.01, which is the smallest probability within this range of accuracy.
38

Example 3.1 Using SPSS (cont.)


The SPSS output also displays Levenes Test for Equality of Variances (see the first 2 columns in second table on slide 30). Why? Strictly speaking, the t-test is only valid if we have approximately equal variances within each of our two groups. In our example, this was not a problem because the 2 variances were exactly equal (Variance nasi lemak = 0.04 and Variance teh tarik= 0.04).
39

Example 3.1 Using SPSS (cont.)


However, if this test is significant, meaning that the p-value given is less than 0.05, then we should choose the bottom line when interpreting our results. This bottom line makes slight adjustments to the t-test to account for problems when there are not equal variances in both conditions.
40

END.

Dependent 2 Sample t test

41

42

4/30/2013

Introduction
So what if we have two related data set? Pre and post test data? Level of love felt among husband and wife? Repeated measures Matched/related samples
Twins, husband-wife, father-son, motherdaughter, mother-son Two scores for one case.
43

When the dependent sample test is used


When comparing matched samples or repeated scores. Instead of the raw scores, we use the DIFFERENCE SCORE (D).

44

The t equation again

Degrees of freedom (df)


df = number of pairs 1

45

46

Contoh 1
Suatu kajian terapi untuk masalah anorexia telah dijalankan. Sampel kajian adalah 17 budak perempuan. Berat badan telah dicatatkan sebelum dan selepas menjalani terapi tersebut. Data adalah seperti berikut:
Before Mean S 83.23 5.02 After 90.49 8.48 Diff Score 7.26 7.16
47

6 Langkah Ujian Hipotesis


1. 2. 3. 4. 5. 6. Tulis Hipotesis Tetapkan alpha ( ) Buat pengiraan Dapatkan critical value Lakarkan kawasan penolakan hipotesis nol Buat Keputusan dan tulis kesimpulan

4/30/2013

Hipotesis
= 0.05

Tetapkan alpha

49

50

Buat Pengiraan

Dapatkan critical Value

Lakarkan kawasan penolakan nol hipotesis dan buat keputusan.

51

52

Laporkan keputusan anda

Latihan 1
Subject A B C D Mean S
53 54

Before 10 15 12 11

After 14 13 15 12

Diff score