// // Program: SBIN.do // Written by: Larry Taylor and Joe Cardinale, Fall 2007 // // Purpose: Inputs empirical cycle results // program define SBIN, rclass set more off set memory 10M /* for Intercooled Stata users */ // // Specify the file you are inputting. Below is assuming a tab deliminated // text file with turning points already calculated // insheet s using c:\lehigh\lehigh_stata\tp_expand.txt, clear tab // // Generate variables used for the empirical regression and for significance testing // following the bootstrapping process // gen t = _n /* Equals the Observation number */ gen phase = 1 replace phase = phase[_n-1] + s[_n-1] if t > 1 gen DUR = 1 replace DUR = 1 if s[_n-1] == 1 & t > 1 replace DUR = DUR[_n-1] + 1 if s[_n-1] == 0 & t > 1 gen prob = phase[_N] / _N return scalar prob = prob // // The underlying regression to be used in simulation // quietly regress s DUR gen ttesthat = _b[DUR] / _se[DUR] return scalar ttesthat = ttesthat di "The empirical t-ratio is " ttesthat di "The coefficient of the duration variable is " _b[DUR] drop t s DUR phase // // Compress data -- allow Stata to optimize data storage to minimize size restrictions // quietly compress end