Hi All,
I have a panel of data, with firms, analysts and time. So different analysts issue forecasts for different firms over time.
I am using asreg to run a regression of y on x for each analyst-firm across all dates as follows:
bys analyst firm: asreg y x, se
I want to do this regression on a rolling basis, using all observations in the previous N years for each analyst and firm.
I saw the response of Professor Attaullah Shah, https://www.statalist.org/forums/for...gression-asreg
where he suggests something like:
bys analyst firm : asreg y x, wind( year 9) min(5) As I understand it, in this example, the data were annual, so wind(year 9) ensures that the model uses the 9 previous observations which is the same as 9 years of data. However, my issue is that in my data the time spacing between observations (i.e. the forecasts by analyst A for company X) is irregular, i.e., it is not years or months, it when the analyst issues a forecast. So somehow the model must take into account the time between the date of a given forecast by A for X (say day t) and the previous forecasts by A for X (in days t-i), and run a regression using only the forecasts where the time gap between t and t-i is within N years. Any help on whether this could be done within asreg would be much appreciated. with best wishes, Costas
I have a panel of data, with firms, analysts and time. So different analysts issue forecasts for different firms over time.
I am using asreg to run a regression of y on x for each analyst-firm across all dates as follows:
bys analyst firm: asreg y x, se
I want to do this regression on a rolling basis, using all observations in the previous N years for each analyst and firm.
I saw the response of Professor Attaullah Shah, https://www.statalist.org/forums/for...gression-asreg
where he suggests something like:
bys analyst firm : asreg y x, wind( year 9) min(5) As I understand it, in this example, the data were annual, so wind(year 9) ensures that the model uses the 9 previous observations which is the same as 9 years of data. However, my issue is that in my data the time spacing between observations (i.e. the forecasts by analyst A for company X) is irregular, i.e., it is not years or months, it when the analyst issues a forecast. So somehow the model must take into account the time between the date of a given forecast by A for X (say day t) and the previous forecasts by A for X (in days t-i), and run a regression using only the forecasts where the time gap between t and t-i is within N years. Any help on whether this could be done within asreg would be much appreciated. with best wishes, Costas
Comment