z-logo
open-access-imgOpen Access
Speaking Stata: Loops in parallel
Author(s) -
Nicholas J. Cox
Publication year - 2021
Publication title -
the stata journal
Language(s) - English
Resource type - Journals
eISSN - 1536-8734
pISSN - 1536-867X
DOI - 10.1177/1536867x211063415
Subject(s) - macro , skewness , variable (mathematics) , quantile , computer science , column (typography) , cover (algebra) , set (abstract data type) , algorithm , mathematics , statistics , programming language , mechanical engineering , mathematical analysis , telecommunications , frame (networking) , engineering
This column is a tutorial discussing looping in parallel using foreach and forvalues. Such looping may use not only local macros defined for the purpose but also other devices, including the gettoken command and ways to increment and decrement other macros and to evaluate other expressions. The main idea is that a set of loops in parallel is essentially one loop with two or more sets of parallel actions. Examples cover looping over integers with a required specific display format, generating new variables and defining variable labels at the same time, binning variables as desired, and putting skewness results in new variables. The last example includes some historical comments on the tangled literature on skewness measures using medians and quantiles.

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here