Announcement

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

  • looping n times, and n is determined by another equation

    Hello,

    I wish to loop n times, say:

    forvalues i = 1(1)n{

    and n is defined by the last number of id:

    egen id = group(firm)

    May I kindly ask how to write this code please?



  • #2
    Code:
    egen id = group(firm)
    sum id , meanonly
    forvalues i = 1/`r(max)' {
        // interesting stuff
    }
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X