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: filter by value labels


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: filter by value labels
Date   Thu, 31 Mar 2011 12:21:27 -0400

Easy to write a little command to spit out the cases that match your
criteria, using labels and other chars, e.g.
http://www.stata.com/statalist/archive/2010-03/msg00275.html
but think through what you want to do with the output downstream
before you program it.

On Thu, Mar 31, 2011 at 11:56 AM,  <[email protected]> wrote:
> Thanks Nick,
>
> this is the idea I was looking for but unfortunately it doesn’t fit to my example.
>
>
> The use of
>
> "value_label_content":value_label_name
>
> is restricted to single values and their corresponding value labels where the latter must be known.
>
> In my case value labels are unknown and I want to check and filter those containing defined substrings.
>
> In correction to my first post the command with non-encoded vars would be like that:
> tab unitid if strmatch(firstname ,"*Joe*") == 1 & strmatch(firstname ,"Doe*") == 1 & strmatch(town ,"*Frankfurt*") == 1
>
> (So "Joe" could have other names too, Frankfurt could be named "Stadt Frankfurt" or "Frankfurt am Main"...)
> (The usual hassle with address data...)
>
> There is none but if there was e.g. some function "vallabel" that would substitute variable values with their corresponding value labels (e.g. for comparison in -strmatch - ) I would encode more often and some of my datasets could be much smaller.
>
> Stefan Gawrich

*
*   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