Main Finding – Two Way Interaction
First, let’s look at the two way anova, looking at the number of trials completed comparing task by role model. The main term of interest is the p-value for the task:role model condition; in other words, we want to know whether the task by role model interaction is significant.
fit <- anova(lm(numtrials ~ task * rolemodel, d.tidy))
kable(fit, digits = 2)
| task |
1 |
37.41 |
37.41 |
3.21 |
0.15 |
| rolemodel |
1 |
17.61 |
17.61 |
1.51 |
0.29 |
| task:rolemodel |
1 |
17.19 |
17.19 |
1.47 |
0.29 |
| Residuals |
4 |
46.67 |
11.67 |
NA |
NA |
Graph of Main Finding – Two Way Interaction
This is the original chart from the paper for the key analysis:

This is my replicated finding:
ggplot(data = d.summarized,
aes(x = task, y = avgtrials, fill = rolemodel)) +
geom_bar(stat="identity", width = 0.5, position = "dodge") +
geom_errorbar(aes(ymin = (avgtrials - ci), ymax = (avgtrials + ci)),width = 0.1, position = position_dodge(width = 0.5)) +
scale_fill_manual(name="",
values = c("future" = "grey34","past" = "gray69"), #future is dark grey, past is light grey
labels = c("future" = "Motivated by Future Self", "past" = "Motivated by Past Self")) +
scale_x_discrete(labels = c("Fun Task", "Self-Control Task")) +
scale_y_continuous(breaks = 1:10)+
coord_cartesian(ylim=c(1,10)) +
labs(x = "Task Frame",
y = "Trials completed (min 1, max 10)") +
ggthemes::theme_few()
## Warning: Removed 1 rows containing missing values (geom_errorbar).
