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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: saving a varlist in a new dat file


From   Alan Neustadtl <alan.neustadtl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: saving a varlist in a new dat file
Date   Sun, 4 Mar 2012 08:36:13 -0500

It sounds like either -append- or -merge- could produce the dataset
you are interested in.  The difference is that append creates a "long"
form dataset and merge creates a "short" form dataset.  You can use
the -reshape- command to convert from one form to the other.

The help file and pdf documentation has lots of great examples and it
is worth your time to consult them.

If you use -append- you will need to create an variable identifying
the sample for the data.  In long form each variable would represent a
different sample.

If your samples can have different number of cases, I think -append-
would be easier and more useful.  But, you didn't specify how you
wanted to compare your samples and that will be important in deciding
on the forr of your dataset.

Best,
Alan

On Sun, Mar 4, 2012 at 4:59 AM, Osei Kuffour Wiafe <okwiafe@gmail.com> wrote:
> Hi guys,
>
> I hope this is possible to do in stata and someone is able to help me out.
>
> I'm taking samples of some data and I have use of just one variable
> from the analysis, say varY.
> I need to save this varY in a new .dat file, run the the do file
> several times again and save the
> different varYs in the same created file. I need to compare the
> different varY values from different samples and I'm
> hoping to save them in one dat file to make it easy to analyse.
>
> Can anyone help me with such a code for my work?
>
> Thanks!
> Osei
> *
> *   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/

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