Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Selecting variables based on variable labels


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Selecting variables based on variable labels
Date   Sat, 8 Sep 2012 10:42:50 +0200

Mitch,

picking on what you have, -lookfor- returns the variables it finds in
r(varlist). If you are able to find the variables you want (and given
Stata release 12) this should be something like

lookfor "TYPE OF RESIDENCE R IS LIVING"
ren (`r(varlist)')(foo#) ,addnum

However, given that you want to -reshape-, you are probably better of
with Austin's code.

Best
Daniel
-- 
I would like to identify a list of variables using the lookfor command and
either create a list or rename them in a sequential way. Is there a way to
do this? Can you build a variable list from lookfor results? My ultimate
goal is to make the dataset long format, so if anyone has and idea to
shortcut straight to that, I'm all ears.

Thank you,
Mitch
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index