.- help for ^for2^ (STB-26: ip8) .- Repeat command with specified arguments --------------------------------------- ^for2^ list [^,^ ^a^ny ^noh^eader ^nos^top ^n^umeric ]^:^ stata_cmd Description ----------- ^for2^ repeats stata_cmd substituting for ^@@^ in stata_cmd each member of list. Options ------- ^any^ specifies that list is to be given no special interpretation. If neither ^any^ nor ^numeric^ are specified, list is interpreted as a varlist -- all the variables must exist and standard Stata varlist syntax, such as ^sx*^ to mean all variables that start with ^sx^, is allowed. ^noheader^ specifies that the substituted Stata command is not to be shown before execution. If ^noheader^ is not specified, the substituted command is shown. ^nostop^ specifies that the command is to continue to be repeated with the sub- sequent elements of list even if one of the replications results in an error (nonzero return code). ^numeric^ specifies that list is to consist only of positive integers. Such a list can contain range abbreviations (^-^) and increment indicators (^/^). For instance, ^2-6/2^ is expanded by ^for2^ to ^2 4 6^. Examples -------- . ^for2 ch1 ch2 ch3: ttest @@=0^ . ^for2 ch1-ch3: ttest @@=0^ . ^for2 ch*: ttest @@=0^ . ^for2 q16-q25: replace @@=@@+1^ . ^for2 q16-q25, noheader: replace @@=@@+1^ . ^for2 u1 u2 u3, any: gen @@=uniform()^ . ^for2 -9 -99, any: mvdecode var*, mv(@@)^ . ^for2 3-18/3, numeric: gen group@@ = group+@@^ Author ------ Patrick Royston Royal Postgraduate Medical School, London FAX: (011)-44-181-740-3119 Also see -------- Manual: [5u] for On-line: help for @quietly@