TGViewer
Data Science & Machine Learning Data Science & Machine Learning @datasciencefun · 77.8K subscribers
Post #4575 1.21K
In classical frequentist statistics, this is not technically correct.

A better interpretation is:



If we repeatedly took random samples and constructed confidence intervals using the same method, approximately 95% of those intervals would contain the true population parameter.



In everyday communication, we often say:



"We are 95% confident that the true population parameter lies within this interval."



🔹 8. Confidence Level and Interval Width

A higher confidence level generally produces a wider confidence interval.

For example:

• 90% CI → [48.5, 51.5]

• 95% CI →[48,52]

• 99% CI →[47,53]

The exact values depend on the data, but the general relationship is:

Higher confidence → Wider interval

Lower confidence → Narrower interval

Why? Because if we want greater confidence that our interval captures the true population parameter, we need to consider a wider range of possible values.

🔹 9. Sample Size and Confidence Interval

Sample size has a major impact on confidence intervals.

For a sample mean:

Standard Error = Standard Deviation / √Sample Size

As sample size increases:

Sample Size ↑ → Standard Error ↓

Therefore: Larger Sample → Smaller Uncertainty → Narrower Confidence Interval

For example:

Suppose Standard Deviation = 20

With n = 100 → SE = 20 / √100 = 20 / 10 = 2

If we increase the sample size to n = 400 → SE = 20 / √400 = 20 / 20 = 1

The standard error has decreased. This means the estimate becomes more precise.

🔹 10. Standard Deviation vs Standard Error

These concepts are often confused.

Standard Deviation

Standard deviation measures how spread out individual observations are.

Example:



How different are individual employee salaries from the average salary?



Standard Error

Standard error measures how much a sample statistic, such as the sample mean, is expected to vary from sample to sample.

For the sample mean: SE = SD / √n

So: SD = 20, n = 100, Then SE = 20 / 10 = 2

Therefore: Standard Deviation = 20, Standard Error = 2

They measure different things.

🔹 11. Example of a Confidence Interval

Suppose we have:

Sample mean = 50

Sample standard deviation = 10

Sample size = 100

Confidence level = 95%

For illustration, let's use a critical value of approximately 1.96.

First calculate the standard error:

SE = 10 / √100 = 10 / 10 = 1

Now calculate the margin of error:

Margin of Error = 1.96 × 1 = 1.96

Therefore: CI = 50 ± 1.96

So: Lower Limit = 48.04, Upper Limit = 51.96

Therefore: 95% CI = [48.04, 51.96]

🔹 12. Confidence Interval Using Python

Python's scipy library can be used to calculate confidence intervals.

import numpy as np
from scipy import stats

data = np.array([48, 51, 49, 52, 50, 47, 53, 51, 49, 50])

mean = np.mean(data)
confidence_level = 0.95

confidence_interval = stats.t.interval(
confidence_level,
df=len(data) - 1,
loc=mean,
scale=stats.sem(data)
)

print("Mean:", mean)
print("95% Confidence Interval:", confidence_interval)
  • ❤ 5
More from @datasciencefun
  1. Oct 7, 2026ORDER BY salary DESC LIMIT 5; Mistake 3 — Forgetting that LIMIT applies after sorting For…
  2. Oct 7, 2026🚀 Data Science Roadmap 2026 📍 Phase 3: SQL for Data Science 📖 Topic 4 — LIMIT LIMIT is…
  3. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  4. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  5. Oct 2, 2026Data Visualisation tips for beginners
  6. Sep 29, 2026𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗟𝗲𝗮𝗿𝗻 𝗔𝗜 𝗶𝗻 𝟮𝟬𝟮𝟲🚀 ​ Explore 6 free resource…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →