Statalist


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

Re: st: append


From   Svend Juul <[email protected]>
To   [email protected]
Subject   Re: st: append
Date   Sat, 8 Mar 2008 17:05:05 +0100

Edson wrote:
 
When using the command "append" to combine datasets what 
to do if the same variables have different alternatives 
in the different survey editions (as in the example below 
- 2006=4 answers and 2002=3 answers)? Is it a problem or 
can be ignored?
 
 use "C:\Documents and Settings\aksd\stata1\dataset2006.dta", clear
 
ta literacy
 
    for those with codes |
  10-17 in column 4 aged |
        10years and abov |      Freq.     Percent        Cum.
-------------------------+-----------------------------------
unable to read and write |      6,177       34.56       34.56
       able to read only |        896        5.01       39.57
  able to read and write |     10,797       60.40       99.97
            uses braille |          5        0.03      100.00
-------------------------+-----------------------------------
                   Total |     17,875      100.00
 
. use "C:\Documents and Settings\aksd\stata1\2002\dataset2002.dta", clear
 
. ta literacy
      liter |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |      7,670       30.64       30.64
          2 |      1,450        5.79       36.43
          3 |     15,912       63.57      100.00
------------+-----------------------------------
      Total |     25,032      100.00
 
========================================================================
 
In dataset2000.dta, the variable -literacy- apparently has no value 
labels. Hopefully you have access to some documentation so that 
you are not forced to guess the meaning of the codes.
 
There is a chance (but we don't know) that -literacy- in dataset2006.dta 
is coded like this:
 
  1 unable to read and write
  2 able to read only
  3 able to read and write
  4 uses braille
 
and that the codes in dataset2002.dta mean:
 
  1 unable to read and write
  2 able to read only
  3 able to read and write
 
If you can confirm this, it is your decision what to do with the five
observations of Braille readers. You could leave them as is.
 
If - apart from the Braille readers - the codes in the two datasets
mean different things, you need to "harmonize" them, i.e., modify
them so that you obtain the same coding - before appending.
 
Useful commands for that work:
 
   recode
   label variable
   label define  and  label values
   numlabel
 
Hope this helps
Svend

________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:   +45 8942 6090 
Phone, home:   +45 8693 7796 
Fax:           +45 8613 1580 
E-mail:        [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