I hope to find some help in preparing my dataset for analyses.
My dataset contains individual, daily data on a.o.:
- week no.
- week day
- no. of exposures to tv commercials of brand x
- no. of exposures to online commercials of brand x
- purchases of brand x
I want to aggregate this data to week level, and analyse the effect of different media sequences (first tv, then online; first online, then tv; and simultaneously tv & online) on purchase behaviour. I want to create 2 variables that count the no. of tv exposures and the no. of online exposures before the first purchase in a week (!), and create 3 dummies for these different sequences (taking place before the first purchase in a week).
Since I have 1.176 individuals * 90 days = 105.840 lines, I don't want to create these sequencing variables manually. Is there anyone who can help me doing in a smart (hopefully (partially) automatic) way?
Looking forward to your responses.