Announcement

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

  • Twoway connected limit?

    I'm interested in plotting 100 lines in STATA of a density graph into 1 plot. Is there an easy way to do this. I noticed that `twoway connected' has a limit.

    forval x=1/100{
    gen rexponential`x'=rexponential(2)
    }

    foreach x in rexponential1-rexponential100 {
    multidensity gen `x'
    }

    Now I'd like to graph the densities on 1 plot.

  • #2
    I'd suggest a reshape long to two variables, one density and one magnitude, and plotting using a careful sort order and c(L).

    The main idea is shown (without the reshape!) by

    Code:
    . webuse grunfeld , clear
    
    . line invest year, c(L)
    where the sort order company year means that you get multiple traces, one for each company.

    Comment


    • #3
      Thank you Nick. This was more efficient than a few other approaches.

      Comment

      Working...
      X