Skip to content

aalfonso500-code/customer_behavior_eda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Customer Behavior & Revenue Analysis ” NovaRetail+" (2024)

Exploratory correlation analysis identifying the behavioral factors most strongly associated with annual revenue per customer on a Latin American e-commerce platform.


Business Problem

The Growth & Retention team at NovaRetail+ needed to understand which customer behaviors drive annual revenue, in order to prioritize strategic initiatives for 2024 year-end planning.

Core business question:

What customer behavioral factors are most strongly associated with annual revenue generated per user?


Project Objective

Conduct a structured correlational analysis across 15,000 customer records to identify, quantify, and interpret the behavioral signals most relevant to revenue performance and to distinguish statistically significant associations from practically meaningful ones.


Dataset

Attribute Detail
Records 15,000 customers
Features 12 variables
Missing values None
Source Internal platform data (NovaRetail+, 2024)

Variable overview:

Variable Type Description
id_cliente Identifier Unique customer ID
edad Numeric Customer age
nivel_ingreso Numeric Estimated customer income
visitas_mes Numeric Monthly platform visits
compras_mes Numeric Monthly purchases
gasto_publicidad_dirigida Numeric Targeted ad spend attributed to user
satisfaccion Numeric Satisfaction score (1–5 scale)
miembro_premium Binary Premium membership (1 = Yes, 0 = No)
abandono Binary Churn indicator (1 = Churned, 0 = Active)
tipo_dispositivo Categorical Device type (mobile, desktop, tablet)
region Categorical Geographic region (north, south, east, west)
ingreso_anual Numeric Target variable — Annual revenue per customer

Tech Stack

Python Pandas NumPy Seaborn Matplotlib SciPy


Methodology

This project follows a structured EDA and correlation analysis pipeline:

1. Data Loading & Inspection Validated dataset structure, dtypes, null counts, and shape.

2. Data Cleaning Corrected edad dtype from float64 to int64. No null imputation required.

3. Exploratory Analysis Descriptive statistics and distribution diagnostics across numeric, binary, and categorical variables.

4. Correlation Visualization Heatmap and scatterplot matrix to identify visual patterns before applying statistical methods.

5. Statistical Correlation Testing

Method Applied To
Pearson Linear relationships between continuous variables
Spearman Monotonic relationships with non-normal distributions or outliers
Point-Biserial Binary vs. continuous variable pairs
Cramer's V Categorical variable pairs

6. Business Interpretation Five structured findings with visual evidence, numerical evidence, interpretation, and business implication.

7. Limitations & Next Steps Explicit acknowledgment of correlation vs. causation, large-sample p-value inflation, and Simpson's Paradox risk.


Key Findings

Finding 1 ” Monthly Purchases: Dominant Revenue Driver

compras_mes is the only variable with a strong association with ingreso_anual (Pearson r = 0.967, p < 0.0001). Purchase frequency explains approximately 93.5% of the joint variation with annual revenue.

Business implication: Strategies targeting purchase frequency are the highest-leverage behavioral lever for revenue growth.

Finding 2 ” Ad Spend and Visit Frequency: Moderate Signal

Targeted advertising spend shows a moderate monotonic association with monthly visits (Spearman r = 0.559, p < 0.0001). High individual-level variability limits its predictive strength.

Business implication: Advertising investment is positively linked to traffic, but returns vary significantly by customer segment.

Finding 3 ” Premium Membership: No Meaningful Behavioral Differentiator

miembro_premium shows no practically relevant linear association with any continuous variable. All Point-Biserial coefficients fall below |r| = 0.10.

Business implication: Premium status alone does not distinguish customers by behavior or revenue contribution in this dataset.

Finding 4 ” Churn: No Linear Characterization via Available Variables

abandono shows negligible linear association with all continuous variables. The sole statistically significant pair (abandono vs satisfaccion, r = 0.024) has a negligible effect size.

Business implication: Linear correlation is insufficient to profile churned customers. Non-linear or clustering approaches are recommended.

Finding 5 ” Premium Membership vs. Churn: Weak but Detectable Signal

miembro_premium vs abandono is the only categorical pair with a meaningful Cramer's V (V = 0.120, p < 0.0001). Low magnitude; not a robust churn predictor.

Business implication: Merits further investigation specifically a cross-tabulation of premium churn rates disaggregated by satisfaction level.


Correlation Summary Table

Variable Pair Method Coefficient Magnitude
compras_mes vs ingreso_anual Pearson r = 0.967 Very Strong
gasto_publicidad_dirigida vs visitas_mes Spearman r = 0.559 Strong
compras_mes vs visitas_mes Pearson r = 0.350 Moderate
ingreso_anual vs visitas_mes Pearson r = 0.340 Moderate
ingreso_anual vs gasto_publicidad_dirigida Pearson r = 0.200 Weak
miembro_premium vs abandono Cramer's V V = 0.120 Low
All other binary/categorical pairs Point-Biserial / Cramér's V < 0.10 Negligible

Limitations

  • Correlation ≠  Causation. No finding in this analysis supports a causal interpretation.
  • Large sample effect. n = 15,000 produces significant p-values even for negligible effect sizes. Statistical significance and practical relevance are evaluated independently throughout.
  • Simpson's Paradox risk. Global correlations have not been verified within subgroups (region, tipo_dispositivo, miembro_premium).
  • Variables not included. Seasonality, promotional campaigns, and macroeconomic context are outside the scope of the available data.

Next Steps

Step 1 ” Simpson's Paradox verification Disaggregate primary correlations by region, tipo_dispositivo, and miembro_premium. Prioritize the compras_mes vs ingreso_anual pair.

Step 2 ” Customer segmentation Apply K-Means or hierarchical clustering to behavioral variables to identify differentiated customer profiles. Evaluate whether global correlation patterns hold within segments.

Step 3 ” Predictive modeling Develop a regression model using ingreso_anual as the dependent variable, with compras_mes, visitas_mes, and gasto_publicidad_dirigida as predictors. Evaluate multicollinearity before including correlated features simultaneously.


Skills Demonstrated

Technical Python Pandas NumPy Seaborn Matplotlib SciPy Exploratory Data Analysis Correlation Analysis Statistical Testing Data Cleaning Data Visualization Analytical Documentation

Analytical Statistical Thinking Effect Size vs. P-value Interpretation Business Insight Communication Structured Problem Solving Findings Reporting Analytical Limitation Awareness


Analysis conducted for the Growth & Retention team, NovaRetail+ (2024)

About

Exploratory data analysis identifying the customer behavioral drivers of annual revenue for an e-commerce platform using Python. Performed correlation analysis across customer metrics to surface the strongest revenue predictors and inform data-driven business recommendations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors