Compustat and NBER Patent Data
Posted: 15 May 2013 11:13 AM   [ Ignore ]
Newbie
Rank
Total Posts:  17
Joined  2013-01-12

Dear Forum members,

I am planning to match Compustat with patent data for a research project. Those links are important starting points for patent/innovation research:

NBER Patent Data Project: https://sites.google.com/site/patentdataproject/Home
Description by B. H. Hall: http://elsa.berkeley.edu/~bhhall/NBER06.html
U.S. Patent and Trademark Office data: http://www.uspto.gov/web/offices/ac/ido/oeip/taf/h_at.htm

Does anyone here already have experience in matching Compustat with patent data?

Profile
 
 
Posted: 15 May 2013 11:54 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Chris,

I have not seen such a join before. If you run into firm identifiers like cusip/sedol, gvkey, cik then that would be nice. In the worst scenario you would need to join on company name.

Let me know how it goes!

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 25 May 2013 10:15 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  17
Joined  2013-01-12

The NBER Patent Data Project members have comprehensively documented its data files. Besides numerous explanations some STATA code can be find in the “matchdoc” on their download page. Given that one has at least some basic knowledge in STATA it is relatively easy to implement it, and it seems to work quite well. Additional info is provided by the paper: THE NBER PATENT CITATIONS DATA FILE: LESSONS, INSIGHTS AND METHODOLOGICAL TOOLS (Hall/Jaffe/Trajtenberg 2001). The number of patent applications and granted patents are helpful variables when researching innovation activities and add to R&D which is rather an input measure.

Profile
 
 
Posted: 03 June 2014 07:45 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  1
Joined  2014-06-03

Hello,

I am trying to match my compustat data set with the patent data just as described above.

Currently I have a file with financial data sorted by gvkey and year.
Furthermore, I have downloaded the pdpcohdr and dynass files from the site: https://sites.google.com/site/patentdataproject/Home/downloads
And I downloaded the patent data file from http://elsa.berkeley.edu/pub/users/bhhall/NBER06.html.

The matchdoc.pdf file contains STATA code to merge the two data sets.
Two questions:

1) Looking at the patent data file above, I have multiple pdpasses and IPCs for each patent. For example:
year patent icl pdpass
1974 3930732 G01B 1500 10030734
1974 3930732 G01B 900 10030734

I want to create the variable npat, which containts number of patents for each pdpass-year. In the example, it should count as 1 patent for pdpass-year 10030734-1974. How do I create this in stata?

2) The stata example code says:

* now find the appropriate gvkey to assign the patents
gen gvkey=.
forvalue i=1/5 {
replace gvkey = gvkey`i’ if gvkey`i’~=. & year>=begyr`i’ &
year<=endyr`i’
}

When I perform this command I get the error code
invalid syntax
r(198);

I have the variables gvkey1 to gvkey5, begyr1 to begyr5, endyr1 to endyr5 (all from dynass file) and renamed appyear to year.
What could be wrong here?

Thanks in advance!

Best,
Tracy

Profile
 
 
Posted: 03 June 2014 11:57 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Tracy,

You can concatenate string variables in Stata as: gen newVar = var1 + var2
If you want to use a numeric variable, you first convert it to a string, see: http://www.stata.com/help.cgi?tostring

As for the loop; are you sure the test for unequal is done with ~=? My first guess would be that you’d need != there.

If that is not the problem, then trying to simplify the code. For example, first without the loop (e.g. replace gvkey = gvkey1 if gvkey1 != . & year > begyr1).

In the worst-case scenario, you could write the code without using a loop, since you only need 5 repeats.

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile