{"id":22445473,"url":"https://github.com/anas436/confidence-intervals-for-differences-between-population-parameters-with-python","last_synced_at":"2026-04-18T02:08:57.388Z","repository":{"id":110394384,"uuid":"559292390","full_name":"Anas436/Confidence-Intervals-for-Differences-between-Population-Parameters-with-Python","owner":"Anas436","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-29T17:01:39.000Z","size":289,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T15:31:00.074Z","etag":null,"topics":["confidence-intervals","inferential-statistical-analyses","jupyterlab","matplotlib-pyplot","numpy","pandas","python3","seaborn"],"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/Anas436.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":"2022-10-29T16:54:57.000Z","updated_at":"2022-10-29T17:03:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7de06ac0-680b-406f-baa5-b5298b6eecf5","html_url":"https://github.com/Anas436/Confidence-Intervals-for-Differences-between-Population-Parameters-with-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FConfidence-Intervals-for-Differences-between-Population-Parameters-with-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FConfidence-Intervals-for-Differences-between-Population-Parameters-with-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FConfidence-Intervals-for-Differences-between-Population-Parameters-with-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FConfidence-Intervals-for-Differences-between-Population-Parameters-with-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anas436","download_url":"https://codeload.github.com/Anas436/Confidence-Intervals-for-Differences-between-Population-Parameters-with-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245832680,"owners_count":20679701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["confidence-intervals","inferential-statistical-analyses","jupyterlab","matplotlib-pyplot","numpy","pandas","python3","seaborn"],"created_at":"2024-12-06T03:14:35.424Z","updated_at":"2026-04-18T02:08:52.336Z","avatar_url":"https://github.com/Anas436.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Confidence-Intervals-for-Differences-between-Population-Parameters-with-Python\n\n\n\n\nThis tutorial is going to demonstrate how to load data, clean/manipulate a dataset, and construct a confidence interval for the difference between two population proportions and means.\n\nWe will use the 2015-2016 wave of the NHANES data for our analysis.\n\n*Note: We have provided a notebook that includes more analysis, with examples of confidence intervals for one population proportions and means, in addition to the analysis I will show you in this tutorial.  I highly recommend checking it out!\n\n__For our population proportions, we will analyze the difference of proportion between female and male smokers.  The column that specifies smoker and non-smoker is `\"SMQ020\"` in our dataset.__\n\n__For our population means, we will analyze the difference of mean of body mass index within our female and male populations.  The column that includes the body mass index value is `\"BMXBMI\"`.__\n\nAdditionally, the gender is specified in the column `\"RIAGENDR\"`.\n\n\n\n### Constructing Confidence Intervals\n\nNow that we have the population proportions of male and female smokers, we can begin to calculate confidence intervals.  From lecture, we know that the equation is as follows:\n\n$$Best\\ Estimate \\pm Margin\\ of\\ Error$$\n\nWhere the *Best Estimate* is the **observed population proportion or mean** from the sample and the *Margin of Error* is the **t-multiplier**.\n\nThe equation to create a 95% confidence interval can also be shown as:\n\n$$Population\\ Proportion\\ or\\ Mean\\ \\pm (t-multiplier *\\ Standard\\ Error)$$\n\nThe Standard Error (SE) is calculated differenly for population proportion and mean:\n\n$$Standard\\ Error \\ for\\ Population\\ Proportion = \\sqrt{\\frac{Population\\ Proportion * (1 - Population\\ Proportion)}{Number\\ Of\\ Observations}}$$\n\n$$Standard\\ Error \\ for\\ Mean = \\frac{Standard\\ Deviation}{\\sqrt{Number\\ Of\\ Observations}}$$\n\nLastly, the standard error for difference of population proportions and means is:\n\n$$Standard\\ Error\\ for\\ Difference \\ of\\ Two\\ Population\\ Proportions\\ Or\\ Means = \\sqrt{(SE_{\\ 1})^2 + (SE_{\\ 2})^2}$$\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fconfidence-intervals-for-differences-between-population-parameters-with-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanas436%2Fconfidence-intervals-for-differences-between-population-parameters-with-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fconfidence-intervals-for-differences-between-population-parameters-with-python/lists"}