I am not watching this thread closely, but -renpfix- is
among various tools that could be relevant.
Nick
[email protected]
Jacki Buros
> I could be wrong, but I think reshape allows you to specify where the
> 'j' portion of the data resides within the variable name using the '@'
> symbol.
>
> so, with data as you've described :
>
> > > date code1_varx code1_vary code2_varx code2_vary
> > > 1990 10 20 10 30
> > > 1991 10 20 10 30
>
> you could type
>
> . reshape long code@_varx code@_vary, i(id) j(code)
>
> which should give you
>
> > > date code_varx code_vary code
> > > 1990 10 20 1
> > > 1990 10 30 2
> > > 1991 10 20 1
> > > 1991 10 30 2
>
> then you would just have to rename each code_varx to varx to
> vary, as follows:
>
> unab codevars : code_*
> foreach V of local codevars {
> local rename=subinstr("`V'","code_","",.)
> rename `V' `rename'
> }
*
* 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/