{"id":31097341,"url":"https://github.com/ibrahimasifali94/sql_ab_test_metrics","last_synced_at":"2026-05-17T02:05:13.614Z","repository":{"id":315089380,"uuid":"1058061883","full_name":"ibrahimasifali94/sql_ab_test_metrics","owner":"ibrahimasifali94","description":"SQL A/B test metrics with DuckDB – CTR, lift, p-value, and retention","archived":false,"fork":false,"pushed_at":"2025-09-16T15:50:37.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T02:04:50.509Z","etag":null,"topics":["ab-testing","analytics","duckdb","sql"],"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/ibrahimasifali94.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T15:12:35.000Z","updated_at":"2025-09-16T15:51:26.000Z","dependencies_parsed_at":"2025-09-16T17:57:17.712Z","dependency_job_id":"c00fb05d-b674-403d-9903-a87296c91ae9","html_url":"https://github.com/ibrahimasifali94/sql_ab_test_metrics","commit_stats":null,"previous_names":["ibrahimasifali94/sql_ab_test_metrics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibrahimasifali94/sql_ab_test_metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasifali94%2Fsql_ab_test_metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasifali94%2Fsql_ab_test_metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasifali94%2Fsql_ab_test_metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasifali94%2Fsql_ab_test_metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibrahimasifali94","download_url":"https://codeload.github.com/ibrahimasifali94/sql_ab_test_metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimasifali94%2Fsql_ab_test_metrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33125184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"online","status_checked_at":"2026-05-17T02:00:05.366Z","response_time":107,"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","analytics","duckdb","sql"],"created_at":"2025-09-16T19:03:03.237Z","updated_at":"2026-05-17T02:05:13.609Z","avatar_url":"https://github.com/ibrahimasifali94.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL A/B Test Metrics\n\n**TL;DR:** DuckDB SQL to compute CTR lift, daily CTR, and D1 retention for a synthetic A/B test — with a z-test and p-value.\n\n## What’s inside\n- Problem: Measure whether variant **B** improves click-through rate (CTR) vs **A** and impact on D1 retention.\n- Approach: Pure SQL over CSVs (DuckDB). Includes sanity checks, lift calc, and a two-sided z-test.\n- Data: Synthetic CSVs in `data/` (generated by `generate_data.py`).\n- Result: On this seed, B shows 1.30% absolute lift (28.14% relative lift) with a p-value of 0.039 (statistically significant)\n\n## How to run\n```bash\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -r requirements.txt\npython generate_data.py     # optional if you want fresh data\nduckdb -c \".read queries.sql\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimasifali94%2Fsql_ab_test_metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibrahimasifali94%2Fsql_ab_test_metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimasifali94%2Fsql_ab_test_metrics/lists"}