Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Table of Contents

Week 11: T-tests and ANOVA......................................................................................................2


Problem 1: Paired Sample - Eggs............................................................................................2
The steps in SPSS to run a paired sample t-test are as follows:...........................................3
Problem 2 – One sample T-test................................................................................................3
The steps in SPSS for a one sample t-test are as follows:....................................................3
Problem 3: Independent Samples T-test..................................................................................4
The steps for an independent t-test SPSS:............................................................................5
Problem 4: ANOVA...................................................................................................................6
What is an ANOVA?...............................................................................................................6
The steps in SPSS for a One-Way ANOVA in SPSS:............................................................7

Dr J. Campton 1
© University of The Sunshine Coast
Week 11: T-tests and ANOVA

Problem 1: Paired Sample - Eggs

“Producers across Australia have carved a niche market


with pastured eggs, which come from chickens that
spend their day grazing paddocks and roosting in mobile
vans, at a stocking density lower than free-range
requirements.” (Pancia, 2016)
Watch the video on:
https://www.abc.net.au/news/rural/2016-09-02/pastured-
eggs-finding-a-market/7807984
Like Colleen and Charlie Roberts in the video - the Feather Family has upgraded their
farm from Caged hens to a Pastured system.
The feather family wants to know whether the change from the old farming system to
the new has produced heavier eggs?
As heavier eggs can be sold for more money.
See: https://www.australianeggs.org.au/learn-about-egg-farming/
To know about the different types of egg farming.
1.1. Which T-test would be best for this problem?

1.2 What is the null and alternative hypothesis?

Since some of the egg laying hens were used for the updated farming technique, we
need to run a paired samples t-test. You run a paired sample t-test to identify if the
weight of the eggs is significantly different.

Dr J. Campton 2
© University of The Sunshine Coast
Note. This practice example is not designed to offend or insult anyone’s egg purchasing
behaviour. Merely to highlight new farming technologies and industries.

The steps in SPSS to run a paired sample t-test are as follows:


 Go to Analyze> Compare Means> Paired-Samples T-Test
 Arrow over before_caged and After_pastured
 Select OK to run
Note that the dataset represents the average weight in grams over a month – with 12
months’ worth of data.
1.3 Is the result significant?

Yes p<.05 or no p>.05?

1.4 What does this mean for the Feather family? Should they continue to change
the rest of their farms to Pastured?

What would you recommend?

1.2 Write up:


Make sure you state the null and alternative hypothesis
State which one is rejected
Name the test and report the test statistic
Give a recommendation

Paired Samples Statistics


Mean N Std. Deviation Std. Error Mean
Pair 1 Before_Caged 491.6667 204 137.01306 9.59283
After_Pasturised 639.1667 204 127.04695 8.89507

Paired Samples Test

Dr J. Campton 3
© University of The Sunshine Coast
Paired Differences
95% Confidence
Interval of the
Std. Std. Error Difference Sig. (2-
Mean Deviation Mean Lower Upper t df tailed)
Pair Before_Caged - - 142.96775 10.00974 - - - 203 .000
1 After_Pasturised 147.50000 167.23640 127.76360 14.736

Problem 2 – One sample T-test

The Feather Family would like to sell the Pastured


eggs they have with the advertising statement that
they will always be 700 grams.
You run a One Sample T-test to see if this
statement can be used.
A One Sample T-Test determines whether the
sample mean is statistically different from a known
or hypothesized population mean.
The steps in SPSS for a one sample t-test are as follows:
 Go to Analyze> Compare Means > One Sample T Test
 Move “After_Pastured” into the “Test Variable(s)” box
 In the “Test value box” Enter the number 700
 Select the “options” and ensure that the “Confidence Interval” is 95
 Select “Ok” to run the test

2.1 Is the test significant?

2.2 What is the confidence interval for the difference?


Note. This reports the confidence interval for the difference between the specified
test value and the sample mean.

Dr J. Campton 4
© University of The Sunshine Coast
 Run the Test again but this time enter the test value of 500

2.2 Is the test significant?

2.4 What would you recommend to the Feather Family based on this result? What
can they claim for their marketing?

2.5 What else could we use that might give us a better indication of what the weight
might be 95% of the time on average? (Hint: Something we learned in the content
last week)

Problem 3: Independent Samples T-test

The Feather Family has two main types of egg laying


hens:
1) Barred Plymouth Rock
2) The Frizzle

See:
https://www.backyardchickencoops.com.au/blogs/learning-centre/different-breeds-and-
types-of-chickens
They would like to know which breed of hen lays heavier eggs?

Dr J. Campton 5
© University of The Sunshine Coast
3.1 What is the null and alternative hypothesis?

The steps in SPSS for an independent t-test SPSS:


 Go to Analyse> Compare Means> Independent T-test
 Arrow over Weight into the “test variables” box
 Arrow over Breed into the “grouping variable” box - click the define groups
button. This is where we tell the program that Plymouth = 1 and Frizzle = 2. Put
the value 1 into “group 1” and 2 into “group 2”. Select continue
 Click the options button and check that descriptives is selected.
 Hit “OK” to run

