I am trying to model the number of (web) page-visits that different products receive during a period of time, using different characteristics of these products. I am using a linear regression model:
$Y_i$ ~ $a_i + b_i + c_i + \epsilon$, where $a_i, b_i$ and $c_i$ correspond to the different characteristics of the product with id $i$, and $Y_i$ is the total number of views that product $i$ has received over a one-month period.
I need to control for day of the month since in general, higher promotions/discounts are offered towards the end of the month, so the page-visits are higher the closer we get to the end of month, regardless of the product type. However, this is not possible as $Y_i$ is (an aggregate representing) the total number of views that product $i$ has received over the one-month period.
So, instead, I am planning to introduce to the model an additional independent variable $z_i \in [1,30]$ which is a summary statistic of $Y_i$ representing the mean of the days of the month of the product's page-visits. So if most visits for product $i$ took place on day 28 of the month, then $z_i$ would be higher than in the case where the visits mostly happened in the first week.
However, it seems to me that this might be an incorrect way of thinking since $z$ is a summary statistic related to $Y$, in other words, related to the time of the page-visits of the product and not day of the month (or how close it is to the end of month). My question is, can I still use $z$ as a control variable in this case, and if so, can I say that products get more visits as we move closer to the end of the month (of course assuming that the coefficient for $z$ is positive and significant)?
Is there a better way of doing this?
Any insights are appreciated. Thanks.
P.S. I am using R.