{"id":21839996,"url":"https://github.com/nero103/ab-test-comparing-ride-fare","last_synced_at":"2026-05-21T05:32:06.172Z","repository":{"id":188123897,"uuid":"678144086","full_name":"Nero103/AB-Test-Comparing-Ride-Fare","owner":"Nero103","description":"This is an A/B test to compare the ride service fare payments to find which one generates the most revenue.","archived":false,"fork":false,"pushed_at":"2026-05-12T20:55:28.000Z","size":1648,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-12T22:29:22.456Z","etag":null,"topics":["ab-testing","confidence-intervals","hypothesis-testing","python3","significance-testing","statistical-analysis","statistical-models","t-test"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nero103.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-13T20:32:59.000Z","updated_at":"2026-05-12T20:55:31.000Z","dependencies_parsed_at":"2024-11-27T21:22:34.065Z","dependency_job_id":"67bbbb6f-0e25-417f-892d-812b9f7ab674","html_url":"https://github.com/Nero103/AB-Test-Comparing-Ride-Fare","commit_stats":null,"previous_names":["nero103/ab-test-comparing-ride-fare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nero103/AB-Test-Comparing-Ride-Fare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nero103%2FAB-Test-Comparing-Ride-Fare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nero103%2FAB-Test-Comparing-Ride-Fare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nero103%2FAB-Test-Comparing-Ride-Fare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nero103%2FAB-Test-Comparing-Ride-Fare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nero103","download_url":"https://codeload.github.com/Nero103/AB-Test-Comparing-Ride-Fare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nero103%2FAB-Test-Comparing-Ride-Fare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33289831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ab-testing","confidence-intervals","hypothesis-testing","python3","significance-testing","statistical-analysis","statistical-models","t-test"],"created_at":"2024-11-27T21:21:59.614Z","updated_at":"2026-05-21T05:32:06.167Z","avatar_url":"https://github.com/Nero103.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AB-Test-Comparing-Ride-Fare\n\nStatistical A/B testing project analyzing New York City TLC ride payment data to determine whether credit card or cash payments generate higher ride revenue.-\n\n# Overview\n\nThis project analyzes New York City Taxi and Limousine Commission (TLC) ride data to evaluate the relationship between payment type and total ride revenue. The goal was to determine whether customers paying by credit card or cash generated significantly different average fare amounts.\n\nUsing Python, exploratory data analysis (EDA), and a two-sample t-test, the project compared the average total ride amounts between credit card and cash transactions.\n\nThe analysis found that:\n\n* Credit card payments averaged approximately **$17.66** per ride\n* Cash payments averaged approximately **$13.55** per ride\n* The test produced a **t-statistic of 20.35**\n* The resulting **p-value was 4.53e-91**\n\nWith a significance level of 5%, the findings indicate a statistically significant difference between the two payment methods.\n\n\n# Business Understanding\n\nThe New York City TLC wanted to better understand which payment type generated more revenue in order to support future operational or payment-related business strategies.\n\nThe project focused on answering the question: Is there a statistically significant difference in total fare amount between customers paying by credit card and customers paying by cash?\n\n\n# Tools \u0026 Libraries Used\n\n* Python\n* Jupyter Notebook\n* Pandas\n* NumPy\n* SciPy\n* Matplotlib\n\n\n# Project Workflow\n\n## 1. Data Loading \u0026 Preparation\n\nThe dataset was imported into Python using Pandas for analysis.\n\n```python\nimport pandas as pd\ntaxi_data = pd.read_csv(\"2017_Yellow_Taxi_Trip_Data.csv\", index_col=0)\n```\n\n## 2. Exploratory Data Analysis (EDA)\n\nDescriptive statistics were used to better understand the distribution of ride and payment data.\n\n```python\ntaxi_data.describe(include='all')\n```\n\n### The analysis showed:\n\nCredit card transactions were the most common payment type\nThe average total ride amount across all rides was approximately $16.31\nSeveral outliers existed in fare-related fields\n\nPayment type counts:\n\n|Payment Type |\tCount|\n|------------|--------|\n|Credit Card\t| 15,265|\n|Cash | 7,267|\n|No Charge |\t121|\n|Dispute\t| 46|\n\n## 3. Hypothesis Testing\n\nA two-sample t-test was conducted to compare average total ride amounts between:\n\n* credit card payments\n* cash payments\n\n### Null Hypothesis (H0)\n\nThere is no statistically significant difference in average total ride amount between credit card and cash payments.\n\n### Alternative Hypothesis (H1)\n\nThere is a statistically significant difference in average total ride amount between credit card and cash payments.\n\nThe significance level was set to:\n\n```python\nsignificance_level = 0.05\n```\n\n# Statistical Test\n\n```python\nfrom scipy import stats\n\nt_stats, p_value = stats.ttest_ind(\n    a=credit_card['total_amount'],\n    b=cash['total_amount'],\n    equal_var=False\n)\n```\n\n## Results\n\n| Metric |\tValue|\n|--------|-------|\n|Credit Card Mean |\t$17.66|\n|Cash Mean |\t$13.55|\n|t-statistic|\t20.35|\n|p-value|\t4.53e-91|\n\nSince the p-value (4.53 x 10^-91) was significantly lower than the 5% significance threshold, the null hypothesis was rejected.\n\n# Key Findings\n\n* Customers paying by credit card generated higher average total ride amounts than customers paying by cash.\n* The difference between payment methods was statistically significant.\n* Credit card payments were associated with higher total revenue overall.\n\n# Important Analytical Considerations\n\nThis analysis was conducted using historical observational data rather than a true randomized experiment.\n\nSeveral important limitations were identified:\n\n* Riders were not randomly assigned a payment method\n* Longer trips may naturally favor credit card usage\n* Cash tips may not have been fully captured in the dataset\n* Total amount includes tips, which may inflate differences between payment types\n\nBecause of these factors, the analysis demonstrates correlation rather than direct causation.\n\nFuture analysis could compare:\n\n* base fare amount instead of total amount\n* trip distance by payment type\n* tip behavior separately from fare revenue\n\n# Conclusion\n\nThe analysis found a statistically significant difference between credit card and cash ride payments, with credit card transactions generating higher average total ride amounts.\n\nWhile the findings suggest that encouraging credit card payments could increase ride revenue, the project also highlights the importance of understanding observational data limitations and potential confounding variables when interpreting statistical results.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnero103%2Fab-test-comparing-ride-fare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnero103%2Fab-test-comparing-ride-fare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnero103%2Fab-test-comparing-ride-fare/lists"}