Hello everyone,
This is my first time posting here, so thank you in advance for your patience and guidance.
I am trying to bootstrap an indirect effect in a dynamic panel model using `xtdpdbc`. My code is:
However, I get the following error:
Context:
This is my first time posting here, so thank you in advance for your patience and guidance.
I am trying to bootstrap an indirect effect in a dynamic panel model using `xtdpdbc`. My code is:
Code:
****** VARIABLE SETTING
global yvar roa
global xvar i.envresp
global medvar sales
global controls lev age size capin loss
global reps = 1000
capture program drop btstp
program btstp, rclass
xtdpdbc $medvar $xvar $controls ,vce(robust) teffects
scalar a= r(table)["b","1.envresp"]
xtdpdbc $yvar $xvar $medvar $controls, vce(robust) teffects eigtolerance(0.1)
scalar b = r(table)["b","sales"]
return scalar IE = a * b // Indirect effect
end
bootstrap Ind_Eff = r(IE), reps($reps) seed(123): btstp
eststo roa_bootstrap: estat bootstrap, percentile bc
x: Error occurred when bootstrap executed btstp.
insufficient observations to compute bootstrap standard errors; no results will be saved
insufficient observations to compute bootstrap standard errors; no results will be saved
Context:
- Panel data is set with xtset id year, yearly.
- Using Stata 18.5
- The command xtdpdbc runs fine outside the bootstrap.
- The sample size is around 579 panels and 2316 firm-year observations.
- Any advice or alternative approaches would be greatly appreciated.
Code:
clear input long id int year double roa byte envresp float sales double lev float(age size) double capin byte loss 1 2019 2.417122729624633 0 26.4506 20.262438608629477 3.465736 26.654966 1.2267458411349768 0 1 2020 7.08437667668948 0 26.312157 18.299980787011723 3.496508 26.72797 1.5155983604464973 0 1 2021 4.70437512775878 0 26.32985 17.298522588100703 3.5263605 26.754595 1.5291980159315426 0 1 2022 5.022683132841968 0 26.47878 16.303177943459072 3.555348 26.78676 1.36067121155973 0 2 2019 -28.43574482175618 0 24.34402 67.81047317679503 3.9318256 25.69538 3.8626545649881887 1 2 2020 -12.584930386649724 0 23.72984 61.600364956025864 3.9512436 25.237066 4.514193264864659 1 2 2021 -12.878327306682744 0 23.554525 59.53947964898848 3.970292 25.25149 5.45736297270399 1 2 2022 -14.115050349616004 0 23.39154 60.63256862696945 3.988984 25.24624 6.389794985386821 1 3 2019 3.365177374694643 0 26.258837 42.85646633123861 4.3307333 27.89051 5.112416695813176 0 3 2020 1.0743788556747147 0 26.144075 37.357823035579706 4.3307333 27.82362 5.363105897470925 0 3 2021 1.8351236778965072 0 26.32803 36.853748949317676 4.3307333 27.8251 4.468558044968795 0 3 2022 .3872273416761475 0 26.320875 33.417645127444665 4.3307333 27.762243 4.226479478622616 0 4 2019 -1.353600881019171 0 28.23542 65.45971017997765 4.1743875 28.7727 1.7113448430560212 1 4 2020 2.7935409690617465 1 28.348515 64.8874186810189 4.189655 28.762754 1.5132218801096042 0 4 2021 2.09165584147271 0 28.31265 67.63034559349867 4.204693 28.86397 1.7355377959413272 0 4 2022 2.793502609553412 1 28.4295 62.60017936205068 4.2195077 28.764935 1.3985444456239964 0 5 2019 1.8950821901815418 1 28.01169 18.522881608286134 4.3307333 28.28956 1.3203151730757687 0 5 2020 8.897787405135656 1 28.080784 18.202540511725633 4.3307333 28.39177 1.3647704165158119 0 5 2021 4.502650737955088 0 28.115995 15.922643977384304 4.3307333 28.42017 1.3555033205341407 0 5 2022 3.9829953675955876 1 28.17704 14.668593376729211 4.3307333 28.452774 1.3174982339203027 0 end format %ty year label values id id label def id 1 "000020", modify label def id 2 "000040", modify label def id 3 "000050", modify label def id 4 "000080", modify label def id 5 "000100", modify

Comment