This document contains the plot of predicted probabilities from each individual study, as well as the weighted average effect, from the three-way interaction of neuroticism by conscientiousness by age.

Code

The following packages were used to generate this figure:

library(tidyverse)
library(metafor)
library(here)

The files needed for this table are available at osf.io/mzfu9 in the Meta Analysis Output folder.

First we load the meta-analysis objects. To see how these objects were created, see the meta-analysis script titled drinker_meta-analysis.R that are available at osf.io/kb9e8.

load(here("behavior/created data/plot_drinker_age.Rdata"))

We plot the values.

drinker.plot.age %>%
  ggplot(aes(x = x, y = predicted)) +
  geom_ribbon(aes(ymin=lower, ymax=upper), fill="black", alpha=.15,
              data = weighted.vals.age)+
  geom_line(aes(color = study), lty="dashed") +
  geom_line(data = weighted.vals.age, color="black") +
  scale_x_continuous("Neuroticism")+
  scale_y_continuous("Probability of \n being a current drinker") +
  facet_grid(facet~group)+
  theme_minimal()+
  theme(legend.position = "bottom")