{"id":21050391,"url":"https://github.com/cagandemirmr/game_chi_and_a-b_testing-sql","last_synced_at":"2026-06-17T20:35:22.950Z","repository":{"id":263039826,"uuid":"888901548","full_name":"cagandemirmr/Game_Chi_and_A-B_Testing-SQL","owner":"cagandemirmr","description":"In this repo, i use hypotetical mobile game company data set is used to make chi square test and A/B testing","archived":false,"fork":false,"pushed_at":"2024-11-15T18:18:15.000Z","size":1187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T23:12:52.144Z","etag":null,"topics":["ab-testing","chisquare-test","gameanalysis","gameanalytics","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":null,"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/cagandemirmr.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":"2024-11-15T08:19:32.000Z","updated_at":"2024-11-15T18:22:01.000Z","dependencies_parsed_at":"2024-11-15T19:24:53.595Z","dependency_job_id":"dd6c55b7-5b06-4705-b8ad-d8c173246942","html_url":"https://github.com/cagandemirmr/Game_Chi_and_A-B_Testing-SQL","commit_stats":null,"previous_names":["cagandemirmr/game_chi_and_a-b_test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cagandemirmr/Game_Chi_and_A-B_Testing-SQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cagandemirmr%2FGame_Chi_and_A-B_Testing-SQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cagandemirmr%2FGame_Chi_and_A-B_Testing-SQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cagandemirmr%2FGame_Chi_and_A-B_Testing-SQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cagandemirmr%2FGame_Chi_and_A-B_Testing-SQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cagandemirmr","download_url":"https://codeload.github.com/cagandemirmr/Game_Chi_and_A-B_Testing-SQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cagandemirmr%2FGame_Chi_and_A-B_Testing-SQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34465321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","chisquare-test","gameanalysis","gameanalytics","postgresql","sql"],"created_at":"2024-11-19T15:30:08.055Z","updated_at":"2026-06-17T20:35:22.926Z","avatar_url":"https://github.com/cagandemirmr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎮 Game Analysis with A/B Testing and Chi-Square Test\n\n## 📌 Project Overview\nThis project focuses on analyzing game-related user data to evaluate the effectiveness of different onboarding variants using **A/B testing** and the **Chi-Square test**. The goal is to determine whether variant changes influence user engagement and purchases. For this analysis, I utilized **SQL** to gather insights and perform statistical tests.\n\n---\n\n## 📂 Data Import and Setup\n- Imported CSV files into SQL tables using the `CREATE TABLE` statement and loaded data using the file paths.\n- The dataset consists of artificially generated data using ChatGPT, simulating user behaviors and actions in a game environment.\n\n![Data Import](https://github.com/user-attachments/assets/9462f787-fe4d-4c21-a3c1-bae1578719e1)\n\n---\n\n## 📊 About the Dataset\n\n### 1. Experiment Assignments (`exp_analysis`)\n- **Rows**: 100,172\n- **Columns**: 4 (`exp_name`, `user_id`, `exp_date`, `variant`)\n- **Details**:\n  - `exp_name`: Contains a single experiment labeled \"Onboarding\".\n  - `user_id`: Contains **100,172 distinct values**.\n  - `exp_date`: Ranges from **2020-01-01** to **2020-02-19**, with 50 unique dates.\n  - `variant`: Two groups - **Variant 1** and **Control Group**.\n\n### 2. Game Actions (`game_actions`)\n- **Rows**: 124,185\n- **Columns**: 3 (`user_id`, `action`, `action_date`)\n- **Details**:\n  - `action`: Includes \"onboarding complete\" and \"email_optin\".\n  - `user_id`: **87,124 distinct values**.\n  - `action_date`: Ranges from **2020-01-01** to **2020-02-19**, with 50 unique dates.\n\n### 3. Game Purchases (`game_purchases`)\n- **Rows**: 12,897\n- **Columns**: 3 (`user_id`, `purch_date`, `amount`)\n- **Details**:\n  - `user_id`: **9,969 distinct values**.\n  - `purch_date`: Ranges from **2020-01-01** to **2020-03-11**, with 70 unique dates.\n  - `amount`: Contains 6 distinct purchase values: **2.99, 10, 25, 50, 100, 999**.\n\n![Data Summary](https://github.com/user-attachments/assets/bfdcbec4-530d-4563-b220-d062bb2e04bd)\n\n---\n\n## 🧪 A/B Testing \u0026 Chi-Square Analysis\n\n### 1. Initial Chi-Square Test\n- Conducted a **Chi-Square test** online to compare the success rates between **Variant 1** and the **Control Group**.\n- **Result**: Variant 1 was significantly more successful.\n\n![Chi-Square Result](https://github.com/user-attachments/assets/b8a54e15-0217-4110-a2fd-e119da9e37ae)\n\n### 2. Calculating Statistical Metrics\n- Used SQL functions (`AVG`, `STDDEV`) to compute **mean** and **standard deviation** for further statistical analysis.\n\n![Metrics Calculation](https://github.com/user-attachments/assets/38c7e657-1e3a-4807-a017-7074245697f5)\n\n### 3. Updated Chi-Square Test\n- Recalculated the Chi-Square test with SQL-derived metrics.\n- **Result**: No significant difference between **Variant 1** and **Control** after recalculating.\n\n---\n\n## 🎯 Hypothesis Testing\n\n### 1. Onboarding Completion Analysis\n- Joined the `game_actions` table to assess the total number of users who completed onboarding.\n- **Result**: The null hypothesis was rejected, indicating a significant difference between the two variants.\n\n![Onboarding Analysis](https://github.com/user-attachments/assets/936f0a90-29c8-4f3a-a080-2f19f422bb39)\n\n### 2. Success Metric: Purchase Behavior\n- Redefined the success metric as **user purchases** and reran the analysis.\n- **Result**: Significant difference between the two variants based on purchase behavior.\n\n![Purchase Analysis](https://github.com/user-attachments/assets/7364925b-6b08-4f50-9457-0b68e05cdf5d)\n\n### 3. 7-Day Interval Analysis\n- Performed an analysis to evaluate differences over a 7-day interval.\n- **Result**: No significant difference between the variants in a week-by-week comparison.\n\n![7-Day Analysis](https://github.com/user-attachments/assets/d6d550a9-9c61-4fcb-9d35-e2222e212674)\n\n### 4. Time Period Analysis\n- Analyzed differences between two distinct time periods.\n- **Result**: Significant differences observed, but reliability may be affected by external factors.\n\n![Time Period Analysis](https://github.com/user-attachments/assets/4ed2b317-00de-4e97-9f18-7ce25ad4c1f2)\n\n### 5. Country-Based Analysis (Canada vs. USA)\n- Compared user behavior between Canada and the USA.\n- **Result**: Differences were noted, but conclusions may be unreliable due to varying population sizes and demographic factors.\n\n![Country Analysis](https://github.com/user-attachments/assets/71d84b24-312a-4b6d-8f3b-f4bfdbda2f95)\n\n---\n\n## 📊 Insights and Conclusions\n1. **Variant 1** initially appeared to be more effective than the Control group based on onboarding actions.\n2. However, when shifting the metric to actual **purchases**, the difference between the variants became less clear.\n3. The time-based analysis revealed fluctuations that could be due to external factors, making it necessary to control for variables like seasonality or promotional events.\n4. Country-specific analyses suggest that demographic factors may influence game engagement and purchases.\n\n---\n\n## 🛠️ Tools and Technologies\n- **SQL**: Data extraction, transformation, and analysis.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcagandemirmr%2Fgame_chi_and_a-b_testing-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcagandemirmr%2Fgame_chi_and_a-b_testing-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcagandemirmr%2Fgame_chi_and_a-b_testing-sql/lists"}