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.
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 smoker_meta-analysis.R
that are available at osf.io/9s52x.
load(here("behavior/created data/plot_smoker_age.Rdata"))
We plot the values.
smoker.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") +
facet_grid(facet~group) +
theme_bw() +
theme(legend.position = "bottom")+
scale_x_continuous("Neuroticism")+
scale_y_continuous("Probability of \n being a current smoker") +
facet_grid(facet~group)+
theme_minimal()+
theme(legend.position = "bottom")