Lesson 5.3: Inference for Multiple Means Using ANOVA
Software Lab 5.3
Comparing Multiple Means
As you work through the lab, answer the ungraded exercises in the shaded boxes. Check your answers by consulting the Software Lab 5.3 Solutions.
Remember to complete the graded Software Lab Questions for this section in Moodle.
Exam Scores from Three Different Lectures: The Data
Download classdata [CSV file] (OpenIntro, n.d.) and load it into jamovi. This dataset represents exam scores of 164 students from three different lectures who were all given the same exam. This dataset is analyzed in Section 7.5.6 in the textbook. The variables we’ll be using in this lab are:
m1
: first midterm exam scorelecture
: a, b, or c
Data Exploration
Analyses > Exploration > Descriptives
, move m1
to the Variables
box, move lecture
to the Split by
box, and select N
, Mean
, and Std. deviation
. Unselect everything else. Confirm that the summary statistics match those in the textbook. Check your answer by consulting the Software Lab 5.3 Solutions.Plots
select Q-Q
. Do the normal probability plots affirm the nearly normal condition within each group?ANOVA F-Test
Is there convincing evidence that the average exam score varies by lecture? We’ll conduct an ANOVA F-test to answer this question.
The hypotheses are H0: versus HA: at least one mean is different. The test statistic
can be modeled by an F-model with
numerator degrees of freedom and
denominator degrees of freedom, assuming the following conditions are satisfied:
- Independence: The observations are independent within and between groups.
- Nearly Normal Condition: The observations within each group are nearly normal.
- Variability: The variability within each group is approximately the same.
Analyses > ANOVA > One-Way ANOVA
, move m1
to the Dependent Variables
box, move lecture
to the Grouping Variable
box, and under Variances
select Assume equal (Fisher's)
. Unselect Don't assume equal (Welch's)
if it is selected already. Confirm that the F-statistic and p-value match the values in the textbook.R > Rj Editor
and run the following code: 1-pf(3.48, df1=2, df2=161)
.![Rendered by QuickLaTeX.com \alpha = 0.05](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-ad6ce5c9ea5f3e49e839c4b3d5273902_l3.png)
Multiple Comparisons
Bonferroni Correction
Post-Hoc Tests
and under Post-Hoc Test
select Tukey (equal variances)
and under Statistics
select Test results
. Make sure you unselect Report significance
because this outputs adjusted p-values for Tukey’s range test, not the unadjusted p-values we’re going to need here. Compare the t-values
in the jamovi output with the t-scores in the textbook. Hint: The numbers won’t match exactly because the textbook uses rounded numbers in its calculations. Also, the t-scores for lecture A versus lecture C, and for lecture B versus lecture C, should really be negative since the lecture C sample mean score is the highest.R > Rj Editor
and run the following code: 2*(1-pt(1.23, df=161))
, 2*pt(-1.47, df=161)
, and 2*pt(-2.64, df=161)
. Again, the p-values won’t match exactly due to rounding errors in the textbook calculations.Tukey’s Range Test (Tukey’s HSD)
Post-Hoc Tests
and under Post-Hoc Test
select Tukey (equal variances)
and under Statistics
select Report significance
. Report the adjusted p-values
in the jamovi output.References
OpenIntro. (n.d.). Data sets [Data sets]. https://openintro.org/data/