I am a web developer and novice statistician.
My data looks something like this
Subject Week x1 x2 x3 x4 x5 y1 A 1 .5 .6 .7 .8 .7 10 B 1 .3 .6 .2 .1 .3 8 C 1 .3 .1 .2 .3 .2 6 A 2 .1 .9 1.5 .8 .7 5 B 2 .3 .6 .3 .1 .3 2 D 2 .3 .1 .4 .3 .5 10
I am trying to predict y1 as a product of the x variables. However, I have reason to believe that there may be a lag in the effect of the multiple x variables on y1, i.e the x variables from week 1 for subject A influence y1 for subject A in week 2.
Note that not all subjects will have data points for every week (in fact most won't). Subjects will tend to have data points for say week 1, 2, 3, 4 then drop off and not show up again until week 7,8,9. I am willing to restrict my analysis to data points where we have data for the previous N weeks given my hypothesis about lag.
Like I said, I am a novice and am unsure of the best way to deal with a dataset of this form. I am hoping to carry out this analysis either in R, Python, or some combination of the two. I don't think that the current week's x variables will have no effect. I think they will have some effect, perhaps greater than previous weeks. I just believe that previous weeks will have some effect.
I am expecting there to be two to three weeks of lag. To give a little context, the analysis that I am attempting here relates to judging the quality of online traffic. Every week I get a score rating the quality of a certain stream of users I send to a given website. I am trying to find secondary metrics, such as browser distribution, percent duplicate clickouts, etc. that will allow me to predict what that score will be ahead of time.