Here is my code:
ggplot() + labs(x = "Age",
y = 'Frequency',
title = "Histogram comparison between real and synthetic data") +
geom_histogram(aes(r_data)) +
stat_function(fun = dnorm,
geom = "area",
color = 'white',
fill = "lightgrey",
alpha = 0.2) +
geom_histogram(aes(region_sum_stats$mean_age),
color = 'white',
fill = 'steelblue',
alpha = 0.8)
These are the histograms:
I'd love some help on this!
Thanks in advance!