Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: Verify that all values of a variable are mapped after -label values-


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Verify that all values of a variable are mapped after -label values-
Date   Thu, 20 Jun 2013 19:54:59 +0000

try tab varname - if any values are not labeled they will show up without labels

Peter A. Lachenbruch,
Professor (retired)
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Toby Robertson [toby.robertson@hotmail.com]
Sent: Thursday, June 20, 2013 12:48 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Verify that all values of a variable are mapped after -label values-

What is the easiest way to check whether, having applied a value label to a variable...

  label values myvar mylabel

...every value of myvar in the dataset is mapped to mylabel?

I am using Stata 10, creating value labels from lookup files from numeric code variables to string descriptor variables using -labmask- followed by -label save-, and then applying them to the values of the numeric variables in very large datasets.

The obvious solution might be to merge the string variable itself from the lookup file into the target file (after which I could check the integrity of the merge, use -labmask-, and drop the string variable again) because I want to avoid that because of file size and read time  considerations.

Thanks in advance to anyone who knows the answer offhand!

Toby
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index