{"id":22445418,"url":"https://github.com/anas436/introduction-to-confidence-intervals-in-python","last_synced_at":"2026-04-11T02:57:25.278Z","repository":{"id":110394478,"uuid":"559229726","full_name":"Anas436/Introduction-to-Confidence-Intervals-in-Python","owner":"Anas436","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-29T13:22:17.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T16:51:06.774Z","etag":null,"topics":["confidence-intervals","inferential-statistics","jupyterlab","numpy","pandas","python3","statsmodels"],"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-29T13:18:28.000Z","updated_at":"2022-10-29T17:07:35.000Z","dependencies_parsed_at":"2023-04-23T13:35:24.758Z","dependency_job_id":null,"html_url":"https://github.com/Anas436/Introduction-to-Confidence-Intervals-in-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anas436/Introduction-to-Confidence-Intervals-in-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FIntroduction-to-Confidence-Intervals-in-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FIntroduction-to-Confidence-Intervals-in-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FIntroduction-to-Confidence-Intervals-in-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FIntroduction-to-Confidence-Intervals-in-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anas436","download_url":"https://codeload.github.com/Anas436/Introduction-to-Confidence-Intervals-in-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FIntroduction-to-Confidence-Intervals-in-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31667034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["confidence-intervals","inferential-statistics","jupyterlab","numpy","pandas","python3","statsmodels"],"created_at":"2024-12-06T03:14:11.938Z","updated_at":"2026-04-11T02:57:25.252Z","avatar_url":"https://github.com/Anas436.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction-to-Confidence-Intervals-in-Python\n\n\n\n\n## Statistical Inference with Confidence Intervals\n\nThroughout week 2, we have explored the concept of confidence intervals, how to calculate them, interpret them, and what confidence really means.  \n\n__In this tutorial, we're going to review how to calculate confidence intervals of population proportions and means.__\n\nTo begin, let's go over some of the material from this week and why confidence intervals are useful tools when deriving insights from data.\n\n### Why Confidence Intervals?\n\nConfidence intervals are a calculated range or boundary around a parameter or a statistic that is supported mathematically with a certain level of confidence.  For example, in the lecture, we estimated, with 95% confidence, that the population proportion of parents with a toddler that use a car seat for all travel with their toddler was somewhere between 82.2% and 87.7%.\n\nThis is *__different__* than having a 95% probability that the true population proportion is within our confidence interval.\n\nEssentially, if we were to repeat this process, 95% of our calculated confidence intervals would contain the true proportion.\n\n### How are Confidence Intervals Calculated?\n\nOur equation for calculating confidence intervals is as follows:\n\n$$Best\\ Estimate \\pm Margin\\ of\\ Error$$\n\nWhere the *Best Estimate* is the **observed population proportion or mean** and the *Margin of Error* is the **t-multiplier**.\n\nThe t-multiplier is calculated based on the degrees of freedom and desired confidence level.  For samples with more than 30 observations and a confidence level of 95%, the t-multiplier is 1.96\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\nLastly, the Standard Error 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\nLet's replicate the car seat example from lecture:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fintroduction-to-confidence-intervals-in-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanas436%2Fintroduction-to-confidence-intervals-in-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fintroduction-to-confidence-intervals-in-python/lists"}