Hi all,
I tried doing a Jorda style local projection regression with parallel bootstrapping. However, I run into the following error: "Seeds provided -1- doesn't match seeds needed -4-
invalid numlist has too few elements". Please find my code below (I use the parallel command by Vega Yon GG, Quistorff B)
I tried doing a Jorda style local projection regression with parallel bootstrapping. However, I run into the following error: "Seeds provided -1- doesn't match seeds needed -4-
invalid numlist has too few elements". Please find my code below (I use the parallel command by Vega Yon GG, Quistorff B)
Code:
local level "log cu g"
foreach i in `level'{
gen quarters_`i' = _n-1 if _n<=6 // for no. quarters to use in IRF
gen zero_`i' = 0 if _n<=6 // for zero line
gen b_`i'=0 // for the OLS coefficient estimates at each quarter
gen u_`i'=0 // for the OLS upper bound of CI
gen d_`i'=0 // for the OLS lower bound of CI
}
*3. OLS regs for IRF (cumulative)
eststo clear
xtset,clear
// Parallelize
parallel initialize 4,f
// Run LPs
forv h = 0/5 {
*run OLS regression and collect estimates for shock
parallel bs, reps(500) seed(400): reghdfe ln_loans`h' lag_unaffected_firm shock`h', a(co_code#creditor_code creditor_code#year) vce(cluster id)
*save estimated coefficients in b variable
replace b_log = _b[lag_unaffected_firm] if _n == `h'+1
*save upper limit of 95%CI using u variable
replace u_log = _b[lag_unaffected_firm] + 1.96* _se[lag_unaffected_firm] if _n == `h'+1
*save lower limit of 95%CI using d variable
replace d_log = _b[lag_unaffected_firm] - 1.96* _se[lag_unaffected_firm] if _n == `h'+1
*save regression estimates
eststo
}
