Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: combine two datasets


From   "Stephen A. Crowder" <scrowder@umc.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: combine two datasets
Date   Thu, 19 Dec 2013 01:59:23 +0000

Generate a year variable , merge them by the id variable and it should come together easily as long as the variable names match exactly and have the same upper or lower case characters

Sent from my iPhone

> On Dec 18, 2013, at 7:56 PM, "Steve Samuels" <sjsamuels@gmail.com> wrote:
>
> Type
>
> . help combine
>
> and look at the listed topics.
>
>
> Steve
>
>
> On Dec 18, 2013, at 7:53 PM, 游万海 wrote:
>
> Dear all,
>
> I have two dataset A and B,
> A:
> id  year  var1 var2
> 1  2001  1        2
> 1  2002  3       4
> 1  2003  5       6
> 2  2001  1        2
> 2  2002  3       4
> 2  2003  5       6
> 3  2001  1        2
> 3  2002  3       4
> 3  2003  5       6
>
>
> B:
> id year var1 var2
> 1 2004    1     2
> 2 2004    3    4
> 3 2004    5    6
>
> And I want to obtain the dataset C
> id year  var1 var2
> 1  2001  1        2
> 1  2002  3       4
> 1  2003  5       6
> 1  2004  1        2
> 2  2001  1        2
> 2  2002  3       4
> 2  2003  5       6
> 2  2004  3       4
> 3  2001  1        2
> 3  2002  3       4
> 3  2003  5       6
> 3  2004  5      6
>
> Thanks very much
>
> Bests,
> wanhaiyou
> Hunan University
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>
Individuals who have received this information in error or are not authorized to receive it must promptly return or dispose of the information and notify the sender. Those individuals are hereby notified that they are strictly prohibited from reviewing, forwarding, printing, copying, distributing or using this information in any way.



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index