Im trying to create a model to predict transactions at a shop. I have the date and hour of the transaction with 4 other predictor variables.
I've provided the first 6 rows of the data below:
Date Hour Var1 Var2 Var3 Var4 Trans1 Trans2
01/01/18 1am 4 12 1 123 1 4
01/01/18 2am 6 14 0 126 3 6
01/01/18 3am 3 16 0 124 2 3
01/01/18 4am 4 12 1 122 3 7
01/01/18 5am 8 6 1 122 4 2
01/01/18 6am 4 11 1 123 5 8
I'm looking to predict both Trans1 and Trans2 using the Date, Hour, Var1, Var2, Var3 and Var4.
I've tried using the lm function but I'm unsure how to treat the date and hour variables.
I know that I need to account for seasonal and daily change in the model. What is the best modelling function in r to model this accurately?