Running logistic regression on a sales data 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?

 A: As far as the problem with recency goes, there is no way around it given your current system of assigning values.  Recency is a simple function of purchase:  no purchase, no value assigned for recency.  Thus the variable is of no use in predicting purchase.  Relevance has a similar problem, being the other side of the coin.  One could make a single variable out of the recency and relevance values (if purchase, call this new variable 1; if no purchase, call it 0) and still this would contribute nothing to prediction of purchasing behavior.
In your last paragraph you ask about 

the conversion rate of visits to visits that contribute to a sale.

This can be treated just like time spent or pages viewed--in other words, analyzed at the level of each individual.  If you include it in a logistic regression with multiple predictors, you might want to use each individual's a) number of visits  b) mean time spent per visit  c) mean number of pages viewed per visit. Or you might substitute median for mean.  Each of these can be included as main effects.  You may also want to interact number of visits with the other two.
