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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: How to append these two data sets |

Date |
Mon, 13 Apr 2009 15:59:50 +0200 |

<>

****** clear* inp id v 1 4 1 2 2 6 2 7 end tempfile mine save `mine' , replace clear* inp id x str2 y z 1 4 a 7 1 4 b 8 1 4 c 9 2 6 a 7 2 6 b 8 2 6 c 9 end append using `mine' sort id x y z l ,noo sepby(id) ***** HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Monday, April 13, 2009 3:43 PM Subject: st: How to append these two data sets

Dear All: Suppose I have the 2 following data set1: Data 1 id v 1 4 1 2 2 6 2 7 ------------- Data 2: id x y z 1 4 a 7 1 4 b 8 1 4 c 9 2 6 a 7 2 6 b 8 2 6 c 9 Note that _x_ is a fixed effect in data 2 as well as the combined data set. Given that, do you know how I can append data 1 to data 2 so that the combined data set will have infor from both data 1 and 2 and some missing values due to mismatch between v and (y,z). Specifically, the combined data for the first observation looks like the following: Combined data: id x y z v 1 4 a 7 mis 1 4 b 8 mis 1 4 c 9 mis 1 4 mis mis 4 1 4 mis mis 2 ...... Many thanks! -- "My father gave me the greatest gift anyone could give another person, he believed in me." - Jim Valvano -- "My father gave me the greatest gift anyone could give another person, he believed in me." - Jim Valvano * * 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/

**References**:**st: How to append these two data sets***From:*Quang Nguyen <quangn@gmail.com>

- Prev by Date:
**st: RE: How to append these two data sets** - Next by Date:
**st: reshape wide** - Previous by thread:
**st: RE: How to append these two data sets** - Next by thread:
**Re: st: How to append these two data sets** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |