Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Label problem - fdasave


From   Fred Wolfe <fwolfe@arthritis-research.org>
To   statalist@hsphsun2.harvard.edu
Subject   st: Label problem - fdasave
Date   Thu, 07 Sep 2006 07:06:48 -0500

Using Stata 9.2, up to date, I am trying to convert a series of dta files to SAS format.

After running for a while my program exits with the following error:

"value label sex not found"

When I examine the data I find the following:


. des sex

storage display value
variable name type format label variable label
-------------------------------------------------------------------------------
sex byte %12.0g sex Sex

. unlabeled

| Value
Variable | Label #values unlabeled values
-----------------+----------------------------------------------------------------------------------------------------------
questid | questid 3
sex | sex 2 0 1
ethnic1 | ethnic 5
metcriteria | yesno 2
pcscard | yesno 0
edlevel | edlevel 16
marital | marital 7
edcat | edcode2 5

. tab sex

Sex | Freq. Percent Cum.
------------+-----------------------------------
0 | 1,570 77.61 77.61
1 | 453 22.39 100.00
------------+-----------------------------------
Total | 2,023 100.00

. label drop sex
value label sex not found
r(111);


So, -describe- finds the label, but no other program does. Also, I can't delete the non-existent label.

I don't know how the label got this way (sorry), for it usually shows:

. ndbuse fixed
(Survey Fixed Table version of 19 Aug 2006)

. label list sex
sex:
0 Female
1 Male


My question is this. While it is a small matter to relabel the variable, in the program I am running I have >1,000 variables so I would like to fix or bypass the problem under program control. Generically, how to I get rid of a value label (that doesn't exist) such as this? Is my problem a bug or a feature?

Thanks,

Fred

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel +1 316 263 2125
fwolfe@arthritis-research.org


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




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