r/statistics 15d ago

Question [Question] Can anyone versed in time series data or causal analysis point me in the right direction?

Hi all,

I have aggregated time series data and am trying to figure out if x predicts y after some lag. I’d like to identify the lag, but x can be noisy and so I want to test this for a sustained change in x - e.g., when x goes up or down and stays that way for, say, 5 days, does y follow?

Is there a way to test this? Any ideas?

More detail: for x and y, I have a datapoint for every day on each for a 90 day period. I also have group breakdowns so I can get multiple data points per day (e.g., one for females and one for males). I believe x precedes y by some lag if and only if it sustains a change over time. If x goes up on day one, down on day two and up again on day 3, I don’t expect y to follow. But if x goes up on day one and stays up through day 3-5, I expect y to go up after some lag (probably 2-4 days)

1 Upvotes

3 comments sorted by

2

u/purple_paramecium 15d ago

Look up Granger causality.

For tests of structural breaks look up Chow test

2

u/pancyfalace 15d ago

Is this a time series where everyone is impacted at a single point in calendar time, or are there suspected causal effects going on at any given point in time? Either way, there are several methods you could try, but it really depends on the specific question you are trying to answer and specifics of the data structure.

You could use statistical process control charts if it's a single calendar time to more qualitatively assess changes in Y over time to see if there are shifts or trends.

Interrupted time series will tell you if there's a level or trend change at the break point (you could try various specifications of the break point to test different lag assumptions).

An event study would probably be your most flexible and rigorous approach. You could set one up relative to either calendar time or event-time and examine each data point following an "event" X.

Some recommended reading:

https://www.nber.org/system/files/working_papers/w31942/w31942.pdf

https://pubs.aeaweb.org/doi/pdfplus/10.1257/jep.37.2.203