Chronos: An R Script to Analyze the Distribution of Time Between Two Events

If someone asked you about your site’s conversion rates, you could probably tell them what the conversion rates are (right?). But what if someone asked you what % convert within an hour, a day, or a week?

We’ve been looking at this at Automattic and I wound up putting together an R script to help with the analysis. Because everything needs a fancy name, I dubbed it Chronos and you can check it out on Github.

All you need to do to use it is generate a CSV containing two columns: one with the unix timestamp of the first event and another with the unix timestamp of the second event:


The script will then show you the distribution of time between the two events as well as the percent that occur prior to a few fixed points (30 minutes, 1 hour, etc):

5% within 2 minutes 
10% within 5 minutes 
15% within 1 hour 21 minutes 
20% within 1 day 38 minutes 
25% within 3 days 2 hours 58 minutes 
30% within 6 days 9 hours 20 minutes 
33.33333% within 11 days 
35% within 14 days 
40% within 23 days 
45% within 42 days 
50% within 67 days 
55% within 95 days 
60% within 148 days 
65% within 210 days 
66.66667% within 232 days 
70% within 288 days 
75% within 390 days 
80% within 550 days 
85% within 677 days 
90% within 920 days 
95% within 1288 days 
100% within 1715 days 

Percentage by certain durations:
13% within 30 minutes
14% within 1 hour
17% within 5 hours
20% within 1 day
30% within 7 days

In addition to analyzing conversion rates, you can use this to measure things like retention rates. The data above, for example, looks at how long between when users logged their first beer and last beer in Adam Week‘s handy beer tracking app, BrewskiMe (thank you again Adam for providing the data).

If you run into any issues or have any suggestions for how to improve it just let me know.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s