Bookmark and Share

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

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

Re: st: Some basic help on programming

From   Friedrich Huebler <>
Subject   Re: st: Some basic help on programming
Date   Wed, 11 Apr 2012 12:11:29 -0400


Add these lines to the commands from my earlier message:

contract common_id
drop _freq
foreach i of local items {
  merge common_id using "item`i'.dta"
  drop _merge
  sort common_id


On Wed, Apr 11, 2012 at 10:41 AM, Prakash Singh <> wrote:
> Friedrich
> In the data set we have key using which we can make commonid for firm
> and based on commonid I would like to merge data set.
> On Wed, Apr 11, 2012 at 6:29 PM, Friedrich Huebler <> wrote:
>> Prakash,
>> Please explain how you want to merge the files. Stata has more than
>> one way to combine different datasets.
>> Friedrich
>> On Wed, Apr 11, 2012 at 8:10 AM, Prakash Singh <> wrote:
>>> Thanks a lot Friedrich
>>> This what I was thinking but I do not have even basic knowledge of
>>> programming in stata so was not able to keep hold of the issue, though
>>> I knew its possible to do it in stata.
>>> One more stupid question, is there way to programme the merging also
>>> for these file as its quite boring kind of do file repeating.
>>> Thanks in advance
>>> Prakash
*   For searches and help try:

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