Measuring customer retention using cohort analysis in R

Within the e-commerce field, customer retention metrics can be considered crucial for several reasons. Among these, the virtual absence of a barrier to entry for competitors in the virtual arena makes online sellers very willing to build an enduring relationship with their customers.

This recipe gives you a straightforward way to compute retention metrics within the R environment.

From the possible methods available for these tasks, we will use one from the family of cohort methods.

In this method, customers are divided into homogenous groups (that is, cohorts) that share relevant segmentation attributes, such as sex or age.

Purchases made by those groups are monitored monthly over a period of ...

Get RStudio for R Statistical Computing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.