Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Addressing variables


From   "Christopher Garlich" <cgarlich@mail.uni-mannheim.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Addressing variables
Date   Wed, 14 Sep 2011 13:20:02 +0200

Hi everybody,

I have a dataset with lag-variables, e.g. Lag1 - Lag5. I want to take the
mean of Lag-variables 1-"i", where "i" is a number defined in another
variable, e.g. a variable called "i".
So I'm trying to do something like this:
egen avg = rowmean(Lag1 - Lag"i")

but I cannot get it to work. Does somebody know how to address variable "i"
correctly?


Thanks and regards,
Chris


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index