Announcement

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

  • Using a local variable to define the range of "forvalues"


    Does Stata accept a local variable (here, `t') as part of a forvalues command range? As an example:
    forvalues t = 1/20 {
    forvalues i = `t’/50 {
    CODE
    }
    }

  • #2
    Why not try it and find out?

    Comment


    • #3
      Or try a simple variation
      Code:
      forvalues t = 1/2 {
      forvalues i = `t’/5 {
      display "t is `t' and i is `i'"
      }
      }

      Comment


      • #4
        It makes sense! Thank you very much

        Comment

        Working...
        X