Comparing Different Groups of Customers
This section walks through an example comparing different groups of subscribers using attributes that are known when they start. These attributes are called time-zero covariates because they are known at tenure zero. The next chapter investigates approaches for working with time-dependent covariates, things that happen during customers’ lifetimes.
Summarizing the Markets
The subscriber data contains three markets: Gotham, Metropolis, and Smallville. A good way to start the analysis is by looking at the proportion of customers in each market who are active as of the cutoff date. The following query generates interesting summary information by market:
SELECT Market, COUNT(*) as customers, AVG(Tenure) as avg_tenure, SUM(CASE WHEN StopType IS NULL THEN 1 ELSE 0 END) as actives, AVG(CASE WHEN StopType IS NULL THEN 1.0 ELSE 0 END ) as ActivesRate, MIN(StopDate) as minStopDate FROM Subscribers s WHERE StartDate ...