- Business Overview
- Key Benefits
- Project Objectives
- Repository Layout
- Technology Infrastructure
- Critical Insights
- Getting Started
- Visual Analytics
- Data Dictionary
- Methodology
- Strategic Recommendations
- Contributing
- License
This end‑to‑end analytical solution empowers insurance stakeholders to measure processing efficiency and detect fraudulent patterns using synthetic data generated in R. It translates raw claims information into actionable business intelligence.
- Full R analysis pipeline (
Main code.R) - Synthetic data generator (
Datos.R) - Interactive and static visualizations
- Executive dashboard
- Fraud risk scoring engine
- Comprehensive data dictionary
| Dimension | Impact |
|---|---|
| Operational Agility | Uncovered 60‑day bottlenecks in Health claims, enabling process redesign |
| Risk Mitigation | Isolated concentrated fraud patterns, focusing investigative resources |
| Predictive Clarity | Validated severity as the primary driver of resolution time |
| Benchmarking | Established comparative standards across insurance products |
| Early Warning | Deployed a scoring system for proactive fraud detection |
- Quantify average resolution times for claims
- Identify anomalies and fraud indicators via statistical patterns
- Visualize critical performance metrics for decision‑making
- Define operational benchmarks per insurance type
- Implement a risk scoring framework
- Enable continuous monitoring capabilities
insurance-claims-analysis/ │ ├── data/ │ ├── policies.csv # Policy master data │ ├── clients.csv # Client information │ ├── claims.csv # Claims transaction data │ └── payments.csv # Payment records │ ├── scripts/ │ ├── Datos.R # Synthetic data generation (R) │ └── Main code.R # Complete analysis pipeline │ ├── outputs/ │ ├── visuals/ # Generated visualizations │ │ ├── resolution_density_by_type.png │ │ ├── resolution_boxplot_by_type.png │ │ ├── resolution_by_severity_type.png │ │ ├── monthly_resolution_trend.png │ │ ├── top_20_suspicious_claims_heatmap.png │ │ ├── fraud_score_by_severity.png │ │ ├── client_resolution_efficiency.png │ │ ├── claim_frequency_heatmap.png │ │ └── claim_amount_heatmap.png │ └── tables/ │ └── fraud_risk_executive_summary.html │ ├── infographic ├── .gitattributes ├── Presentation ├── LICENSE ├── README.md └── .gitignore
| Component | Technology | Purpose |
|---|---|---|
| Data Generation | R | Synthetic dataset creation |
| Analysis | R | Statistical modeling |
| Visualization | ggplot2, plotly | Interactive and static charts |
| Reporting | gt, htmltools | Automated report generation |
| Version Control | Git, GitHub | Code collaboration |
install.packages(c( "dplyr", "lubridate", "tidyverse", "ggplot2", "plotly", "knitr", "scales", "gt", "stringr", "htmltools" ))
| Category | Finding | Strategic Implication |
|---|---|---|
| Overall | Mean: 38.3 days, Median: 35 days, SD: 19.5 days | High variability indicates inconsistent processes |
| Health Claims | Highest median (60 days) for medium severity | Critical bottleneck requiring workflow audit |
| Life Claims | Fastest resolution (25 days) for medium severity | Benchmark for other segments |
| Severity Impact | Clear monotonic relationship: severity ↑ → time ↑ | Severity is a high‑importance predictor |
| Indicator | Detected Patterns | Priority |
|---|---|---|
| Client Concentration | Client #12: 6 claims, 40% of high‑risk flags | Critical |
| Rapid Resolution | 1‑day closure detected | High |
| Severity Correlation | 70% of high‑risk claims are high severity | Medium |
| Portfolio Risk | 93% claims healthy baseline; 1 critical case | Low |
- Young‑Life Segment: $297K exposure (200% above expected) – top investigation priority
- Senior‑Health Segment: $211K exposure (250% above expected) – significant deviation
- Age Gap Anomaly: No health claims under 41 despite high frequencies in older groups
- Auto Claim Spike: 51‑60 age group shows concentrated activity
- Life Claims Pattern: Only appears in 61‑80 age range
- Clone the repository:
git clone https://github.com/yourusername/insurance-claims-analysis.git cd insurance-claims-analysis
- Set working directory in R scripts:
# Modify base_path in Main code.R to your local path base_path <- "C:/Your/Path/To/Insurance"
source(" Datos.R ")
This creates four CSV files: policies.csv, clients.csv, claims.csv, and payments.csv.
source("scripts/Main code.R")
The script automatically executes:
- Initialization
- Data preprocessing
- Merging (creates
claims_full) - Descriptive analysis
- Resolution time analysis
- Visualization generation
- Anomaly detection
- Fraud scoring
- Executive summary
Multi‑panel analysis reveals:
- Health claims: widest spread and longest tail
- Auto claims: narrowest, most consistent window
- Severity as the clear driver
- Outlier concentration in high‑severity claims
- Cyclical patterns identified
- Peaks consistently exceeding the 35‑day benchmark
- Smoothed trend line indicates process health
- Early warning signals for proactive intervention
- Client concentration patterns
- Score distribution by severity (low: ~21, medium: ~24, high: ~38)
- Priority targets highlighted
- Heteroscedasticity: variance increases with severity
- Exposure hotspots by age and insurance type
- Statistical deviations from expected patterns
- Risk concentration visualisation
| Field | Type | Description |
|---|---|---|
| policy_id | int | Unique policy identifier |
| type_insurance | string | Auto, Life, Health, Home |
| modality | string | Monthly, Annual, Quarterly |
| id_client | int | Foreign key to clients |
| issue_date | date | Policy issue date |
| start_date | date | Policy start date |
| end_date | date | Policy end date |
| policy_status | string | Active, Canceled, Expired, Suspended, Renewed |
| premium_monthly | numeric | Monthly premium amount |
| premium_annual | numeric | Annual premium amount |
| insured_amount | numeric | Total insured value |
| deductible | numeric | Deductible amount |
| Field | Type | Description |
|---|---|---|
| id_claim | int | Unique claim identifier |
| id_client | int | Foreign key to clients |
| id_policy | int | Foreign key to policies |
| claim_date | date | Date of occurrence |
| notification_date | date | Date reported |
| closure_date | date | Date closed |
| claim_type | string | Accident, Theft, Fire, Liability, Other |
| severity | factor | Low, Medium, High |
| claimed_amount | numeric | Amount claimed |
| approved_amount | numeric | Amount approved |
| paid_amount | numeric | Amount paid |
| claim_status | string | Registered, In Process, Closed, Rejected, Under Investigation |
| resolution_days | numeric | Days from claim to closure |
| Field | Type | Description |
|---|---|---|
| id_client | int | Unique client identifier |
| gender | string | Male, Female, Other |
| age_group | string | 20-30, 31-40, 41-50, 51-60, 61-70, 71-80 |
| income_level | string | Low, Medium, High |
| occupations | string | Professional, Technical, Worker, Retired, Unemployed, Other |
| Field | Type | Description |
|---|---|---|
| id_payment | int | Unique payment identifier |
| id_policy | int | Foreign key to policies |
| payment_date | date | Date of payment |
| payment_amount | numeric | Payment amount |
| payment_method | string | Debit, Card, Bank Transfer, Cash |
| payment_status | string | Paid, Pending, Overdue, Rejected |
| days_overdue | numeric | Days payment is overdue |
- Descriptives: Mean, median, SD for resolution times
- Distributions: Density plots, boxplots by category
- Time Series: Monthly trend with smoothing
- Outlier Detection: IQR and percentile thresholds
- Heteroscedasticity: Variance analysis across segments
- Rapid Resolution: Claims closed <5 days (25 points)
- High Frequency: >5 claims per client in 30 days (25 points)
- Extreme Amounts: >95th percentile claimed (20 points)
- Disparity: Claimed >80% of insured value (20 points)
- Severity Flags: High severity claims (10 points)
- Per indicator: 5‑25 points
- Total score: 0‑100
- Tiers:
- Critical: >45
- High: 35‑44
- Medium: 25‑34
- Low: <25
- Investigate Client #12: Account‑level review of 6 claims within 30 days
- Audit Health Claims: Root‑cause analysis for 60‑day median
- Implement Early Warning: Monitor when resolution times approach 35‑day threshold
- Review High‑Severity Cases: Focus on Auto and Life outliers
- Segment‑Based Workflows: Differentiate processes by severity
- Predictive Modeling: Use severity as a key feature
- Recurring Monitoring: Weekly review of resolution and fraud scores
- Client‑Level Scoring: Aggregate fraud scores per client
- Network Analysis: Identify connected fraud patterns
Contributions are welcome! Follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow tidyverse style guide
- Document functions with roxygen2
- Add comments for complex logic
- Maintain consistent naming conventions
This project is licensed under the MIT License – see the LICENSE file for details.
For questions, suggestions, or collaboration, please open an issue or contact the project maintainer.
Last Updated: August 2026
Status: Completed – Ready for Review
⭐ Star this repository if you find it useful!