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]
st: Append and redistribute variables or merge?
From
miriam geringer <[email protected]>
To
[email protected]
Subject
st: Append and redistribute variables or merge?
Date
Tue, 21 Jan 2014 11:58:09 +0100
Hey guys, I have the following problem.
I have a dataset 1 with the following variables
Name A Name B Variable 1 Variable 2 Variable T1
and a dataset 2 with the following variables
Name A Name B Variable 1 Variable 2 Variable T2
Basically, some variables of table 1 and table 2 are identical,
however, there are also some variables that differ.
Now, I want to create a merged dataset that looks like
Name A Name B Variable1 Variable 2 VariableT1 Variable T2
Even though some variables are the same, there might be cases in which
I have Name A Name B in dataset 1 that is missing in dataset 2 and
vice versa.
So some are equal, then I want to create one "row" in which I have
Variable T1 and Variable T2. And when there is no counterpart in
dataset 1 or dataset 2, then I want to have a row with only either
variable T1 or T2.
So far, I "appended" the dataset 2 to dataset 1, but then I got:
Name A Name B Variable 1 Variable 2 Variable T1
Name A Name B Variable 1 Variable 2 Variable T2
Is the wrong approach? Or can I somehow then modify/redistribute the variables?
Should I use the merge function instead? Merge based on the identical
variables?
Thank you!
*
* 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/