Hi,
I have a list of data from the compustat and the execucomp databases already merged together for the years 2001 to 2006. This data seems to be correct..

I have another dataset with patent data from the NBER database, merged with a patent file with the right assignee. This one contains all the patents applied for by each company (GVKEY) and for the year in which the companies applied for this patent (ayear) and npat, the number of patents for each pdpass-year.
Now when I merge these two databases (I seem to only be able to use joinby instead of a merge), it gives me all the financial data for every fiscal year multiple times (for every ayear). Therefore I'm not able to correctly create mean variables etc.
This is what it looks like:

Is there another way to merge them, so I will only keep one observation per fiscal year, but I will be able to see in which year they applied for a patent?
Thanks in advance.
Sabine
I have a list of data from the compustat and the execucomp databases already merged together for the years 2001 to 2006. This data seems to be correct..
I have another dataset with patent data from the NBER database, merged with a patent file with the right assignee. This one contains all the patents applied for by each company (GVKEY) and for the year in which the companies applied for this patent (ayear) and npat, the number of patents for each pdpass-year.
Now when I merge these two databases (I seem to only be able to use joinby instead of a merge), it gives me all the financial data for every fiscal year multiple times (for every ayear). Therefore I'm not able to correctly create mean variables etc.
This is what it looks like:
Is there another way to merge them, so I will only keep one observation per fiscal year, but I will be able to see in which year they applied for a patent?
Thanks in advance.
Sabine
Comment