Sei sulla pagina 1di 29

Appedix A

Calculating the t- Test and ANOVA


The t-Test
The t-test is used for comparing a sample mean to a population mean,
comparing two means from the same sample, or comparing the means of two different
samples.
In a t-test we establish a hypothesis to test, compute the value of t, and then
compare it to a critical value of t.
Using a t-test also involves degrees of freedom. Degrees of freedom are based
on how many values in the data set that are free to vary, and is associated with how
many population parameters we intend to estimate.
A. t-Test for Single Samples
This test uses only one sample, and we use this t-test when we dont
know (population standard deviation).
The formula for single samples t-test is:
M
s /n
t=
Key:

M = sample mean
= population mean
s = sample standard deviation
n = sample size
s /n = standard error of the mean

Example:
The average IQ for children is 100. Dr. Hockler believes she can increase
this level in a sample of children by providing them with extra intellectual
stimulation during the preschool years. After 3 years of such stimulation, she
measures the IQ scores of ten 6-year-olds. These children score a mean of 109,
with s = 7.6. Evaluate her hypothesis at 0.1.
Step 1: State the hypotheses:

Ho: There is no significant difference in childrens IQ scores


from the population average.

Step 2: Determine the critical value of t (cvt).


df = n-1 = 10-1 = 9
cvt = 1.833
Step 3: Compute t:
t=

1090.1
7.6/ 6

t=

108.9
7.6 /2.45

t=

108.9
3.10

t=35.13
What should we conclude?
The calculated value of t is 35.13 is greater than the critical value
of 1.833 at 0.1 level of significance. This means that the null hypothesis is
rejected. There is a significant difference in childrens IQ scores from the
population average.

B. t-Test for Dependent Samples


This test is used when we have only one sample, but plan to compare the
groups mean at one time to the groups mean at another time to check for a
significant mean difference. Another way this test is used is when the
participants are paired or matched in some way. In this case, the dependent
samples t-test is often called a paired samples t-test or a related samples t-test.
This t-test is based on difference scores, and the formula is:

t=

Key:

M D

S D / n
MD = mean difference (the mean of the difference scores)
D = population mean difference (which is always 0)
sD = standard deviation of the difference scores
n = sample size, or number of pairs
sD /n = standard error of the mean difference

Since the value of D is always zero, we can simply omit it from the
formula:

t=

MD
S D / n

Steps: 1. State the Hypotheses


2. Determine tcv
df = n-1
tcv =
3. Find the difference scores (subtract before scores from after scores)
4. Square the difference scores
5. Find MD
6. Find sD
7. Compute t and compare to tvc
Example
Ms. Brooks modified her teaching methods for her 10 th grade Advanced
English class to help improve her 7 students learning. To detect improvement,
she wants to compare the students Test 1 scores with their Test 2 scores. At
= .01, find out if Ms. Brooks students learned better after she modified her
teaching.
Step 1: Ho: There is no significant difference between the performance of
the students in test 1 and test 2.
Step 2: Determine tcv df = n-1 = 7 1 = 6
tcv = 3.143

Step 3 and 4: Find difference scores and square them


Test 1
85
92
98
79
86
87
84

Test 2
88
(88 85) =
90
(90 92) =
97
85
90
88
86

D
3
-2
-1
6
4
1
2
13

Step 5: Find MD = 13 / 7 = 1.86


D
2

( N )

2
D

S D =

Step 6: Find

(13 2 /7)

71

71(169/7)
6

7.81
2.79

Step 7: Compute t and compare to tcv

D2
9
4
1
36
16
1
4
71

t=

MD
S D / n

t=

1.86
2.79 / 7

t=

1.86
2.79 /2.65

t=

1.86
1.05

t=1.77
What should we conclude?
The calculated value of t is lesser than the tabulated value of t.
Therefore the null hypothesis is accepted. There is no significant
difference between the performance of the students in test 1 and test 2.

C. t-Test for Independent Samples


This test is used when we have two different samples, and we want to
know if the means are significantly different from one another. Because we are
using two samples, we must combine the variance of both.

The formula for this test is:


df
n1
n2
1 /+(1/)

(SS 1+ SS 2)/

M 1M 2
t=

Key:

M1 = mean of first sample


M2 = mean of second sample

SS1 = sum of squares for first sample


SS2 = sum of squares for second sample
df = degrees of freedom [(n1 + n2) 2]
n1 = number in first sample
n2 = number in second sample
(SS1 + SS2) / df) = pooled variance

