Bookmark and Share

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

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

st: Use varlabel in expressions

From   Marcelo Lafleur <[email protected]>
To   [email protected]
Subject   st: Use varlabel in expressions
Date   Fri, 23 Mar 2012 14:53:33 -0400

I've had not luck with this and all references in this list point to use 
of value labels. 

My question is simple: How, if possible, to drop variables based on a 
prefix in their varlabels?


. des  mv218 mv225 mv245 mv246

variable name       value label      variable label
mv218                                           number of living children
mv225                  mv225            na-current pregnancy wanted
mv245                                           women fathered children 
mv246                   mv246           na-married to mother when first 
child was born

(I edited the output a bit)

I want to drop mv225 and mv246 by testing that the variable label starts 
with "na-"

Having hundreds of variables in each dataset, it would be impractical to 
do by hand.

Any ideas?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index