Announcement

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

  • pause loop

    Dear Stata users,
    I’d like to make graphs using a loop and pause after each graph, then advance to the next graph using the keyboard or the mouse.
    I’m not sure why the following code doesn’t work; what happens is that after each graph I see -more- in the results window but Stata doesn’t pause and the graphs are made one after the other with no break.
    Isn’t -more- supposed to pause the program after each graph?

    sysuse auto

    * graphs
    set more on
    foreach var of varlist price mpg headroom trunk weight length {
    graph box `var'
    more
    }

    Thank you.
    Luca

    PS I’m running Stata 14.1 on Windows 7 (Stata installed on the University server)

  • #2
    Your code works for me. Also using 14.1 on Win7.

    cheers,
    Jeph

    Comment


    • #3
      When this happens to me it seems that I have pressed the space bar too many times somehow.

      On a different note, if you like to do things like that, check out

      multqplot

      SJ-12-3 gr0053 . Speaking Stata: Axis practice, or what goes where on a graph
      (help multqplot if installed) . . . . . . . . . . . . . . . N. J. Cox
      Q3/12 SJ 12(3):549--561
      discusses variations on what goes on each axis of a two-way
      plot; provides multiple quantile plots

      Code:
      multqplot  price mpg headroom trunk weight length
      Click image for larger version

Name:	multqplot.png
Views:	1
Size:	23.7 KB
ID:	1318760




      and

      combineplot

      http://www.statalist.org/forums/foru...ailable-on-ssc

      Code:
      combineplot price mpg headroom trunk weight length: graph box @y
      Click image for larger version

Name:	combineplot.png
Views:	1
Size:	13.7 KB
ID:	1318761





      The last example (for Luca's choice of variables) exposes how little detail is often given with default box plots. I am happy that is so. That's the justification for quantile-box plots as shown by multqplot. (The boxes are there, just subdued: the lines for cumulative probability 0.25, 0.5, 0.75 and for the corresponding quantiles are all added.)
      Last edited by Nick Cox; 02 Dec 2015, 10:17.

      Comment


      • #4
        Thank you very much for your answers.
        Given that there was no error in my code, I tried again, and it worked after restarting Stata. I really don’t know why the first time it didn’t work, the code was the same.
        Nick, thank you very much for your comment and for pointing to multqplot and combineplot, I appreciate it.

        Luca

        Comment


        • #5
          That sort of little thing bites me often. As said, it seems to boil down to some mistyping somewhere.

          Comment

          Working...
          X