Preparing data for survival analysis Goal: build a survival analysis to understand user behavior in an online site. 
I have a data set of an online site where user appear from the first time and the last time. I am trying to build a survival analysis. Using this information.
userId, firstEntry, lastEntry
001,11/6/2012,11/6/2012
002,9/9/2005,9/9/2005
003,11/13/2013,8/1/2014
004,2/2/2006,2/2/2006
005,9/17/2005,9/17/2005
006,9/1/2005,1/26/2010
007,9/21/2005,9/26/2011
008,3/30/2011,3/30/2011
009,9/5/2005,9/5/2005
010,1/14/2010,1/14/2010

How do I create the event column (censor) to really do a survival analysis. Should I apply the logic of "how many days it took to come back" and use that to create event column along with a column representing the gap.
If the firstEntry and the lastEntry are the same, that means thats the only time user enter the site.  
My goal was to fallow something similar to this.
https://docs.google.com/file/d/0BwogTI8d6EEibDVxakozYVdZc0k/edit 
I haven't decided yet to do this in R or Python. I am open for language agnostic answer or language specific answer.
 A: You need an event for survival analysis to predict survival probabilities over a given period of time for that event (i.e time to death in the original survival analysis).  In your case, perhaps, you  are looking for a churn analysis. So chern of your customers  is equal to their death. To do a simple analysis that serves your purpose,  all you need is a table of customers with a binary value indicating whether they have churned and a time associated with that. This time measure the time passed from their FirstEntry. So, you need the following data:
Customer ID    time     churn
       1        100       0
       2        72        1
       3        590       0
       ...

I made up this data, just as an example. You have to define a dummy variable as the churn column, depending on the problem. Perhaps, you want to label them as either churned or not based on frequency or recency of visit or transactional behaviour. 
A: "Censored" individuals in survival analysis are those for whom the "event" hasn't yet happened. So if an individual has the same firstEntry and lastEntry times and that can only happen if the person only visited the site one time, then those are the individuals that should be considered "censored." Anyone who came back would have an "event" at the time of the lastEntry.
This might not, however, be a good application for survival analysis, at least in its simplest form. What if an individual can enter the site more than twice?
If an individual can come back multiple times then it seems that you would want to know about all the intervening visits to the site. The meaning of, say, 6 years between firstEntry and lastEntry would be different for someone who only visited those 2 times and someone who visited daily for 6 years; it's not clear how your data distinguish those possibilities. The first case is a highly infrequent visitor, while the second is very frequent. If you have information about multiple visits from the same individuals, then you should consider some analysis of recurrent events.
Even if individuals only can enter twice, how sure are you that there wasn't a second entry on the same day as the first? Again, someone who returned that quickly ought to be distinguished from someone who never returned at all.
