Changes

Jump to navigation Jump to search
==In 2019==
 
===First things===
Restore '''allpatentsprocessed''' (as researcher):
It also looks like some development notes are missing. I can't find them in either E:\mcnair\Projects\LBO\Clean\Ed Run or the LBO dropbox, or Dropbox\coauthoredprojects\NonMcNair.
 
However, Analysis.do loads/merges the following:
*PreMergeRelevant.dta, which is produced by Datasetup.do, after a ''keep if savefilter''. The sole input to Datasetup.do is '''masterv1-0.txt'''
*matchresultsV7, which comes from '''matchresults - V7 nofe lagps 92 R0 indu3 20pc 5yr.txt''', which is generated by running LBOmatchscript.jl on MatchInputV7.txt, which in turn is made by Datasetup.do
*PatentStatistics.dta, which needs to be produced using PatentMeasures.sql on '''allpatentsprocessed''' once all matches have been identified
*CPI.dta
 
export delimited gvkey year lboentry lboexit patentflow patentstock lagpatentstock indu3 indu5 indu6 decade logitpreg logitpregwindu3fe logitpregwfe
hadlbo matchfilter somepatenting using "E:\McNair\Projects\LBO\Clean\Ed Run\MatchInputV7.txt", delimiter(tab) nolabel quote replace
 
===PatentMeasures.sql===
PatentMeasures.sql takes MatchedGVKeys.txt (184) and builds the patent measures (see below) in '''allpatentsprocessed''', producing MatchedMeasuresPortfolio.txt (8468), which is merged in Analysis.do after being resaved as PatentStatistics.dta.
ORDER BY gvkeyint, year;
--8648
 
So, Analysis.do loads/merges the following:
*PreMergeRelevant.dta, which is produced by Datasetup.do, after a ''keep if savefilter''. The sole input to Datasetup.do is '''masterv1-0.txt'''
*matchresultsV7, which comes from '''matchresults - V7 nofe lagps 92 R0 indu3 20pc 5yr.txt''', which is generated by running LBOmatchscript.jl on MatchInputV7.txt
*PatentStatistics.dta, which needs to be produced using PatentMeasures.sql on '''allpatentsprocessed''' once all matches have been identified
*CPI.dta
 
export delimited gvkey year lboentry lboexit patentflow patentstock lagpatentstock indu3 indu5 indu6 decade logitpreg logitpregwindu3fe logitpregwfe
hadlbo matchfilter somepatenting using "E:\McNair\Projects\LBO\Clean\Ed Run\MatchInputV7.txt", delimiter(tab) nolabel quote replace
===Analyzing DataExtension.sql===
*patenthistorybase ...,GvkeyYear -> gvkeyyearpatentdata (395213)
Therefore needed inputs to DataExtension.sql are:
*patentexpiry
*stdcompnames
*assignees
*StataStaging4
 
===PatentExpiry===
 
The '''patentexpiry''' table was built in '''allpatentsprocessed''' by running PatentExpiry.sql, which is in E:\mcnair\Projects\LBO\Clean\Ed Run and was last updated in March 2018. Most of the script is comment. The key elements are:
 
The stack is as follows:
*'''patents''' is an input
*Maintfeeevents2 FROM 'MaintFeeEvents_20170410b.txt' (COUNT 14708262)
*PatentExpirationRules2 FROM 'patentExpirationRules2.txt' (COUNT 27)
*Maintfeeevents2,patentexpirationrules -> patentfeebaseevents (4402215)
*FULL OUTER (patents, patentfeebaseevents) -> patentfeebasefull (5463947) -> PatentExpiryBase (5463947) -> PatentExpiry (5463947)
 
Note that patentfeebaseevents is made from PatentExpirationRules and not PatentExpirationRules2. Both list the same fee codes and description, but PatentExpirationRules2 has a termlength column whereas PatentExpirationRules has daysincrement and daysduration columns. daysduration is the same as termlength, except when daysduration=7300 then termlength=6205. It seems from the code that PatentExpirationRules is correct, as there is a manual fix when max(daysduration)=7300.
 
DROP TABLE PatentExpiry;
CREATE TABLE PatentExpiry AS
SELECT patentnumber, FilingDate, grantdate, maxdaysduration, nomaintenance, maxtermfix1, maxtermfix2,
CASE
--Old patents get: grant plus 17yrs
WHEN nomaintenance = 1 THEN grantdate + 6205
-- Patents grandfathered in during transition in 1995 to new file date + 20 year term limit get: Later of issue date + 17 years or file date + 20 years used
WHEN (maxtermfix1 = 1 AND maxdaysduration = 7300)
THEN GREATEST(FilingDate + 7300, grantdate + 6205)
--Patents after June 8 1995 but before May 28 2000 get: file date + 20 years
WHEN (maxtermfix2 = 1 AND maxdaysduration = 7300)
THEN FilingDate + 7300
--Patents after May 28 2000 (this might not be automatic and require an appeal though) get: later of issue date + 17 years or file date + 20 years
WHEN (maxtermfix2 = 2 AND maxdaysduration = 7300)
THEN GREATEST(FilingDate + 7300, grantdate + 6205)
ELSE grantdate + maxdaysduration
END AS expdate,
CASE WHEN nomaintenance = 1 OR maxdaysduration = 7300 THEN 1::int ELSE 0::int END AS HeldToTerm
FROM PatentExpiryBase;
--5463947
==Ed's version from 2018==

Navigation menu