Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combining two kdensity plots from two different datasets

    Hello all,

    I would like to combine two kdensity plots from two different datasets. I therefore cannot use the 'addplot' command suggested on the internet.

    The combine graph graph1.gph graph2.gph command won't work work because I want one plot with the two different distributions...not two plots with the two different distributions.

    Does anyone have any ideas how to do this?

    Thanks

  • #2
    addplot() is an option not a command, except that there is now a user-written command addplot on SSC.

    "on the internet" isn't a reference that lets us see what advice you are referring to.

    The positive advice is simple, however: put the two datasets into one, presumably using append or merge as appropriate. Then you can get two density curves on the same graph. The syntax will differ depending on what you are comparing.

    Comment


    • #3
      Dear Chris Rooney,
      I know this is old but I encounter the same problem today and I wish to share my solution. There might be new user packages that can do this better which I don't know but this also works.

      Since you are working with two data sets, I guess you are using two do-files.
      If you combine your code into one do-file, the graph combine works.

      Comment

      Working...
      X