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: long table


From   Steven Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: long table
Date   Tue, 14 Jun 2011 22:01:27 -0400

*************
use A
cross using B
*************

is a direct approach.

Steve



On Jun 14, 2011, at 9:47 PM, Argyn Kuketayev wrote:

you need a cartesian product. i don;t know if this is the best
approach, but i would create a new constant variable in both files:

gen c=1

then perform
merge m:m c


On Tue, Jun 14, 2011 at 8:06 PM,  <ningli_yang@fastmail.fm> wrote:
> I use Stata/MP 11 for Windows.
> 
> Suppose dataset A contains variable a of two elements 1 and 2.
> Dataset B contains variable b of three elements -3, -4 and -5.
> 
> What is the Stata command to create the dataset that contains the
> following two columns
> 
> 1  -3
> 1  -4
> 1  -5
> 2  -3
> 2  -4
> 2  -5
> 
> ?
> 
> Thanks very much for the help.
> 
> Ning
> *
> *   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/
> 



-- 
Argyn Kuketayev

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