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

st: Nested loops?

Subject   st: Nested loops?
Date   Tue, 21 Sep 2004 09:50:04 -0400

I would like to generate the following variables:

local myvars "v1 v2 v3 v4 v5 v6 v7 v8....etc..."

for var v2 v3 v4....:                          g X_v1 =  X*v1
for var v3 v4 v5 v6...:                     g X_v2 =  X*v2
for var v4 v5 v6 v7...                      g X_v3 =  X*v3

How to do that, if I have a lot of variables involved?
Best regards.

*   For searches and help try:

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