How to correlate on sharp data changes I'm trying to correlate changes in atmospheric pressure with headache intensity. I 'know' that there is a strong correlation in my case but out of curiosity I'm willing to take data for as long as I care.
I'm taking daily pressure data and registering headache intensity in the range 1-4 (no pain to pain strong enough to take painkillers).
The dataset looks like this:




Date
Atm. pressure
Headache intensity




9/2
1011 mbar
1 pain


9/3
1011 mbar
1 pain


9/4
1014 mbar
4 pain


9/5
1016 mbar
4 pain


9/6
1016 mbar
1 pain


9/7
1015 mbar
2 pain




And so on. As far as I know, the correlation lies in sharp changes of pressure, not in the fact that there is more or less pressure in a given day.
How could I study this correlation?

The simplest way would be to take the absolute value of the difference of each pressure value to its last value $\Delta p(t) = p(t)-p(t-1)$ and then calculate the correlation between this finite difference and the pain value.
