Statalist


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

st: value labels dropped unexpectedly


From   Jacob Wegelin <jwegelin@vcu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: value labels dropped unexpectedly
Date   Mon, 5 Oct 2009 14:48:32 -0400 (EDT)

When I save a dataset in a temporary file and then immediately reload it, my value label disappears. Can anyone explain why?

This does not always happen; in a toy dataset (below the first example) the value label is not dropped.

(I am using Stata 10.1.)

. 
. label list QOL
QOL:
            1 PhysicalFunctioning
            2 RolePhysical
            3 BodilyPain
            4 GeneralHealth
            5 Vitality
            6 SocialFunctioning
            7 RoleEmotional
            8 MentalHealth
            9 Physical
           10 Mental

. tempfile TMPOUT

. save `TMPOUT', replace
(note: file /var/folders/HR/HRdt7XjbGC4gfgEM2M7yWE+++TM/-Tmp-//S_51906.00004u not found)
file /var/folders/HR/HRdt7XjbGC4gfgEM2M7yWE+++TM/-Tmp-//S_51906.00004u saved

. use `TMPOUT', clear

. des, short

Contains data from /var/folders/HR/HRdt7XjbGC4gfgEM2M7yWE+++TM/-Tmp-//S_51906.00004u
   obs:           366
  vars:           215                          5 Oct 2009 14:37
  size:       455,304 (95.7% of memory free)
Sorted by:  Total_Biopsy_Count  PID  Biopsy

. label list QOL
value label QOL not found
r(111);

. 
. clear

. 
. input x

              x
   1. 1
   2. 3
   3. 1
   4. end

. 
. label define x 1 "one" 3 "three"

. label values x x

. label list x
x:
            1 one
            3 three

. tempfile TEMP

. save `TEMP', replace
(note: file /var/folders/HR/HRdt7XjbGC4gfgEM2M7yWE+++TM/-Tmp-//S_51906.00004w not found)
file /var/folders/HR/HRdt7XjbGC4gfgEM2M7yWE+++TM/-Tmp-//S_51906.00004w saved

. use `TEMP', clear

. label list x
x:
            1 one
            3 three

.

Thanks for any insight

Jacob A. Wegelin
Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032
U.S.A. 
E-mail: jwegelin@vcu.edu 
URL: http://www.people.vcu.edu/~jwegelin

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index