If you can figure out the iffy psuedo-psuedocode below, I'm trying to
run 1 ols regression over 4 different date ranges (so total 4
regressions) with 1 dependnet variable and 1 independant variable..
but I want to run a kpss test on both the depvar and indvar before
doing the regression for each date range, then utilize either the
variable or its fiorst-differenced version depending on the results of
the kpss (at 5%, hopefully).
Can this be done in hansl?
start_yr = 1855 1860 1865 1870
end_yr = 1894 1899 1904 1909
## get MyDepVar and myIndVar from file, then
for i in start_yr, end_yr
smpl start_yr end_yr
kpss 3 myDepVar ## and capture results
if stationary = True:
tempDepVar = MyDepVar
else:
tempDepVar = d_MyDepvar
kpss 3 myIndVar ## and capture results
if stationary = True:
tempIndVar = myIndVar
else:
tempIndVar = d_myIndVar
ols tempDepVar tempIndVar
--
Best regards,
Timothy M. Nall
Assistant Professor
National Quemoy University
Kinmen, Taiwan