Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: for commands

From   "Andrew Eggers" <>
To   <>
Subject   st: for commands
Date   Tue, 04 Nov 2003 16:17:42 -0500

Dear list,

I am used to using the "for" command to write a command that calls
members from more than one list in order. For example:

>for any a b c \ num 1/3 \ any g h i: gen XYZ = 0 

would generate three variables named a1g, b2h, and c3i, each filled
with zeros. 

I am trying to graduate from <for> to <forvalue> and <foreach>, and
wondered how I can do as above with these newer commands.

Thanks in advance.

Andy Eggers
Brookings Institution
Washington, DC
*   For searches and help try:

© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index