R: Dynamic regressions: how to include time in a regression

Viewed 40

To summarise the problem, I have a project in R where I need to study the correlation between a company's promotional activities and the number of its sales per month and per location.

I have this type of database:

UGA   Date     Nb_Sales  Nb_Mails  Nb_Visits  Nb_Events
A     01/2018   12         3         5           8
B     02/2018   14         0         2           5
c     03/2018   10         2         4           3

With Nb_Sales: my variable to explain. It corresponds to the number of sales

And Nb_Mails, Nb_visits, Nb_Events : These are the explanatory variables. They correspond to the numbers of promotional activities

UGA is the location

For the moment, I have carried out regressions without taking time into account. However, in real life, when a promotional activity is carried out at time t, it will affect sales at time t, but also at t+1, t+2... It is therefore necessary to take into account the temporal aspect in my regressions.

Do you have any idea how to do this? And what R code I should use?

Thanks in advance

0 Answers
Related