Created
March 17, 2024 14:49
-
-
Save zinzinzibidi/f22c40814838f6c3a5f6ecd598856b6e to your computer and use it in GitHub Desktop.
Python ile z-Dağılımı için Güven Aralığı
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import norm | |
# Verilen değerler | |
n = 100 # örneklem büyüklüğü | |
x_bar = 36 # örneklem ortalaması | |
s = 8 # örneklem standart sapması | |
confidence_level = 0.95 | |
# %95 güven düzeyi için Z skoru | |
z_critical = norm.ppf((1 + confidence_level) / 2) | |
# Hata payını hesaplama | |
margin_of_error = z_critical * (s / (n ** 0.5)) | |
# Güven aralığının alt ve üst sınırlarını hesaplama | |
lower_bound = x_bar - margin_of_error | |
upper_bound = x_bar + margin_of_error | |
# Sonuçları yazdırma | |
print(f"%95 güven düzeyinde güven aralığı: ({lower_bound:.2f}, {upper_bound:.2f})") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment