资源预览内容
第1页 / 共35页
第2页 / 共35页
第3页 / 共35页
第4页 / 共35页
第5页 / 共35页
第6页 / 共35页
第7页 / 共35页
第8页 / 共35页
第9页 / 共35页
第10页 / 共35页
亲,该文档总共35页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
世界银行Beeps案例,Dr. Chuntao Lee,Beeps 数据,clear set more off global path = “d:春涛教程世界银行“ use $path世界银行Beeps数据.dta, clear,country,country,国家代码,substr(),drop year gen year = real(substr(country,-4,4) replace country = substr(country, 1, length(country)-4),split str_variable, parse(parse_strings),drop year split country,p(200) drop country rename country1 country gen int year=2000+real(country2) drop country2,subinstr(s1,s2,s3,n),gen str4 s_year = string(year) replace country=subinstr(country,s_year,“,1) 或者简洁为: replace country=subinstr(country,string(year),“,1),country,drop year gen year = real(substr(country,-4,4) replace country = substr(country, 1, length(country)-4) replace country = “Turkey“ if country=“Turkey-b“ replace country = “Vietnam“ if country=“Vietnam-b“ rename c_abbr c_code,industry,decode industry, gen(temp) drop industry rename temp industry gen str20 ind = industry replace ind = “Leather & Garments“ if industry=“Leather“ |industry=“Garments“ replace ind = “Food & Beverages“ if industry=“Food“ |industry=“Beverages“ replace ind = “Auto & Transport Equip“ if industry=“Auto and auto components“ | industry=“Other transport equipment“ replace ind = “IT services“ if industry=“Telecommunications“ replace ind = “Non-metallic & plastic“ if industry=“Non-metallic and plastic materials“ bysort ind: keep if _N=100 tab ind, gen(ind),R&D,rename c280 RD rename c274a1y sales gen RD_sales =RD/sales replace RD_sales =0 if RD=. replace RD_sales = 1 if RD_sales1 & RD_sales=.,Firm Size & Age,gen large = (size_new=3) gen median = (size_new=2) gen firm_age = year-c201 recode firm_age -1=. replace firm_age = ln(1+firm_age),Firm Age,histogram firm_age if firm_age100, bin(30) norm,replace firm_age = ln(1+firm_age) histogram firm_age, bin(30) norm,gen large_city = (c2071=2),Market power,c216a1 : Number of competitors (domestic private firms) gen mkt_power = (c216a1=4),Manager Education,rename c271 manager_edu tab manager_edu replace manager_edu =(manager_edu=4 & manager_edu=.),Corporate Governance,gen gov_owner=(c205b9=1) gen corporation = (c2024) recode gov_efficient 1=0 if c234=.,Other controls,gen large_city = (c2071=2) gen internet=(c224a=1 | c224b=1),合并IPR,sort c_code merge c_code using $path/macro_control/IPR_2010, nokeep drop _m,IPR,clear insheet using d:/春涛教程/世界银行/macro_controlipr_2010.txt, clear drop c_code rename region country replace country =“South Korea“ if country=“Korea (South)“ replace country =“Kyrgyzstan“ if country=“Kyrgyz Republic“ sort country merge country using d:/春涛教程/世界银行/macro_controlcountry_code keep if _m=3 drop _m drop if c_code=“ rename internationalpropertyrightsindex InterPR rename legalandpoliticalenvironment legal_envi rename physicalpropertyrights PPR_2010 rename intellectualpropertyrights IPR_2010 drop country sort c_code save d:/春涛教程/世界银行/macro_controlipr_2010, replace,PPI,sort c_code merge c_code using $path/macro_control/park_PPI, nokeep drop _m,工具变量,sort c_code merge c_code using $path/macro_control/indy, nokeep drop _m sort c_code merge c_code using $path/macro_control/latitude, nokeep drop _m sort c_code merge c_code using $path/macro_control/religion, nokeep drop _m sort c_code merge c_code using $path/macro_control/fractionalization, nokeep drop _m,sample,preserve sort country by country: keep if _N800 tabstat RD_sales, s(N mean sd) by(country) c(s) save tabstatmat RD_sales mat l RD_sales, format(%10.4f) tabstat IPR_2010 PPI_2005 InterPR, s(mean) by(country) c(s) save tabstatmat legal mat l legal, format(%10.4f) mat RD_legal = RD_sales, legal mat l RD_legal, format(%10.4f) restore,sample,Summary Statistics,tabstat gov_owner large_city audit gov_efficient corporation internet large median manager_edu mkt_power firm_age ln_gni, s(mean sd min median max) c(s) long save tabstatmat firm_data mat firm_data = firm_data mat l firm_data, format(%7.3f),Summary Statistics,T-test,ttable2 gov_owner large_city audit gov_efficient corporation / internet large median manager_edu mkt_power firm_age ln_gni,by(RD_D),T-test,pwcorr,pwcorr RD_sales IPR_2010 gov_owner large_city audit gov_efficient corporation internet large median manager_edu firm_age mkt_power ln_gni, star(5) 演示如何将相关系数表放到Word里面,regression,logit RD_sales IPR_2010 gov_owner large_city audit gov_efficient corporation mkt_power internet large median manager_edu firm_age ln_gni ind2-ind22 est store m1 logit RD_sales PPI_2005 gov_owner large_city audit gov_efficient corporation mkt_power internet large median manager_edu firm_age ln_gni ind2-ind22 est store m2 logit RD_sales InterPR gov_owner large_city audit gov_efficient corporation mkt_power internet large median manager_edu firm_age ln_gni ind2-ind22 est store m3,regressions,tobit RD_sales IPR_2010 gov_owner large_city audit gov_efficient corporation mkt_power internet large median manager_edu firm_age ln_gni ind2-ind22, ll(0) ul(1) est store m4 tobit RD_sales PPI_2005 gov_owner large_city audit gov_efficient corporation mkt_power inte
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号