3.2 Check Levene’s test for equality of variances: is this significant? If it is this means it
is breached - which line, should you read for the t-test? (Equal variances assumed
or equal variances not assumed?)
3.3 Are the results of the t-test significant?

3.4 Write up:


Make sure you state the null and alternative hypothesis
State which one is rejected
Name the test and report the test statistic
Give a recommendation based on the results

Dr J. Campton 6
© University of The Sunshine Coast
Problem 4: ANOVA

We have figured out which breed of chicken is the most appropriate.


Now we want to know what type of feed will produce the
heaviest eggs.

✢ There are four types of chicken feed:


○ Layer chicken feed
○ Mash
○ Crumble
○ Pellets

✢ Each type of feed is of varying contents, price, and quality.


See this website for details: https://www.backyardchickencoops.com.au/blogs/learning-
centre/all-the-different-types-of-chicken-feed-explained

What is an ANOVA?

“One-Way ANOVA ("analysis of variance") compares the means of two or more


independent groups in order to determine whether there is statistical evidence that the
associated population means are significantly different. One-Way ANOVA is a
parametric test.
The variables used in this test are known as:
 Dependent variable
 Independent variable (also known as the grouping variable, or factor)
o This variable divides cases into two or more mutually exclusive levels, or
groups

The null and alternative hypotheses of one-way ANOVA can be expressed as:

Dr J. Campton 7
© University of The Sunshine Coast
H0: µ1 = µ2 = µ3 = ... = µk ("all k population means are equal")
H1: At least one µi different ("at least one of the k population means is not equal to the
others")
The test statistic for a One-Way ANOVA is denoted as F. For an independent variable
with k groups, the F statistic evaluates whether the group means are significantly
different.”
The steps in SPSS for a One-Way ANOVA in SPSS:

Click Analyze > Compare Means > One-Way ANOVA.


Move the Dependent Variable - Weight into the “Dependent list”
Then move the grouping variable Feed-Types into the “Factor” Box.

Select “Post-Hoc” and tick ✔ “Tukey” > Continue

Select “Options” and tick ✔ “Descriptive” and “Means plot” > Continue

Hit “OK”
Questions
4.1 What is the null and alternative hypothesis?

4.2 Is the omnibus ANOVA statistically significant at  = .05? Can the null hypothesis
be rejected?

4.3 Which of the post hoc comparisons were statistically significant? Which were
not?

Dr J. Campton 8
© University of The Sunshine Coast
4.4 Write up the results
Make sure you state the null and alternative hypothesis
State which one is rejected
Name the test and report the test statistic (including the post hoc test)
Give a recommendation

Descriptives

Weight

95% Confidence
Std. Std. Interval for Mean Minimu
N Mean Maximum
Deviation Error Lower Upper m
Bound Bound

759.859 742.009
Layer 71 75.41301 8.94988 777.7091 650.00 850.00
2 2

458.000 444.490
Mash 65 54.52064 6.76245 471.5096 400.00 545.00
0 4

591.562 583.106
Crumble 48 29.12110 4.20327 600.0184 545.00 650.00
5 6

679.891 668.866
Pellets 46 37.12575 5.47389 690.9163 600.00 750.00
3 3

623.434 606.293
Total 230 131.93201 8.69934 640.5758 400.00 850.00
8 8

ANOVA

Weight

Dr J. Campton 9
© University of The Sunshine Coast
Sum of
df Mean Square F Sig.
Squares

Between Groups 3295765.661 3 1098588.554 359.712 .000

Within Groups 690220.861 226 3054.075

Total 3985986.522 229

Multiple Comparisons
Dependent Variable: Weight
Tukey HSD
95% Confidence
Mean Interval
(I) (J) Std.
Difference Sig.
Feed_Types Feed_Types Error Lower Upper
(I-J)
Bound Bound

Mash 301.85915* 9.48688 .000 277.3048 326.4136

10.3267
Crumble 168.29665* .000 141.5685 195.0248
Layer 5

10.4598
Pellets 79.96785* .000 52.8952 107.0405
3

-
Layer 9.48688 .000 -326.4136 -277.3048
301.85915*

- 10.5172
Mash Crumble * .000 -160.7837 -106.3413
133.56250 4

- 10.6479
Pellets * .000 -249.4508 -194.3318
221.89130 4

- 10.3267
Layer * .000 -195.0248 -141.5685
Crumble 168.29665 5

Mash 133.56250* 10.5172 .000 106.3413 160.7837

Dr J. Campton 10
© University of The Sunshine Coast
4

11.4026
Pellets -88.32880* .000 -117.8416 -58.8160
1

10.4598
Layer -79.96785* .000 -107.0405 -52.8952
3

10.6479
Pellets Mash 221.89130* .000 194.3318 249.4508
4

11.4026
Crumble 88.32880* .000 58.8160 117.8416
1

*. The mean difference is significant at the 0.05 level.

✢ Homework: Make sure you know:


○ The difference between the 3 t-tests and ANOVA
○ How to identify if the tests are significant at the cut-off value .05
○ How to interpret results for a real business implication/recommendation

Dr J. Campton 11
© University of The Sunshine Coast

You might also like