Section 8.3 One-Way Analysis of Variance
In this chapter, we will focus on one-way ANOVA, a statistical method used to analyze differences among the means of three or more independent groups on a single dependent variable. It is important to note that there are other types of ANOVA as well. For instance, two-way ANOVA examines the effects of two categorical independent variables on a single continuous dependent variable.
You will first need to load the data. You will download the file from the shared Google Drive folder containing the
media and police.sav data. Since the data is an SPSS file, you will follow the steps that we covered previously. Each row represents each participant. Condition refers to the experimental condition to which each participant was assigned. ConPolT1 represents respondentsβ confidence in the police before watching the video, and ConPolT2 represents respondentsβ confidence in the police after watching the video.
library(haven)
media_and_police <- read_sav("media and police.sav")
View(media_and_police)
When importing an SPSS file into an R environment, you might encounter the need for data recoding to effectively manage and clean your data. For instance, you may need to adjust the data type of certain variables for better suitability. In this case, letβs focus on recoding the
Condition variable.
We aim to change the data type of the
Condition variable to a factor and add category labels to enhance clarity. Specifically, we will label the categories as follows:
-
1 = positive police image
-
2 = negative police image
-
3 = mixed police image (both positive and negative police images)
We learned how to recode a variable and add category labels in a previous chapter.
library(tidyverse)
media_and_police_cleaned <- media_and_police %>%
mutate(Condition = as.factor(Condition))
class(x = media_and_police_cleaned$Condition)
media_and_police_cleaned <- media_and_police_cleaned %>%
mutate(Condition = recode(Condition,
"1" = "Positive Police Video",
"2" = "Negative Police Video",
"3" = "Mixed Police Video"))
summary(media_and_police_cleaned)
Subsection 8.3.1 NHST Steps for One-Way ANOVA
We may want to determine whether there is a significant difference in the mean scores for confidence in the police across groups who watched different videos. As mentioned in previous chapters, NHST intends to draw conclusions about the population based on the data from our sample.
Subsubsection 8.3.1.1 Step 1: Formulate the Null and Alternative Hypotheses
-
\(H_0\text{:}\) The mean scores for confidence in the police are equal across groups who watched different videos.
-
\(H_A\text{:}\) The mean scores for confidence in the police are not equal across groups who watched different videos.
Subsubsection 8.3.1.2 Step 2: Calculate the Test Statistic
police.by.con <- oneway.test(formula = ConPolT2 ~ Condition,
data = media_and_police_cleaned,
var.equal = TRUE)
police.by.con
The F statistic is 0.49287.
Subsubsection 8.3.1.3 Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists
The p-value obtained is 0.6114, which is considerably larger than the conventional significance level of 0.05. When the p-value is this large, it suggests that the observed result is not statistically significant, indicating no evidence to reject the null hypothesis. It is common to observe such small F-statistics when the null hypothesis is true.
Subsubsection 8.3.1.4 Steps 4 & 5: If the P-Value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis
With a p-value \(> 0.05\text{,}\) the ANOVA indicates that these groups likely came from a population with similar mean scores for confidence in the police by different experimental conditions.
Subsection 8.3.2 Reporting the Results From One-Way ANOVA
A one-way ANOVA was conducted to explore the impact of media exposure on confidence in the police. Participants were randomly assigned to watch one of the three conditions (Group 1: Positive Police Video, Group 2: Negative Police Video, and Group 3: Mixed Police Video). There was no statistically significant difference at the \(p < .05\) level in confidence in the police \(F(2, 296) = 0.49\text{,}\) \(p = 0.61\text{.}\)
