0

I have a time series that looks like this:

  year         a        b    event         x
1 1950  0.033222        2        0  1055.461
2 1950  0.033222      345        0  1055.461
3 1950  0.033222      290        0  1055.461
4 1950  0.033222      355        0  1055.461
5 1950  0.033222      710        1  1055.461
6 1950  0.033222       36        0  1055.461

I want to know what happens to x over time when the dummy variable "event" goes to 1. Moreover, I would like to know the effect over 30 years. So my problem is that there might be some other 1 that will appear 12 or 21 years later for example. How can I control for one single event or take into account all the event that might arise during 30 years?

I would like to have something like:

lm(x~event, data=data)

where x is at year t and event all the events that occurred the 30 previous years

I wanted to use VAR package but I don't see how you can add a dummy in their function.

4

0 回答 0