Dina_J

alpha_bonf

Dec 10th, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. # подготавливаем данные
  4. report = pd.DataFrame()
  5. report['m'] = pd.Series([2, 3, 4, 5, 6, 7, 8, 9, 10, 1000]) # число тестов
  6. report['alpha'] = 0.05 # исходный уровень значимости
  7.  
  8. # считаем поправку
  9. report['alpha_bonf'] = report['alpha'] / report.shape[0]# добавьте код для расчёта коррекции уровня значимости здесь
  10.  
  11. # считаем FWER
  12. report['fwer_bonf'] = 1 - (1 -  report['alpha_bonf']) ** report['m']  # добавьте код для расчёта FWER здесь
  13.  
  14. print(report)
Advertisement
Add Comment
Please, Sign In to add comment