# Measuring effects between two times series (one time series on another)

I'd like to see if a nations overall consumption can be tied to a specific retail company's sales. E.g. does the sales follow the nation-wide consumption pattern? Both datasets are time-series.

What types of models could be suited to examine this relationship and is it possible to measure, how positive/negative fluctuations impact the sales?

I've looked into VAR models and Granger-causality, but I'm not really how well-suited that framework is :-)

Data example is listed below - Consumer Confidence Index is an indicator of the national economy. Consumtion is sales from a specific retail company in that country. I want to investigate the effects between these two series - more specific: Is the Consumption affected by the CCI and how to which extend? E.g. if there's a downfall in CCI, how long after is Consumption affected?

+-----------+---------------------------+---------------------+-------------+-------------+
| YearMonth | Consumer Confidence Index |     Consumption     |   LN(CCI)   | LN(Consump) |
+-----------+---------------------------+---------------------+-------------+-------------+
| 2017M01   |                       4.5 |  33,215,017.63 kr.  | 1.504077397 | 17.31851267 |
| 2017M02   |                       4.8 |  35,981,578.98 kr.  | 1.568615918 | 17.39851767 |
| 2017M03   |                       6.2 |  54,961,027.07 kr.  | 1.824549292 | 17.82213489 |
| 2017M04   |                       7.4 |  39,680,064.70 kr.  |     2.00148 | 17.49635947 |
| 2017M05   |                       5.8 |  34,272,294.13 kr.  | 1.757857918 | 17.34984783 |
| 2017M06   |                       7.1 |  33,543,793.70 kr.  | 1.960094784 | 17.32836242 |
| 2017M07   |                      10.5 |  43,976,684.81 kr.  | 2.351375257 | 17.59917016 |
| 2017M08   |                       7.6 |  42,991,206.24 kr.  | 2.028148247 | 17.57650615 |
| 2017M09   |                       7.3 |  46,268,968.39 kr.  | 1.987874348 | 17.64998207 |
| 2017M10   |                       7.1 |  47,737,723.24 kr.  | 1.960094784 | 17.68123249 |
| 2017M11   |                       7.6 |  84,451,560.04 kr.  | 2.028148247 | 18.25168867 |
| 2017M12   |                       6.5 |  84,466,488.61 kr.  | 1.871802177 | 18.25186543 |
| 2018M01   |                       8.2 |  32,688,045.95 kr.  | 2.104134154 |    17.30252 |
| 2018M02   |                       8.5 |  39,931,582.68 kr.  | 2.140066163 | 17.50267811 |
| 2018M03   |                       8.5 |  44,494,026.82 kr.  | 2.140066163 | 17.61086551 |
| 2018M04   |                       7.1 |  37,040,708.13 kr.  | 1.960094784 | 17.42752809 |
| 2018M05   |                       9.3 |  30,947,987.98 kr.  |   2.2300144 | 17.24781855 |
| 2018M06   |                      10.6 |  34,216,652.19 kr.  | 2.360854001 | 17.34822299 |
| 2018M07   |                       9.7 |  36,951,218.56 kr.  | 2.272125886 | 17.42510918 |
| 2018M08   |                       7.8 |  43,106,866.06 kr.  | 2.054123734 | 17.57919285 |
| 2018M09   |                       6.9 |  39,188,426.53 kr.  | 1.931521412 | 17.48389202 |
| 2018M10   |                       5.1 |  46,988,200.81 kr.  |  1.62924054 | 17.66540708 |
| 2018M11   |                       4.3 |  77,098,474.96 kr.  | 1.458615023 | 18.16059406 |
| 2018M12   |                       2.9 |  80,397,942.19 kr.  | 1.064710737 | 18.20249914 |
| 2019M01   |                       3.9 |  30,520,831.96 kr.  | 1.360976553 | 17.23392002 |
| 2019M02   |                       3.3 |  33,652,148.46 kr.  | 1.193922468 | 17.33158746 |
| 2019M03   |                       3.8 |  36,100,177.92 kr.  | 1.335001067 | 17.40180835 |
| 2019M04   |                       3.7 |  31,302,084.62 kr.  |  1.30833282 | 17.25919525 |
| 2019M05   |                       5.9 |  34,452,606.24 kr.  | 1.774952351 | 17.35509521 |
| 2019M06   |                       5.8 |  28,028,045.09 kr.  | 1.757857918 | 17.14871618 |
| 2019M07   |                       2.9 |  34,144,945.84 kr.  | 1.064710737 | 17.34612513 |
| 2019M08   |                       6.3 |  38,263,514.48 kr.  | 1.840549633 | 17.46000738 |
| 2019M09   |                       4.3 |  34,506,487.96 kr.  | 1.458615023 | 17.35665792 |
| 2019M10   |                       1.7 |  45,186,431.95 kr.  | 0.530628251 | 17.62630742 |
| 2019M11   |                       1.4 |  71,957,629.40 kr.  | 0.336472237 | 18.09158802 |
| 2019M12   |                       2.5 |  69,157,266.12 kr.  | 0.916290732 | 18.05189369 |
+-----------+---------------------------+---------------------+-------------+-------------+

• Look into SARMAX models , also called Transfer Functions or Dynamic Regression . If you post your data I might be able to give you more detail. See my following answer for threads stats.stackexchange.com/questions/353491/… – IrishStat Mar 20 '20 at 18:14
• @IrishStat Added the dataset - sorry for the slow reply. – Artem Mar 24 '20 at 8:28

Here is a plot of your output series CONS visually suggesting 2 deterministic seasonal pulses (months 11 and 12 ) AND not a seasonal auto-projective scheme. Additionally there is a suggestion of a level shift not a downwards trend this no differencing. There is no indication of increased variance anywhere suggesting to need to do Weighted Least Squares OR or any form of a power transform like logs/square roots etc.

Now as a precursor to advanced causal model analytics a simple plot oy CONS and the candidate predictor CCI shows periods of a positive relationship and periods of an inverse relationship suggesting no consistent effect.

I used AUTOBOX ( which I have helped to develop) to systematically/automatically sort out a possible positive conclusion about the relationship/predictability between these two series. I will show the steps here.

The pre-whitened ( in this case since the predictor variable was free of autocorrelation … showing here the pw filter based on CCI ) we have suggesting a simple model which lead to the following deterministic structure being identified via Intervention Detection culminating in this joint model suggesting a decidedly non-significant CCI .

In order to test the hypothesis of constancy of the variance of the error process we use the TSAY test which considers deterministic change points here and the Box-Cox test which considers linkages between the expected value and the variance of the errors here

The final model is here and here with residual plot here strongly suggesting randomness.

The Actual/Fit and Forecast graph is here

Finally there is no apparent effect on Cons for any response to CCI changes over time.

• Thanks for the thorough reply - I'll need to read it through carefully and try to understand the software you've used before I accept your answer. I mainly turn to Python for these things :-) – Artem Mar 25 '20 at 5:48