Re: st: Organizing data file - Inverse of separate command

Things would be simpler if your variable names had the sub-observation
index (you call this "id", with values 1 and 7) as the last character in
the name, rather than embedded within the name. If that were the case then
a simple -reshape- would get you there:

1. a simple call to -renvars- [Weesie & Cox STB-60; -findit renvars- ]
could get rid of the unwanted "_" suffix on the specific.. variables in the
long data set.

2. if there were a great many more than 4 variables of the form:
specificX_Y in your real data set, then presumably you could set up a
-foreach- loop and reverse the order of X and Y in the variable names using
extended local macro functions. Whether this was worth the effort would
depend on just how many -rename- commands you needed to write.

Philip Ryan
Associate Professor,
Department of Public Health
Associate Dean (Information Technology)
Head, Data Management & Analysis Centre
Faculty of Health Sciences
University of Adelaide 5005
South Australia
tel 61 8 8303 3570
fax 61 8 8223 4075
http://www.public-health.adelaide.edu.au/
CRICOS Provider Number 00123M
-----------------------------------------------------------
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
*
* 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/