Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73281

merging two data sets.

$
0
0
I want to merge two datasets.
Both contain the same company name. But the problem is one file has multiple years.
e.g.
company name. Year
Alpha 2005
Aplha 2006
Alpha 2007
Alpha 2008
Beta 2007
Beta 2008
Beta 2009
Gema 2005
Gema 2006
Gema 2007
Gema 2008
other dataset contain company name and a binary variable (Mgm)

Company name Mgm
Alpha 1
Beta 0
Gema 1

How can I merge two data sets so that the Mgm value go in front of each year and company like this.

company name. Year Mgm
Alpha 2005 1
Aplha 2006 1
Alpha 2007 1
Alpha 2008 1
Beta 2007 0
Beta 2008 0
Beta 2009 0
Gema 2005 1
Gema 2006 1
Gema 2007 1
Gema 2008 1

Here years are not evenly distributed(some firms has years from 2005-2008 others 2006-2009 and so on.

Viewing all articles
Browse latest Browse all 73281

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>