library(mosaic)
library(DT)
library(pander)
library(car)
library(tidyverse)
# Record your data from your own mini experiment in Excel.
# Save the data as a .csv file in the Data folder of the Statistics-Notebook.
# Read in the data
FlirtyBeans <- read_csv("../../Data/FlirtyBeans.csv")
# reorder bean_levels from least to greatest mention
FlirtyBeans <- FlirtyBeans %>%
mutate(bean_level = factor(bean_level, levels = c("none", "mentioned", "focus")))
Babeak (ba-BEEK) is a young adult Mii who is looking for another Mii to share her life with.
There is an old Mii proverb: “Beans are the key to love.” Babeak has decided to put this to the test. She designs an experiment to see just how much beans influence romance.
She plans to flirt with young adult male Miis for five minutes in a donut shop. She will include beans in the conversation in varying intensities. After the five minute interaction, she will ask the him to rate his interest in her romantically on a scale of 1-100.
Her Mii passport only allows her to live in two places: Australia and the Netherlands. So, she is also curious if the male Mii’s nationality makes a difference in their response to her mention of beans.
We will use a Two-way ANOVA test to analyze the relationships between Babeak’s interest scores, the degree to which she mentions beans in her interactions, and the country in which the interactions take place.
We will use a significance level of \(\alpha\) = 0.10
Does the degree to which Babeak includes beans in her flirtatious interaction influence her interest score? \[ H_0: \mu_\text{none} = \mu_\text{mentioned} = \mu_\text{focus} = \mu \] \[ H_a: \mu_{i} \neq \mu \text{ for at least one i} \in \text{1 = none, 2 = mentioned, 3 = focus} \]
Does one nationality of male Miis give Babeak a higher interest score than another? (Netherlands = NL, Australia = AU) \[ H_0: \mu_\text{NL} = \mu_\text{AU} = \mu \]
\[ H_a: \mu_\text{NL} \neq \mu_\text{AU} \]
Does the mention of beans influence Babeak’s interest score depending on the male Mii’s nationality? \[ H_0: \text{The effect of the Bean Intensity on Babeak's interest score is the same in each country} \]
\[ H_a: \text{The effect of the Bean Intensity on Babeak's interest score is NOT the same in each country} \]
# run test
flirty_beans_anov = aov(interest_score ~ bean_level + nationality + bean_level:nationality, data = FlirtyBeans)
par(mfrow=c(1,2))
plot(flirty_beans_anov, which = 1:2, pch = 16, col = "purple")
The population variance in each group cannot be assumed to be the same. As demonstrated by the Residuals vs Fitted plot on the left, the residuals vary greatly and at least one group is vertically double of another. All groups have a similar variance except the group plotted on the far right. The data from each group is approximately normally distributed, demonstrated by the Q-Q Residual plot on the right.
Because of large variance in residuals, we will continue with the analysis but note that it may not be accurate.
# run the test
flirty_beans_anov = aov(interest_score ~ bean_level + nationality + bean_level:nationality, data = FlirtyBeans)
summary(flirty_beans_anov) %>% pander()
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| bean_level | 2 | 759.3 | 379.7 | 3.68 | 0.03229 |
| nationality | 1 | 641.2 | 641.2 | 6.215 | 0.01602 |
| bean_level:nationality | 2 | 693.8 | 346.9 | 3.363 | 0.04264 |
| Residuals | 50 | 5158 | 103.2 | NA | NA |
# Stats summary for bean level
FlirtyBeans %>%
group_by(bean_level) %>%
summarize("Mean Interest Score" = mean(interest_score)) %>%
pander(caption = "Mean Interest Score according to Wool Type")
| bean_level | Mean Interest Score |
|---|---|
| none | 51.94 |
| mentioned | 55.28 |
| focus | 46.45 |
# graphical summary for bean level
ggplot(FlirtyBeans, aes(x = bean_level, y = interest_score, group = 1)) +
geom_point(color = "purple") +
stat_summary(fun = "mean", geom = "line") +
labs(
title = "Mentioning beans led to highest mean interest score",
x = "Bean Level",
y = "Interest Score") +
theme_minimal()
Mentioning beans during her flirtatious interactions gave Babeak the highest mean interest score (55.28). Her score when she didn’t mention beans was about 5 points below that, and focusing on beans, another 5 points lower.
# Stats summary for nationality
FlirtyBeans %>%
group_by(nationality) %>%
summarize("Mean Interest Score" = mean(interest_score)) %>%
pander(caption = "Mean Interest Score according to Nationality")
| nationality | Mean Interest Score |
|---|---|
| AU | 48.07 |
| NL | 53.83 |
# graphical summary for nationality
ggplot(FlirtyBeans, aes(x = nationality, y = interest_score, group = 1, color = nationality))+
geom_point() +
stat_summary(fun = "mean", geom = "line") +
scale_color_manual(values = c("NL" = "red2", "AU" = "blue2")) +
labs(
title = "Miis in the Netherlands had higher mean interest score than Australia",
x = "Nationality",
y = "Interest Score") +
theme_minimal()
While Miis in the Netherlands gave a wider variety of interest scores, Babeak’s mean score was more than 5 points higher in the Netherlands than in Australia.
# Stats summary for interaction
FlirtyBeans %>%
group_by(bean_level, nationality) %>%
summarize(ave = mean(interest_score), .groups="drop") %>%
spread(nationality, ave) %>%
pander( caption = "Mean Interest Score by Bean Level and Nationality")
| bean_level | AU | NL |
|---|---|---|
| none | 51.44 | 52.44 |
| mentioned | 47.7 | 64.75 |
| focus | 44.75 | 47.58 |
# graphical summary for bean level and nationality interaction
ggplot(FlirtyBeans, aes(x = bean_level, y = interest_score, group = nationality, color = nationality)) +
geom_point() +
stat_summary(fun = "mean", geom = "line") +
labs(
title = "Mentioning beans in the Netherlands maximizes interest score",
x = "Bean Level",
y = "Interest Score",
color = "Nationality") +
scale_color_manual(values = c("NL" = "red2", "AU" = "blue2")) +
theme_minimal()
We see that with Miis of both nationalities, the more Babeak mentioned beans, the lower her average interest score was – except when she mentioned beans in the Netherlands. Her average score was over 12 points higher than the next highest average, not mentioning them at all in the Netherlands.
To return to our three original questions:
Does the degree to which Babeak includes beans in her flirtatious interaction influence her interest score?
Yes – it mentioning beans in the interaction gave Babeak a mean interest score of 55.28. (p-value = 0.03229). Not mentioning beans at all was the next best option, and focusing on beans gave her the lowest mean score.
Does one nationality of male Miis give Babeak a higher interest score than another?
Yes – male Miis in the Netherlands gave Babeak a mean interest score 5.76 points higher than those in Australia. (p-value = 0.01602)
Does the mention of beans influence Babeak’s interest score depending on the male Mii’s nationality?
Yes – as demonstrated by the Interaction Graphical Summary, focusing on beans or making no mention of them didn’t vary from country to country. However, Babeak’s mean interest score reached 64.75 when she mentioned beans while flirting in the Netherlands, while receiving a mean interest score of 47.7 by doing the same thing in Australia. (p-value = 0.04264)
Babeak has determined there is only one clear course of action: FLIRT WITH MALE MIIS IN THE NETHERLANDS WHILE MENTIONING BEANS. Doing so resulted in a mean interest score of 64.75 for Babeak. She should not make beans the focus of her fliratious interactions, regardless of the country she is in.
All three p-values (0.033 for bean_level, 0.016 for nationality, and 0.043 for the interaction) were greater than our alpha of 0.01, so they are each statistically significant.
Babeak went on to find love in the Netherlands. She met Chalpako
(chal-PAHK-oh) in a donut shop 3 months after this experiment took
place. She only mentioned beans a couple times. Now, they love eating
beans together, going on walks, and practicing their swordplay and
archery skills.
ChatGPT was used to debug code. The presentation/format of this
analysis was loosely based on this
study on warpbreaks. Latex codes are from Brother Saunders’ stats
notebook. This dataset was created by ChatGPT with prompts from the
author, Mary: