sammo3182 / interplot

interplot: plotting interactive effects
Other
15 stars 4 forks source link

Add function to overlay histogram #13

Closed fsolt closed 8 years ago

fsolt commented 8 years ago

http://rpubs.com/kohske/dual_axis_in_ggplot2 is a bit of a start

fsolt commented 8 years ago

Also see http://www.r-bloggers.com/ggextra-r-package-for-adding-marginal-histograms-to-ggplot2/ . The ggplot_build() function may be particularly helpful

fsolt commented 8 years ago

per Berry, Golder, and Milton 2012 http://www.journals.uchicago.edu/doi/10.1017/S0022381612000199

fsolt commented 8 years ago

see also http://polmeth.wustl.edu/files/polmeth/interaction_02_25_2016.pdf Very nice use of inset histograms, but not clear how they did it. Plus other comments on use of interactions that we should consider incorporating if possible. This showed up in my inbox while we were talking, btw.

fsolt commented 8 years ago

here's the conversation on Twitter: https://twitter.com/fredericksolt/status/677554984792141824

sammo3182 commented 8 years ago

I successfully replicated Jens, Mummolo, and Xu. The key looks to be draw the histogram FIRST. So, we may need a separate function from interplot.plot to draw such type of combined plot.

fsolt commented 8 years ago

Commit your replication code to /dev? I'd like to look it over too.

sammo3182 commented 8 years ago

Users can either use the model data or external source to superimpose the histogram.