In R I'm setting up a dataset to run a logistic regression on. I have two question regarding the selection of independent variables.
I will first briefly explain the dataset: The dataset contains of visits to a website. Some of these visits will eventually lead to a sale. Some will not. Each visit shows the time the user spend on the website and the number of pages they have viewed. If a user eventually buys the data entry also gets field called relevance and a field called recency (how long it takes until the order is made). Visits can come from multiple parties and several visits can lead to one sale (e.g. customer enters yesterday via an channel, and does not buy, next day customer enters via another channel and buys). I have the following questions:
- the time spend on the website and the number of pages viewed are available for all visits (thus visits that turn into a visit that assisted to a sale (1) and visits that don’t (0). Visits that do not turn into a sale have no relevance and thus would get a value appointed of 0. Recency however is only measured for visits that eventually lead to a sale, thus only when the dependent variable has a value of 1. How to incorporate this?
- Furthermore there are also some general measures which are channel specific and thus not row specific. (for instance: the conversion rate of visits to visits that contribute to a sale). I suppose it is not right to put this variable in on a per row basis, since these variables are not row specific. How to incorporate these in the model?