Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: RE: creating 2 datasets in memory without saving and merge


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: creating 2 datasets in memory without saving and merge
Date   Sat, 28 Apr 2012 11:21:35 +0100

No disagreement from me on 1. with the understanding that "dataset"
here is being used in a non-Stata sense. Clearly Stata knows nothing
about the meaning of what is recorded as data and you can put any
number of dissociated data elements anywhere in your observations and
variables.

Evidently the problem has been solved otherwise.

Nick

On Fri, Apr 27, 2012 at 6:32 PM, Austin Nichols <austinnichols@gmail.com> wrote:
> Nick Cox <n.j.cox@durham.ac.uk>:
>
> One can work with two datasets in memory at once, if the variable
> names do not overlap (cf. the unmatched merge trick described at e.g.
> http://www.stata.com/statalist/archive/2009-09/msg00493.html). It is
> only tautologically true that the merged data is one (new) dataset in
> memory; in practice both datasets are in memory, though one probably
> has extra missing values.
>
> One can also keep two datasets (or more) in Mata matrices.
>
> However, it seems the OP needs to simply -merge- and then save under a
> new name. I agree completely on your points 2-4.
>
> On Fri, Apr 27, 2012 at 1:15 PM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
>> 1. You can hold precisely one (1) dataset in memory in Stata at once. This is circular in so far as what you hold in memory is always regarded as one (1) dataset, regardless of whether that dataset was originally two or more datasets in some sense, Stata or not Stata. Nevertheless the circularity is not vicious.
>>
>> 2. There are various ways of combining two or more datasets, including the use of -merge- or -append- and just typing or pasting in new data into the Editor.
>>
>> 3. Whether a dataset has been -save-d is a different question. No rule says that you must -save- data. It would be a waste of effort to combine datasets and not -save- the results if you intend to -use- that dataset later, but that's a practicality, not a rule.
>>
>> 4. Why you say that whatever you have in mind is "not good" is completely unclear to me.
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> tashi lama
>>
>>       I will be using 2 diff databases to get my data in stata. And I need to merge those two data to use for my analysis. One obvious way is to get the data from  database 1 and save it with .dta file. Then use another database to pull data in stata memory(this is doable since my memory is clear) and use merge command. Unfortunately, this method is not good since i will have to save one dataset. Is there anyway I could pull two datasets in the memory without saving anyof the datasets? Or, what are my choices to get my intended result. Please let me know if my question is not clear.

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