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

st: index-scrolling varname

From   Sara Pinoli <>
Subject   st: index-scrolling varname
Date   Tue, 5 Apr 2005 20:01:52 +0200

I've to do a lot of computation on some groups of variables.
For simplicity, let's say I've to do rsum(a_first a_second) and, separetely,
rsum(b_first b_second)

I want to do it shorter using a loop:
- I generated a sort of index, let's say i, whose values is i="a" the first
turn, and i="b" at the second turn (and that's feasible)
- I would like to do something like:
  egen i_tot=rsum(i_first i_second)

but I'm not able to explain to Stata that I'm interested in the value of i as a
part of the variable name.
Is it possible to do that?

Sara Pinoli
Ph.D. Student - UniversitÓ Bocconi
Via Sarfatti 25 - 20136 Milano, Italy


*   For searches and help try:

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