Announcement

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

  • How to loop in descending order

    I would like how I could loop in reverse order using forvalues or any other way.

    I would like to loop from a big number to a small number: As an illustration, something like this:

    forvalues 7(-1)2 {
    stata commands
    }

  • #2
    You are almost there!

    Code:
    forvalues i= 7(-1)2 {
        display "Number `i'"
        }
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment

    Working...
    X