-help merge- and -help append- will provide you with sufficient guidance to figure out the appropriate syntax for your problem.
Steve
On 2012-11-07, at 3:24 PM, Zhangqunzi wrote:
> Actually, I want to make the two big data sets have the same variable name list which is from the second file. Some variables in data file 1 need to be dropped.
>
> I think I should creat a name list from data 2 then select the data from data 1 according to this data 2 name list.
>
> Can u tell me how to code in Stata?
> Thanks
>
> 在 Nov 7, 2012,7:46 PM,Nick Cox <njcoxstata@gmail.com> 写道:
>
>> Sounds like
>>
>> . drop var2 var4
>>
>> Nick
>>
>> On Wed, Nov 7, 2012 at 6:41 PM, Zhangqunzi <zhangqunzi@googlemail.com> wrote:
>>
>>> I have two dta files, first one with variables : var 1 2 3 4 5
>>> Second one with
>>> Variables: vart 1 3 5
>>>
>>> As their names.
>>>
>>> Now I would like to drop the extra variables in data file 1 which are var 2 4.
>> *
>> * 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/
*
* 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/