Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

В задаче про премию Оскар исправить df количество степеней свободы #7

Open
voleka-ocrv opened this issue Aug 15, 2024 · 0 comments

Comments

@voleka-ocrv
Copy link

Часть 2
Задача про премию Оскар
При расчете значения p количество степеней свободы должно быть не N-2, а N + N -2 (т.к. у нас двухвыборочный тест)

from scipy.stats import t
from numpy import sqrt

mean_m, mean_f = 45, 34
sd_m, sd_f = 9, 10
N = 100

se = sqrt((sd_m ** 2)/N + (sd_f ** 2)/N)
t_value = (mean_m - mean_f)/se

p = t.sf(t_value, N+N-2)
print(f'p={p}')
if p >= 0.05:
    print('Мы НЕ можем отклонить нулевую гипотезу')
else:
    print('Мы можем отклонить нулевую гипотезу')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant