Fraser, Steven
>
> I have a series of variables that start with a particular
> letter ('l' in
> this case). I would like to generate a new variable that
> measures the
> change in variable over time (I have another variable 'week').
>
> I have tried different variants of the following with
> little success:
>
> tset week
> for l@ : gen l@ret = (([email protected]@)/l.l@)
I assume Stata 7.
Your syntax is illegal, as the syntax diagram
illustrates.
tsset week
for var l* : gen @ret = (@ - l.@) / l.@
might be closer to you want.
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/