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

st: RE: notes lost in append


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: notes lost in append
Date   Sat, 8 May 2004 18:45:11 +0100

What kind of work-around are you expecting? 

Stata's problem, I think, is that it expects at most one 
note for each combination of name and number, e.g. "mpg" 
and "1". 

In addition, as the variables in the datasets typically  
have the same names -- little point in -append-ing 
otherwise -- it is difficult to think of a work-around 
other than having unique variable names in each dataset, 
to each of which you attach -notes-. I haven't tested that.  

A clumsier alternative is to store text in a string 
variable in each dataset. 

Devra Golbe
 
> I would like to append two data files each having notes.  As 
> the output 
> below indicates,  notes from the "using" file are evidently 
> not retained 
> when the master file already contains notes on the same 
> variable.  The same 
> is true for a note attached to the file as a whole:  while it 
> is possible 
> to have multiple notes, if the master file contains such 
> notes, none are 
> retained from the using file.
> 
> Does anyone know of a work-around?
> 
> Thanks,
> Devra
> 
> --------------------------------------------------------------
> -----------
> . use "C:\Stata8\auto.dta"
> (1978 Automobile Data)
> 
> . keep if foreign==0
> (22 observations deleted)
> 
> . notes
> . note: these are the domestic obs
> . note make: TS created in Domestic file
> . note price: TS created in Domestic file
> . save autoD, replace
> file autoD.dta saved
> 
> . notes
> 
> _dta:
>    1.  these are the domestic obs
> make:
>    1.  7 May 2004 16:19 created in Domestic file
> price:
>    1.  7 May 2004 16:19 created in Domestic file
> . clear
> 
> . use "C:\Stata8\auto.dta"
> (1978 Automobile Data)
> 
> . keep if foreign==1
> (52 observations deleted)
> 
> . notes
> 
> . note: these are the foreign obs
> . note: this is a second note attached to the foreign file
> . note make: TS created in Foreign file
> . note make: this is a 2nd note attached to make in the Foreign file
> . note mpg: TS created in foreign file
> 
> . save autoF, replace
> file autoF.dta saved
> 
> . notes
> _dta:
>    1.  these are the foreign obs
>    2.  this is a second note attached to the foreign file
> make:
>    1.  7 May 2004 16:19 created in Foreign file
>    2.  this is a 2nd note attached to make in the Foreign file
> mpg:
>    1.  7 May 2004 16:19 created in foreign file
> 
> . append using "D:\Documents and Settings\Devra\My 
> Documents\TEMP\autoD.dta"
> (label origin already defined)
> 
> . notes
> _dta:
>    1.  these are the foreign obs
>    2.  this is a second note attached to the foreign file
> make:
>    1.  7 May 2004 16:19 created in Foreign file
>    2.  this is a 2nd note attached to make in the Foreign file
> price:
>    1.  7 May 2004 16:19 created in Domestic file
> mpg:
>    1.  7 May 2004 16:19 created in foreign file

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