In this computer lab, we will extend our understanding of one-way ANOVAs, by practicing what we have learnt in Topic 7.
🏡 One-way ANOVA is used to test for differences in means between two or more independent groups. For this question, we will assess the life expectancy of people living on the different continents around the world (excluding Antarctica!), using data from the gapminder
R package (Gapminder 2021a), also (Gapminder 2021b).
This data set contains life expectancy, population size, and GDP per capita data on 142 different countries, in 5 different continents, recorded between the years 1952 to 2007. In this computer lab, we will be focussing our analysis on the data recorded for 2002.
For this question, we are interested only in the following variables:
lifeExp
(life expectancy): years at birthcontinent
\(^\dagger\) (Africa, Americas, Asia_Oceania)\(^\dagger\) Note that for this data set, North America and South America have been combined into the (super) continent Americas. Oceania includes Australia and New Zealand, and has been combined with Asia to form the category called Asia_Oceania.
🏡 Download the gapminder_2002.csv
file from the LMS, and save it in a relevant location on your PC.
Once you have done so, import the gapminder_2002.csv
file in jamovi.
🏡 Create a table of descriptive statistics, as well as descriptive plots, for the lifeExp
variable, split by continent
. In your exploratory analysis, include the following:
🏡 What do you observe from your results for 1.2?
🏡 We would like to test, at the \(5\%\) level of significance, whether people’s average life expectancy at birth differs depending upon the continent in which they live. In order to carry out our one-way ANOVA, we first need to clearly define our null and alternative hypotheses.
Suppose that we let \(\mu_1\) denote the true (population) average life expectancy at birth of people born in Africa.
Using this notation as a guide, define an appropriate \(H_0\) and \(H_1\). 💬
Hint: Check the Topic 7 readings if you are unsure.
💻 Carry out the one-way ANOVA described in part 1.4 above in jamovi.
🏡 Write a brief statement that summarises your results from the one-way ANOVA analysis. 💬
🏡 So far, we have proceeded assuming that the one-way ANOVA test assumptions were satisfied for our analysis. We should check these assumptions now.
We know that the data are numeric, and we can assume that the observations are independent. However, we still need to test for the equality (homogeneity) of variances between the groups.
To check this, use the result of the Levene’s test provided by jamovi. Using the \(p\)-value to support your decision, what do you conclude? 💬
🏡 Finally, we need to check the normality of the residuals for our one-way ANOVA.
Create a histogram of the residuals, and overlay a density curve. Also create a Normal Q-Q plot of the residuals.
Based upon visual inspection of these plots, what do you conclude? 💬
🏡 To support your decision, we can carry out a formal statistical test. Use the Shapiro-Wilk test to assess the normality of the residuals.
What do you find? Does this support your answer to 1.8? 💬
💻 Regardless of your conclusions above, we will proceed under the assumption that our one-way ANOVA test assumptions have been safely met. Our next step is to conduct a Tukey HSD post-hoc test.
Carry out post-hoc tests in jamovi using the Tukey correction.
🏡 Interpret the results of the Tukey post-hoc test for any 2 of the 6 comparisons. Which, if any, comparisons are statistically significant? Are there any comparisons that are not statistically significant? 💬
🏡 To conclude, report the estimated effect for our one-way ANOVA test, and interpret this effect size. 💬
💻 If you have time, repeat Question 1, but this time use the variables:
gdpPercap
(GDP per capita)Continent
(Africa, Americas, Asia_Oceania, Europe)These notes have been prepared by Amanda Shaker and Rupert Kuveke. The copyright for the material in these notes resides with the authors named above, with the Department of Mathematical and Physical Sciences and with La Trobe University. Copyright in this work is vested in La Trobe University including all La Trobe University branding and naming. Unless otherwise stated, material within this work is licensed under a Creative Commons Attribution-Non Commercial-Non Derivatives License BY-NC-ND.