Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: labels


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: labels
Date   Mon, 21 Nov 2005 08:36:43 -0500

"orozco" <[email protected]> wrote
I have 2 files with the same variables "name" and "color". Variable
"color" is an integer variable with a label, but the label is
defined in each file, thus depending on the values of the variable
"color" existing on each file. The problem is just that when I
want to append the 2 files, I lose the labels of the values
which are on the file I want to append, but which are not on the
master data. I don't know how to do to append some label to the
first label...maybe there is an easy way to do so (except to
generate only one label first because I have a lot of files with
the same variable already labelled)

When you end up with different value label definitions in different files due to the lack of a full set of values, then there are two approaches I've taken:

1) Decode the labeled values in each file before appending them together, then encode the resulting string in the combined file.

2) Create one comprehensive version of the label and then apply it when encoding the data in each file.

The first approach is easier, but the second approach makes all of the separate files use the same label codes which may be useful if you work with those files directly.

Michael Blasnik
[email protected]

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