reshape long gdp test road fin loan_balance invest,i(id)j(year)
xtset id year
gen lngdp=ln( gdp )
cd E:\学习、科研\逐年匹配
forvalues i=2008(1)2013{
preserve
cap keep if year=='i'
cap set seed 0001
cap gen ranorder=runiform()
sort ranorder
cap psmatch2 test road loan_balance invest fin, outcome( lngdp ) n(1) ate ties logit common
noreplace
cap drop if _weight ==.
cap save 'i'.dta, replace
restore
}