Statalist The Stata Listserver


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

Re: st: A problem with append


From   "Neil Shephard" <[email protected]>
To   [email protected]
Subject   Re: st: A problem with append
Date   Tue, 26 Sep 2006 11:49:34 +0800

On 9/26/06, Silvia Mendolia <[email protected]> wrote (again):
Hello,
I am working with two different files, containing labour force status.
In the first one the status is coded as follows:
Looking after family: 5
FT Education: 6
Long term sick: 7
Maternity leave: 8

In the second one it is:

Maternity leave:5
Looking after family: 6
FT education: 7
Long Term sick: 8

So, if I try to append the first one under the second one, people looking after
family are recorded as maternity leave, people in FT education are recorded as
looking after family and so on...

How can I change the code of the labour force status in one of the two files?

Firstly, posting your message twice within a few hours of each other
is not particularly good etiquette on any mailing list.  If you are
unsure whether your original post made it through to the list then you
can look in the archives, which are linked from the FAQ which you no
doubt read to sign up to this list, if not I'd recommend reading it.
Note also that a fair proportion of statalist subscribers are in
Europe/North America which is in a different timezone to you.

See -man label- for how to manipulate labels and resolve your problem.
A contrived example (assuming that in one of your datasets variables
are incorrectly labelled and you wish to redefine them) follows

. webuse citytemp, clear
(City Temperature Data)

. label list
division:
          1 N. Eng.
          2 Mid Atl
          3 E.N.C.
          4 W.N.C.
          5 S. Atl.
          6 E.S.C.
          7 W.S.C.
          8 Mountain
          9 Pacific
region:
          1 NE
          2 N Cntrl
          3 South
          4 West

. label drop region

. label define region 1 "West" 2 "NE" 3 "N Cntrl" 4 "South"

. label val region region

. label list
region:
          1 West
          2 NE
          3 N Cntrl
          4 South
division:
          1 N. Eng.
          2 Mid Atl
          3 E.N.C.
          4 W.N.C.
          5 S. Atl.
          6 E.S.C.
          7 W.S.C.
          8 Mountain
          9 Pacific

If this were my data I would be concerned as to which is the correct
coding scheme, and why there is this discrepency between the two
datasets in the first place.

Neil
--

()  ascii ribbon campaign - against html mail
/\                        - against microsoft attachments
(www.gnu.org/philosophy/no-word-attachments.html)

Email - [email protected] / [email protected]
Website - http://slack.ser.man.ac.uk/
*
*   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