IDEAS home Printed from https://ideas.repec.org/a/tsj/stataj/v2y2002i2p202-222.html
   My bibliography  Save this article

Speaking Stata: How to face lists with fortitude

Author

Listed:
  • Nicholas J. Cox

    (University of Durham, UK)

Abstract

Three commands in official Stata, foreach, forvalues, and for, provide structures for cycling through lists of values (variable names, numbers, arbitrary text) and repeating commands using members of those lists in turn. All these commands may be used interactively, and none is restricted to use in Stata programs.They are explained and compared in some detail with a variety of examples.In addition,a self-contained exposition is given on local macros, understanding of which is needed for use of foreach and forvalues. Copyright 2002 by Stata Corporation.

Suggested Citation

  • Nicholas J. Cox, 2002. "Speaking Stata: How to face lists with fortitude," Stata Journal, StataCorp LP, vol. 2(2), pages 202-222, May.
  • Handle: RePEc:tsj:stataj:v:2:y:2002:i:2:p:202-222
    as

    Download full text from publisher

    File URL: http://www.stata-journal.com/sjpdf.html?articlenum=pr0005
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Roger Newson, 2002. "Parameters behind "nonparametric" statistics: Kendall's tau,Somers' D and median differences," Stata Journal, StataCorp LP, vol. 2(1), pages 45-64, February.
    2. Nicholas J. Cox, 2001. "Speaking Stata: How to repeat yourself without going mad," Stata Journal, StataCorp LP, vol. 1(1), pages 86-97, November.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Nicholas J. Cox, 2009. "Speaking Stata: Rowwise," Stata Journal, StataCorp LP, vol. 9(1), pages 137-157, March.
    2. Nicholas J. Cox, 2012. "Speaking Stata: Output to order," Stata Journal, StataCorp LP, vol. 12(1), pages 147-158, March.
    3. Nicholas J. Cox, 2008. "Stata tip 59: Plotting on any transformed scale," Stata Journal, StataCorp LP, vol. 8(1), pages 142-145, February.
    4. Nicholas J. Cox, 2007. "Speaking Stata: Identifying spells," Stata Journal, StataCorp LP, vol. 7(2), pages 249-265, June.

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. John, Katrin & Thomsen, Stephan L., 2015. "School-track environment or endowment: What determines different other-regarding behavior across peer groups?," Games and Economic Behavior, Elsevier, vol. 94(C), pages 122-141.
    2. Roger B. Newson, 2010. "Comparing the predictive powers of survival models using Harrell’s C or Somers’ D," Stata Journal, StataCorp LP, vol. 10(3), pages 339-358, September.
    3. Chakrabarty, Manisha & Hildenbrand, Werner, 2011. "Engel's Law Reconsidered," Journal of Mathematical Economics, Elsevier, vol. 47(3), pages 289-299.
    4. Guerra, Alice & Zhuravleva, Tatyana, 2021. "Do bystanders react to bribery?," Journal of Economic Behavior & Organization, Elsevier, vol. 185(C), pages 442-462.
    5. Philipp Chapkovski & Luca Corazzini & Valeria Maggian, 2021. "Does Whistleblowing on Tax Evaders Reduce Ingroup Cooperation?," Working Papers 2021:20, Department of Economics, University of Venice "Ca' Foscari".
    6. Cingl, Lubomír & Lichard, Tomáš & Miklánek, Tomáš, 2023. "Tax designation effects on compliance: An online experiment with taxpayers," Journal of Economic Behavior & Organization, Elsevier, vol. 214(C), pages 615-633.
    7. Lukasz Prorokowski, 2016. "Rank-order statistics for validating discriminative power of credit risk models," Bank i Kredyt, Narodowy Bank Polski, vol. 47(3), pages 227-250.
    8. Newson, Roger, 2005. "Efficient Calculation of Jackknife Confidence Intervals for Rank Statistics," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 15(i01).
    9. Jeannette Brosig‐Koch & Heike Hennig‐Schmidt & Nadja Kairies‐Schwarz & Daniel Wiesen, 2017. "The Effects of Introducing Mixed Payment Systems for Physicians: Experimental Evidence," Health Economics, John Wiley & Sons, Ltd., vol. 26(2), pages 243-262, February.
    10. Löschel, Andreas & Sturm, Bodo & Uehleke, Reinhard, 2013. "Revealed preferences for climate protection when the purely individual perspective is relaxed: Evidence from a framed field experiment," ZEW Discussion Papers 13-006, ZEW - Leibniz Centre for European Economic Research.
    11. Valeria Maggian & Natalia Montinari & Antonio Nicol�, 2018. "Backscratching in Hierarchical Organizations," The Journal of Law, Economics, and Organization, Oxford University Press, vol. 34(2), pages 133-161.
    12. Dirk Tasche, 2009. "Estimating discriminatory power and PD curves when the number of defaults is small," Papers 0905.3928, arXiv.org, revised Mar 2010.
    13. Hanna Karolina Szymborska, 2018. "Household wealth structures and position in the income distribution – econometric analysis for the USA, 1989-2013," Working Papers PKWP1806, Post Keynesian Economics Society (PKES).
    14. Tomas Miklanek, 2017. "The Effect of Shame in Dictator Games with Information Asymmetry," CERGE-EI Working Papers wp581, The Center for Economic Research and Graduate Education - Economics Institute, Prague.
    15. Szymborska, Hanna Karolina, 2019. "Wealth structures and income distribution of US households before and after the Great Recession," Structural Change and Economic Dynamics, Elsevier, vol. 51(C), pages 168-185.
    16. Roger Newson, 2006. "On the central role of Somers' D," United Kingdom Stata Users' Group Meetings 2006 01, Stata Users Group.
    17. Michelangelo Scorpio & Davide Carleo & Martina Gargiulo & Pilar Chías Navarro & Yorgos Spanodimitriou & Parinaz Sabet & Massimiliano Masullo & Giovanni Ciampi, 2023. "A Review of Subjective Assessments in Virtual Reality for Lighting Research," Sustainability, MDPI, vol. 15(9), pages 1-25, May.
    18. Christopher F. Baum, 2005. "A little bit of Stata programming goes a long way..," United Kingdom Stata Users' Group Meetings 2005 16, Stata Users Group, revised 08 Jun 2005.
    19. Ramos, Héctor M. & Ollero, Jorge & Suárez-Llorens, Alfonso, 2017. "A new explanatory index for evaluating the binary logistic regression based on the sensitivity of the estimated model," Statistics & Probability Letters, Elsevier, vol. 120(C), pages 135-140.
    20. William Rhodes, 2014. "Pairwise Cluster Randomization," Evaluation Review, , vol. 38(3), pages 217-250, June.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:tsj:stataj:v:2:y:2002:i:2:p:202-222. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F. Baum or Lisa Gilmore (email available below). General contact details of provider: http://www.stata-journal.com/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.