/*This is a Stata program file. It replicates the estimation, testing and graphs reported in Threshold Effects in Non-Dynamic Panels: Estimation, Testing and Inference" of Hansen(1999).*/ ****************************************************************************************************** clear clear matrix set more off import excel "L:\website data\tobinq\tobinq.xlsx", sheet("Tobinq") firstrow clear xtset id year xthreg i q1 q2 q3 d1 qd1, qx(d1) rx(c1) thnum(2) grid(400) trim(0.01 0.01) bs(300 300) /*we fit a double-threshold model. The triming values are set to be 0.01 and 0.01 for the estimation of the first and second thresholds. We use grid(400) to reduce the computation cost. The bootstrap number is set to bs(300 300). qx(varname) is the threshold variable. rx(varname) is the regime-dependent variable.*/