Steps: 1. State the Hypotheses


2. Determine tcv df = (n + n) - 2
tcv =
3. Square each score for each group
4. Sum the scores, and the squared scores, for each group
5. Find M for each group
6. Find the SS for each group
7. Compute t and compare to tvc
Example:
Mr. Ande is a farmer looking for an effective way to store corn for a 9
month period. He plans to use half of his machine shed to stack the corn in a
sheet metal bin. His main concern is moisture getting to the corn, but doesnt
know whether the corn will hold up better if he uses the existing dirt floor, or
constructs a floor made of lime chips like his neighbor suggests. He decides to
split his 10,000 bushels between two bins, one with a dirt floor and one with a
lime chip floor, and check them for moisture percentage at the end of each
month. His data appear below. At = .01, did one bin of corn suffer a
significantly different amount of moisture damage over the other?
Step 1: State the Hypotheses
Ho: There will be no difference in the amount of moisture damage
suffered by each bin of corn.
Step 2: Determine tcv:
df = (n + n) - 2 = (9+9) 2 = 16
tcv = 2.921

Step 3 and 4:
Dirt Floor (X1)
Lime Floor (X2)
3
2
5
3
6
5
7.2
7
8.5
7
12
8.9
14
11
16.8
12
20
12.5

92.5
68.4 `
Step 5: M1 = 92.5/9 =10.28

X12
9
25
36
51.84
72.25
144
196
282.24
400
1216.33
M2 = 68.4/9 = 7.6

X22
4
9
25
49
49
79.21
121
144
156.25
636.46

Step 6: SS1 = X12 ((X1)2 / n1)SS2 = X22 ((X2)2 / n2)


= 1216.33 (92.52 / 9)
= 636.46 (68.42 / 9)
= 265.64
= 116.62
Step 7: Compute t and compare to tvc
t=

M1 - M 2
(SS1 + SS2) / df) ((1/n1) + (1/n2)

10.28 - 7.60
__
(265.64 + 116.62) / 16) ((1/9) + (1/9)
16
382.26/(0.11+0.11)

2.68

2.68
5.25

2.68
2.29

1.17
What should we conclude?
The calculated value of t is lesser than the tabulated value of t.
Therefore the null hypothesis is accepted. There is no difference in the
amount of moisture damage suffered by each bin of corn.

In any given research situation, how do we decide which type of t-test to use?
The following chart will help in deciding which type of t-test to use.

One Sample

Two Samples

Comparing to a population
Comparing
mean
new mean Comparing
to previous means
mean of matched
Comparing
subjects
two separate means

Use Single Sample t-test


Use Dependent Samples t-test
Use Independent Samples t-test

Exercise
t- Test

A. Solve the following exercises.


1. Ms. Chua owns a Chinese restaurant, and wants to increase business during
the weekday lunch hours. She tends to average 45 lunch guests per day on
weekdays. To increase this number she offers a 10% discount on weekdays.
She keeps a count for 8 weeks, and finds she has an average of 48
customers with s = 3.46. Evaluate her hypothesis at = .01.
Step 1: State the hypotheses:
Ho:

Step 2: Determine the cvt:


df = n-1 =
cvt =
Step 3: Compute t:
M
s /n
t=

What is your conclusion?

2. Last year on Halloween, a local hospital offered children a trade. They could
bring the candy they collected trick-or-treating to the hospital, and trade it in
for a free check-up from their nurse practitioners. This year, in order to
increase the childrens visits, the hospital mailed letters to the parents of the
same children asking the parents to encourage their children to make this
trade. Each of 9 nurse practitioners was asked to report the number of

children that came in for a check-up. Below is a sample of the data obtained
last year, and this year. At = .05, find out if significantly more of these
children traded their candy for a free check-up this year, over last year.
Step 1: State the Hypotheses
Ho:

Step 2: Determine tcv:


df = n-1 =

tcv =

Step 3 and 4: Find the difference and difference squared scores


Last Year
8
10
7
6
9
5
4
11
10

This Year
6
11
13
6
12
8
7
10
18

Step 5. MD =
Step 6. sD =

Step 7: Compute t
t =

MD
sD / n

D2 - ((D)2 / N)
n-1

D2

What is your conclusion?


3. Another hospital offered to trade children for their Halloween candy. This
hospital, however, offered half the children a free check-up, and offered the
other half a coupon for a free ice cream sundae from a local restaurant. A
sample of the data, as reported by 8 nurse practitioners, appears below. At
= .05, which group of children was significantly more likely to trade in their
candy?
Step 1: State the Hypotheses
Ho:

Step 2: Determine tcv:


df = (n + n) - 2 =

tcv =

Step 3 and 4:
Check Up (X1)
4
5
3
9
2
6
7
4

Step 5: M1 =

Ice Cream (X2)


6
9
2
8
5
6
10
6

X12

M2 =

Step 6: SS1 = X12 ((X1)2 / n1)SS2 = X22 ((X2)2 / n2)

X22

Step 7: Compute t and compare to tvc


t=

M1 - M 2
(SS1 + SS2) / df) ((1/n1) + (1/n2)

What is your conclusion?

B. Considering the following situations, what is the appropriate t-test to


use? Encircle your answer.
1. Many American adults have triglyceride levels that are higher than the healthy
limit of 150 or less. Dr. Carter is a dietician who believes that 30 minutes of
exercise, 5 days per week, will lower triglycerides. She gathers a sample of 6
adults whose triglyceride levels measure beyond 150, has them walk on a
treadmill for hour a day for 8 weeks, then measures their triglyceride levels
again.
Single Sample

Dependent Sample

Independent Sample

2. Mr. Garcia is interested in improving his track teams 100 yard dash average.
He divides his team of 20 students into two groups. He pairs his two best
runners, and puts one in each group. He does the same with his two second
best, his two third best, etc. He gives the first group extra training for two weeks,
and compares them to the second group to find out if extra training improves the
average speed of the runners.
Single Sample

Dependent Sample

Independent Sample

3. Mr. Sanchez wants to improve the playing of the flute-players in his 8 th grade
orchestra. He randomly selects 6 flute-players, and spends an hour a day giving
private music lessons to each child for 6 weeks. He then compares them to the
remaining flute-players to check for improvement.
Single Sample

Dependent Sample

Independent Sample

4. Ms. Oliveros owns the Hotel Paradise in Hawaii, and wants to increase her
occupancy for the summer months. In previous years, she has averaged 200
guests per night during the summer. In an effort to increase occupancy, she
advertises her hotel nationally throughout the winter months, then takes a count
of how many guests stay at her hotel the following summer.
Single Sample

Dependent Sample

Analysis of Variance (ANOVA)

Independent Sample

Table 1.1

In statistics, analysis of variance is a collection of statistical models, and their


associated procedures, in which the observed variance is partitioned into components
due to different explanatory variables. In its simplest form ANOVA gives a statistical test
of whether the means of several groups are all equal, and therefore generalizes
Student's two-sample t-test to more than two groups.
In practice, there are several types of ANOVA depending on the number of
treatments and the way they are applied to the subjects in the experiment:
One-way ANOVA
Two-way ANOVA
Factorial ANOVA
Mixed Design ANOVA
Multivariate analysis of variance (MANOVA)
ANOVA or f-test is an extension of the t-test, which is used in determining the
non-significance of difference of three or more group of values.
Decision Rules to be followed:

One way Analysis of Variance


In Joses Farmville, an experiment was devised to test if fruit yield from three
experimental blocks differ significantly from each other. The fruit trees in the first block
were applied the Super-Grow fertilizer, the trees on the second block were fertilized by
Super-Duper fertilizer, and third block is considered as control. With given values for the
yield of the blocks, is there a significant difference among the treatments at 5% level of
significance?
Step 1: State the research question:
Is there a significant difference on the yield performance of the fruit trees
using:
a. Super-grow fertilizer;
b. Super Duper- grow fertilizer;
c. Natural Fertilizer?
Step 2: HA: There is a significant difference on the yield performance of the fruit trees
with regards to the mentioned criteria.

H0: There is no significant difference on the yield performance of the fruit trees
with regards to the mentioned criteria.
Step 3: Determine , decision rule, and F - critical value. (=0.05)
Decision rule:
If Fc is ___________ Ft or Fc is _________ -Ft, then reject H0.
Ft: ________________
Step 4: Arrange the data similar below.

Solution:
N= number

A
x

B
x

C
x

A
x2

B
x2

C
x2

20
22
18
20
23

15
18
15
17
23

20
22
18
20
23

400
484
324
400
529
213
7

225
324
225
289
529

400
484
324
400
529

103
~
x =20.

88
~
x =17

103
~
x =2

6
x =

.6
~
x t =19.

0.6

1592
2
x =5

2137

866

of cases

294
6
N= 15
20+22+18+20+23
~
x a=
=20.6 (Mean of Treatment A)
5
15+18+15+17+ 23
~
x b=
=17.6
5

(Mean of Treatment B)

20+22+18+20+23
~
xc=
=20.6
5

(Mean of Treatment C)

x 2=2137+1592+2137=5866
x=103+88+103=294

20.6+17.6+ 20.6
~
x t=
=19.6
3

(Total Sum of the Squared Scores)

(Sum of the Scores)


(Average of the Mean Scores)

Step 5: Compute for SSt, SSb, SSw, dfb, dfw, MSb, MSw, and for F.

Xt= ______

Total Sum of the Squares


2

SS t =x

(X )
N

Solution:
SS t =5866

(294 )2
15

SS t =5866

86436
15

SS t =58665762.4
SS t =103.6

Sum of the Squares Between

( X )2 ( X t )
SS b=

n
N
N= Total number of cases
n= Total number of cases in each treatment
Solution:

103 88 103
294
SS b=
+
+

5
5
5
15

SS b=

7744 10609 86436


+
+

( 10609
5
5
5 )
15

SS b=( 2121.8+1548.8+ 2121.8 )5762.4

SS b=5792.45762.4
SS b=30

Sum of the Squares within Groups


SS w =SS A +SS B + SS c
Sum of the Squares in a Group
2

( X )
SS= X
n
2

Solution:
2

SS A =2137

(103)
5

SS A =2137

10609
5

SS A =21372121.8
SS A =15.2

SS B =1592

(88)
5

SS B =1592

7744
5

SS B =15921548.8
SS B =43.2

SS C =2137

(103)
5

SS C =2137

10609
5

SS C =21372121.8
SS C =15.2

SS W =15.2+ 43.2+15.2
SS W =73.6

The within sum-of-squares added to the between sum-of-squares should total


the total sum-of-squares:
SS T =SS W + SSB
SS T =73.6+30
SS T =103.6
It follows, then, that the within sum-of-squares can be directly by subtracting the
between sum-of-squares from the total sum-of-squares:
SS W =SS T + SSB
Degrees of Freedom
There are 15 cases in the problem that we are working, have N-1, or 14, degrees
of freedom. In group A there are 5 cases; hence there are 4 degrees of freedom for this
group, and since in this problem the number of cases is the same in each problem,
there are 4 degrees of freedom in each of the other groups. So far, we have accounted

for 12 of the total number of degrees of freedom. We have three groups. Then it
follows that there are 2 degrees of freedom for the groups. Then it follows that there are
2 degrees of freedom for the groups. To generalize:
df for total groups= number of cases in total (N) minus 1
df for groups between= number of groups (k) minus 1
df for groups within= sum of the number of cases within each subgroup (n) minus 1. (n1-1) + (n2-1) +...
+ (nk-1)
Therefore:
df for total groups= 15 - 1= 14
df for groups between= 3 - 1= 2
df or groups within= (5-1) + (5-1) + (5-1)= 12
Mean Square Between
MS B=

SS B
df B

MS B=

30
2

MS B=2

Mean Square Within


SS
MS w = w
df w
MS w =

73.6
12

MS w =6.13

F- Test

The F value is the ratio of the Mean Square Between and Mean Square Within.
In equation:
MSB
F=
MSW
F=

2
6.13

F=0.33

Step 6: Make a summary table.


Source of Variation
Between Groups
Within Groups
Total

Degrees of
Freedom

Sum of
Squares

Mean
Squares

Computed
F -Value

Tabulated
F Value*

VI

Ho

2
12
14

30
73.6
103.6

2
6.13

0.33

3.88

NS

*Please refer to the table of F distribution

Step 7: Make an interpretation.


The table shows that the computed value of F is 0.33 while the tabulated value of F
at 0.05 level of significance is 3.88. This reveals that the computed value is lesser than
the tabulated value. Therefore, there is no significant difference in the yield
performance of the fruit trees with regards to the mentioned criteria. And the null
hypothesis is accepted.
Two way Analysis of Variance
In the table below are responses of 40 male and female high school students to
an attitudinal scale. Each group of 40 was randomly divided into two groups of ten
each, and then each of these groups of 10 was shown one of the four different films of a
controversial subject. Later the attitudinal scale on this subject was administered to
each individual. For the study, we will use the 0.05 level of significance.
Step 1: State the research question:
Is there a significant difference on the responses of the group of male and
female students on the attitudinal scale when exposed to four different films of
controversial subject?

Step 2: HA: There is a significant difference on the responses of the group of male and
female students on the attitudinal scale when exposed to four different controversial
films.
H0: There is no significant difference on the responses of the group of male and
female students on the attitudinal scale when exposed to four different controversial
films.
Step 3: Determine , decision rule, and F - critical value. (=0.05)
Decision rule:
If Fc is ___________ Ft or Fc is _________ -Ft, then reject H0.
Ft: ________________
Step 4: Arrange the data similar on the following table.

Film
1

Males
10
8
6
4
4
4
2
2
2
1
=43
14
12
12
10
8
6
4
2
2
1
=71
c=114

14
13
12
12
8
10
4
9
4
9
4
7
3
4
2
4
2
4
1
2
54
74
Females
14
10
13
10
12
10
11
9
10
9
9
7
7
7
6
6
3
5
2
4
87
77
141
151

16
12
10
9
9
7
7
6
5
5
86

=257

18
16
15
14
13
10
10
10
10
9
125
211

=360
Xt=617

Step 5: Compute for the following:


Squares and their sum
X 2t =102 +82 +6 2 .+92
X 2t =6159

Total Sum of Squares


(X t )2
SS T = X
Nt
2
t

SS T =6159

(617)
80

SS T =6159

(617)2
80

SS T =61594758.6
SS T =1400.4
Sum of Squares Within
( X k )2
SS w = X
N
2
t

43 +54 +74 + 86 +71 +87 +77 +125


SS w =6159
10

SS w =6159

51801
10

SS w =61595180.1
SS w =978.9
Sum of Squares between Columns
Xc

Xt

SS c =
2

617

114 2+1412 +1512 +211 2


SS c =

20

SS c =

100199
4758.61
20

SS c =5009.954758.61
SS c =251.34

Sum of Squares between Rows

Xr

Xt

SS r =
2

SS r =

257 +360 617

40
80

SS r =

195649
4758.61
40

SS r =4891.224758.61
SS r =132.61
Sum of Squares between Interaction
SS c .r =SS t SS w SSc SSr
SS c .r =1400.4978.9251.34132.61
SS c .r =37.6
Degrees of Freedom
df for total groups = Nt
df for groups within = k(N-1)
df for groups between columns = c-1
df for groups between rows = r-1
df for groups between interaction = (c-1)(r-1)

Solution:

dft = 80-1=79
dfw = 8(10-1)=8(9)= 72
dfc = 4-1=3
dfr = 2-1=1
dfc.r = (4-1) (2-1) =3(1) = 3

Mean Square Within


MS W =

SS w
df w

MS W =

978.9
72

MS W =13.6

Mean Square between Columns

MS C =

SS c
df c

MS C =

251.34
3

MS C =83.78
Mean Square between Rows
SS
MS r= r
df r

MS r=

132.61
1

MS r=132.61

Mean Square between Interaction


MS c. r=

SSc .r
df c .r

MS c. r=

37.6
3

MS c. r=12.53

F- Test
The F value is the ratio of the Mean Square Between (Columns, Rows and
Interaction) and Mean Square Within.
MSB
F=
MSW
Solution:
Fc =

83.78
=6.16
13.6

Fr =

132.61
=9.75
13.6

F c . r=

12.53
=0.92
13.6

Step 6: Make a summary table.


Source of
Variation

Sum of
Squares

Degrees
of
Freedom

Mean
Squares

Computed
F -Value

Tabulated
F Value*

VI

Ho

Between
Columns
Rows
interaction

251.34
132.61
37.6

3
1
3

83.78
132.61
12.53

6.16
9.75
0.92

2.74
3.98
2.74

S
S
NS

rejected
rejected
accepte
d

Within Groups
Total

978.9
1400.4

72
79

13.6

*Please refer to the table of F distribution

Step 7: Make an interpretation.


The table reveals that the computed value of F between columns and rows are
greater that the tabulated value. Therefore we can say that there is a significant
difference in the response of the students in the attitude scale with regards to the
controversial films and sex. While in the interaction the computed value is lesser than
the tabulated value. This means that there is no significant difference in the scores of
the students with regards to the interaction of male and female with the controversial
films.

Potrebbero piacerti anche