Announcement

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

  • making loops run faster

    My do file runs two loops over multiple observations such that the loop is run more than 150 million times and takes 3-4 days to execute. I am looking for ways to make this faster. Is it possible to use SQL to do this? (I don't know much about SQL).

  • #2
    Sometimes there is no need for a self-written loop to calculate what you want. Maybe you could set out exactly what you want to achieve - somebody might know a faster command for that.

    Sometimes it is helpful to subdivide your data into several pieces and then running the code in more than one instance/window of STATA on the same time. If you have multiple CPU Cores, this can fasten your execution.

    Comment


    • #3
      Please provide a reproducible data example for your problem using -dataex-, and also tell us what you are trying to achieve. Doing so will greatly increase the chance of a helpful response. You may execute -help dataex- to learn more about the command.

      Comment

      Working...
      X