CONTENT

Become an expert in organizing your work in Stata. Make the most of Stata’s scripting language to improve your workflow and create concretely reproducible analyses. Learn how branching, looping, flow of control, and accessing stored estimation results can speed up your work and lead to more complete analyses. Learn about bootstrapping and Monte Carlo simulations, too.

 

PREREQUISITES

  • Stata 18 installed and working.
  • Basic knowledge of using Stata interactively
  • Internet web browser, installed and working (course is platform independent)

PROGRAM

SESSION I: ORGANIZATION OF ANALYSIS

  1. Welcome
  2. Entering and executing a program
  3. The do-file
  4. The interactive program command
  5. program in a do-file
  6. Combination do-files
  7. Ado-files
  8. Organizing do-files
  9. An individual do-file
  10. A do-file to perform verification
  11. Infiling data
  12. Reproducibility
  13. Indexing
  14. assert as an alternative to branching
  15. Consuming calculated results

 

SESSION II: MACROS, ARGUMENTS, AND LOOPING

  1. Macros
  2. How macros might be used
  3. Macro names
  4. The related-persons example
  5. Another example (plant data)
  6. Potential problem—variable scope
  7. More on arguments
  8. Branching and looping
  9. Physical program style
  10. foreach
  11. Looping across observations
  12. if

 

SESSION III: EXAMPLES AND APPLICATIONS

  1. Data management example
  2. Handling time and date variables
  3. Checking assumptions
  4. Returned values and storing results
    • What can be returned in r()?
    • Referring to returned results in other programs
    • Referring to returned results in the program that sets them
  5. Bootstrapped standard errors
  6. Aside: reading a trace
  7. A warning on bootstrapping
  8. Speeding up bootstrapping
  9. Bootstrapping, how to
  10. Monte Carlo simulations
  11. postfile and post
  12. Using quietly
  13. Speeding up simulations
  14. A warning on bootstrapping
  15. Speeding up bootstrapping
  16. Bootstrapping, how to
  17. Monte Carlo simulations
  18. postfile and post
  19. Using quietly
  20. Speeding up simulations

 

 

 

© Copyright 1996–2024 StataCorp LLC

 

SESSION IV: ADO-FILES

  1. A first real ado-file
  2. discard
  3. More improvements to doanl
  4. capture
  5. The exit command
  6. Making doanl a general tool
  7. Writing a help file for doanl
  8. Do-files, programs, and ado-files: When to use which
  9. Temporary variables
  10. Temporarily destroying data
  11. Temporary files
  12. An analysis-specific ado-file
  13. General-purpose (GP) ado-files
  14. A GP ado-file
  15. Fine-tuning display output
  16. Stata syntax
  17. syntax
  18. varlist macro
  19. syntax’s other specifiers
  20. Whether to use syntax
  21. A note on quotes
  22. Version control

 

 

Note: There is a one-week break between the posting of Sessions 2 and 3; however, course leaders are available for discussion.