artur bala escribió: > Hello, > On an annual dataset spanning from 1970 to 2010, I want to create a > dummy valid from 2005 and on. > I tried the following command line : > * genr D = (t > "2005")* > but the newly created variable D has zeros only. Same result through the > GUI. > Note that this script does work fine for a monthly dataset (let's say > *genr D = (t > "2005:01")*). > best, > artur >
Artur, for annual data, "t" and "obs" refers to the 1-entry index. Thi is exactly the same as if you put a single number, genr D= t>2005, with quarterly or monthly data. This is indicating the observation at the 2005th place in the series. For the behaviour that you want, you should use genr D = (t > obsnum(2005)) (see discussion in gretl-dev list some months ago, initiated at the message: http://lists.wfu.edu/pipermail/gretl-devel/2010-February/002461.html ) -- Ignacio Diaz-Emparanza DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA) UPV/EHU Avda. Lehendakari Aguirre, 83 | 48015 BILBAO T.: +34 946013732 | F.: +34 946013754 www.ea3.ehu.es