This project analyzes customer spending patterns in an e-commerce platform using R and statistical modeling techniques. The analysis focuses on identifying key factors that influence annual customer spending.
The dataset contains the following variables:
- Time on Website (minutes)
 - Time on App (minutes)
 - Average Session Length (minutes)
 - Length of Membership (years)
 - Yearly Amount Spent (USD)
 
- Visualized relationships between engagement metrics and spending
 - Examined distributions of key variables
 - Analyzed pairwise correlations between all numerical variables
 
- Simple linear regression predicting Yearly Amount Spent from Length of Membership
 - Multiple linear regression incorporating all engagement metrics
 
- 80/20 train-test split
 - Calculated performance metrics:
- Root Mean Squared Error (RMSE)
 - Mean Absolute Percentage Error (MAPE)
 - R-squared (R2)
 
 
- Membership duration is the strongest predictor of customer spending (β = $64.22 per year)
 - Time spent on mobile app shows stronger correlation with spending than website time
 - The multiple regression model explains 98% of spending variation (R2 = 0.98)
 - Model achieves $9.97 RMSE on test data
 
To reproduce this analysis:
- Install required packages:
 
install.packages(c("ggplot2", "knitr", "scales"))- Run the Quarto document:
 
quarto render analysis.qmdanalysis.qmd: Main analysis documentdata/ecomdata.csv: Dataset_quarto.yml: Configuration file
- R (v4.0+)
 - Quarto (v1.2+)
 - R Packages:
- ggplot2
 - knitr
 - scales