Difference between revisions of "MatchingLBO.do"
Yimengtang (talk | contribs) (Created page with "=matchingLBO.do= This do file aims to match companies with the closest propensity score based on industry, year, and number of patents from STATApredictLBO.dta. ==Oct 18== us...") |
Yimengtang (talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | |||
This do file aims to match companies with the closest propensity score based on industry, year, and number of patents from STATApredictLBO.dta. | This do file aims to match companies with the closest propensity score based on industry, year, and number of patents from STATApredictLBO.dta. | ||
| − | == | + | ==Attempt 1== |
| − | use STATApredictLBO.dta, clear | + | use STATApredictLBO.dta, clear \\ |
| − | + | rename nopatents case_nopatents \\ | |
| − | + | rename logitpw case_logitpw \\ | |
| − | rename nopatents case_nopatents | + | rename gvkey case_gvkey \\ |
| − | rename logitpw case_logitpw | ||
| − | rename gvkey case_gvkey | ||
/*industry, year, and no. of patents*/ | /*industry, year, and no. of patents*/ | ||
Revision as of 11:14, 18 October 2016
This do file aims to match companies with the closest propensity score based on industry, year, and number of patents from STATApredictLBO.dta.
Attempt 1
use STATApredictLBO.dta, clear \\ rename nopatents case_nopatents \\ rename logitpw case_logitpw \\ rename gvkey case_gvkey \\
/*industry, year, and no. of patents*/ joinby industrygroup3 year using STATApredictLBO.dta gen a = nopatents*0.95 gen b = nopatents*1.05 gen delta=abs(logitpw-case_logitpw) drop if case_nopatents > b | case_nopatents < a
// GENERATE SOME RANDOM NUMBERS TO RANDOMLY BREAK ANY TIES // ON CLOSENESS OF MATCH OF MARKET VALUE set seed 1020 gen double shuffle1 = runiform() gen double shuffle2 = runiform()
by case_gvkey (delta shuffle1 shuffle2), sort: keep if _n == 1 drop delta shuffle1 shuffle2
( )Error op. sys. refuses to provide memory