๐‘๐‘œ๐‘ก๐‘’๐‘๐‘œ๐‘œ๐‘˜

์œ ์˜์„ฑ๊ฒ€์ • ๋ณธ๋ฌธ

ํ†ต๊ณ„ํ•™

์œ ์˜์„ฑ๊ฒ€์ •

seoa__ 2025. 1. 10. 14:15

   [ ๋ชฉ์ฐจ ]

    A/B ๊ฒ€์ •

    : ๋‘ ๋ฒ„์ „(A์™€ B) ์ค‘ ์–ด๋Š ๊ฒƒ์ด ๋” ํšจ๊ณผ์ ์ธ์ง€ ํ‰๊ฐ€ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” ๊ฒ€์ • ๋ฐฉ๋ฒ•

    • ๋งˆ์ผ€ํŒ…, ์›น์‚ฌ์ดํŠธ ๋””์ž์ธ ๋“ฑ์—์„œ ๋งŽ์ด ์‚ฌ์šฉ๋จ
    • ์‚ฌ์šฉ์ž๋“ค์„ ๋‘ ๊ทธ๋ฃน์œผ๋กœ ๋‚˜๋ˆ„๊ณ , ๊ฐ ๊ทธ๋ฃน์— ๋‹ค๋ฅธ ๋ฒ„์ „์„ ์ œ๊ณตํ•œ ํ›„, ๋ฐ˜์‘ ๋น„๊ต
    • ์ผ๋ฐ˜์ ์œผ๋กœ ์ „ํ™˜์œจ, ๊ตฌ๋งค์ˆ˜, ๋ฐฉ๋ฌธ ๊ธฐ๊ฐ„, ๋ฐฉ๋ฌธํ•œ ํŽ˜์ด์ง€ ์ˆ˜, ํŠน์ • ํŽ˜์ด์ง€ ๋ฐฉ๋ฌธ ์—ฌ๋ถ€, ๋งค์ถœ๋“ฑ์˜ ์ง€ํ‘œ ๋น„๊ต

    ๋ชฉ์ 

    • ๋‘ ๊ทธ๋ฃน ๊ฐ„์˜ ๋ณ€ํ™”๊ฐ€ ์šฐ์—ฐ์ด ์•„๋‹ˆ๋ผ ํ†ต๊ณ„์ ์œผ๋กœ ์œ ์˜๋ฏธํ•œ์ง€๋ฅผ ํ™•์ธ
    • A/B ๊ฒ€์ •์ด ์‹ค์ œ๋กœ ์–ด๋–ป๊ฒŒ ์ ์šฉ๋˜๋Š”์ง€
      • ์˜จ๋ผ์ธ ์‡ผํ•‘๋ชฐ์—์„œ ๋‘ ๊ฐ€์ง€ ๋””์ž์ธ(A์™€ B)์— ๋Œ€ํ•œ ๋žœ๋”ฉ ํŽ˜์ด์ง€๋ฅผ ํ…Œ์ŠคํŠธํ•˜์—ฌ ์–ด๋–ค ๋””์ž์ธ์ด ๋” ๋†’์€ ๊ตฌ๋งค ์ „ํ™˜์œจ์„ ๊ฐ€์ ธ์˜ค๋Š”์ง€ ํ‰๊ฐ€
    import numpy as np 
    import scipy.stats as stats 
    
    # ๊ฐ€์ •๋œ ์ „ํ™˜์œจ ๋ฐ์ดํ„ฐ 
    group_a = np.random.binomial(1, 0.30, 100) # 30% ์ „ํ™˜์œจ 
    group_b = np.random.binomial(1, 0.45, 100) # 45% ์ „ํ™˜์œจ 
    
    # t-test๋ฅผ ์ด์šฉํ•œ ๋น„๊ต 
    t_stat, p_val = stats.ttest_ind(group_a, group_b) 
    print(f"T-Statistic: {t_stat}, P-value: {p_val}")
    • โ“ stats.ttest_ind
      : scipy.stats.ttest_ind ํ•จ์ˆ˜๋Š” ๋…๋ฆฝํ‘œ๋ณธ t-๊ฒ€์ •์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ๋‘ ๊ฐœ์˜ ๋…๋ฆฝ๋œ ์ง‘๋‹จ ๊ฐ„ ํ‰๊ท ์˜ ์ฐจ์ด๊ฐ€ ์œ ์˜๋ฏธํ•œ์ง€ ํ‰๊ฐ€ํ•จ
    • ์ด ํ•จ์ˆ˜๋Š” ๋‘ ์ง‘๋‹จ์˜ ๋ฐ์ดํ„ฐ ๋ฐฐ์—ด์„ ์ž…๋ ฅ์œผ๋กœ ๋ฐ›์•„์„œ t-ํ†ต๊ณ„๋Ÿ‰๊ณผ p-๊ฐ’์„ ๋ฐ˜ํ™˜
     

    ๊ฑฐ๋ž˜ ํ›„๊ธฐ ์‹คํ—˜์„ ํ†ตํ•ด ๋”ฐ๋œปํ•œ ๊ฑฐ๋ž˜ ๊ฒฝํ—˜ ๋งŒ๋“ค๊ธฐ

    ๊ฑฐ๋ž˜ ํ›„๊ธฐ ์‹คํ—˜์„ ํ†ตํ•ด ๋‹น๊ทผ๋งˆ์ผ“์ด ์–ด๋–ป๊ฒŒ ๋”ฐ๋œปํ•œ ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค๊ณ  ์„ฑ์žฅ์‹œ์ผœ ๋‚˜๊ฐ€๋Š”์ง€ ์†Œ๊ฐœํ•ด ๋“œ๋ฆด๊ฒŒ์š”!

    medium.com

     

     

    ์•Œ๋ผ๋ฏธ์˜ A/B ํ…Œ์ŠคํŒ… ์ผ์ง€ #1

    A/B ํ…Œ์ŠคํŒ…์„ ํ•˜๋ฉด์„œ ๋‹ค๋ฅธ ํŒ€๋“ค์€ ์–ด๋–ค ๊ฐ€์„ค์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์–ด๋– ํ•œ ๊ฒฐ๊ณผ๋ฅผ ๋ƒˆ๋Š”์ง€ ๊ถ๊ธˆํ•œ ์ ์ด ๋งŽ์•˜๋Š”๋ฐ, ์ด๋ฒˆ ๊ธฐํšŒ์— ์•Œ๋ผ๋ฏธ์—์„œ ์ง„ํ–‰ํ–ˆ๋˜ A/B ํ…Œ์ŠคํŒ… ์ค‘ ๋ช‡๋ช‡ ๊ฒฝํ—˜๋“ค์„ ๊ณต์œ ํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค.

    medium.com

     

    ๊ฐ€์„ค๊ฒ€์ •


    https://prepnuggets.com/glossary/two-tailed-hypothesis-test/

    https://www.kdnuggets.com/hypothesis-testing-and-ab-testing

     

    Two-tailed hypothesis test - PrepNuggets

    A test in which the null hypothesis is rejected in favour of the alternative hypothesis if the evidence indicates that the population parameter is either smaller or larger than a hypothesised value. Compare: One-tailed hypothesis test

    prepnuggets.com

     

    : ํ‘œ๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ ํ†ตํ•ด ๋ชจ์ง‘๋‹จ์˜ ๊ฐ€์„ค์„ ๊ฒ€์ฆํ•˜๋Š” ๊ณผ์ •

    • ์ฆ‰, ๋ฐ์ดํ„ฐ๊ฐ€ ํŠน์ • ๊ฐ€์„ค์„ ์ง€์ง€ํ•˜๋Š”์ง€ ํ‰๊ฐ€ํ•˜๋Š” ๊ณผ์ •
    • ๊ท€๋ฌด๊ฐ€์„ค(H0)๊ณผ ๋Œ€๋ฆฝ๊ฐ€์„ค(H1)์„ ์„ค์ •ํ•˜๊ณ , ๊ท€๋ฌด๊ฐ€์„ค์„ ๊ธฐ๊ฐ€ํ• ์ง€๋ฅผ ๊ฒฐ์ •
    • ๋ฐ์ดํ„ฐ ๋ถ„์„์‹œ ๋‘๊ฐ€์ง€ ์ „๋žต์„ ์ทจํ•  ์ˆ˜ ์žˆ์Œ
      • ํ™•์ฆ์  ์ž๋ฃŒ๋ถ„์„
        • ๋ฏธ๋ฆฌ ๊ฐ€์„ค๋“ค์„ ๋จผ์ € ์„ธ์šด ๋‹ค์Œ ๊ฐ€์„ค์„ ๊ฒ€์ฆํ•ด ๋‚˜๊ฐ€๋Š” ๋ถ„์„
      • ํƒ์ƒ‰์  ์ž๋ฃŒ๋ถ„์„ (EDA)
        • ๊ฐ€์„ค์„ ๋จผ์ € ์ •ํ•˜์ง€ ์•Š๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ํƒ์ƒ‰ํ•ด๋ณด๋ฉด์„œ ๊ฐ€์„ค ํ›„๋ณด๋“ค์„ ์ฐพ๊ณ  ๋ฐ์ดํ„ฐ์˜ ํŠน์ง•์„ ์ฐพ๋Š” ๊ฒƒ
          โœ… ๋‹จ๊ณ„
        1. ๊ท€๋ฌด๊ฐ€์„ค๊ณผ ๋Œ€๋ฆฝ๊ฐ€์„ค ์„ค์ •
        2. ์œ ์˜์ˆ˜์ค€(α) ๊ฒฐ์ •
        3. ๊ฒ€์ •ํ†ต๊ณ„๋Ÿ‰ ๊ณ„์‚ฐ
        4. p-๊ฐ’๊ณผ ์œ ์˜์ˆ˜์ค€ ๋น„๊ต
        5. ๊ฒฐ๋ก  ๋„์ถœ
        6. โžก๏ธ ํ†ต๊ณ„์  ์œ ์˜์„ฑ
        • ํ†ต๊ณ„์  ์œ ์˜์„ฑ์€ ๊ฒฐ๊ณผ๊ฐ€ ์šฐ์—ฐํžˆ ๋ฐœ์ƒํ•œ ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์–ด๋–ค ํšจ๊ณผ๊ฐ€ ์‹ค์ œ๋กœ ์กด์žฌํ•จ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ง€ํ‘œ
        • p๊ฐ’์€ ๊ท€๋ฌด ๊ฐ€์„ค์ด ์ฐธ์ผ ๊ฒฝ์šฐ ๊ด€์ฐฐ๋œ ํ†ต๊ณ„์น˜๊ฐ€ ๋‚˜์˜ฌ ํ™•๋ฅ ์„ ์˜๋ฏธ
        • ์ผ๋ฐ˜์ ์œผ๋กœ p๊ฐ’์ด 0.05 ๋ฏธ๋งŒ์ด๋ฉด ๊ฒฐ๊ณผ๋ฅผ ํ†ต๊ณ„์ ์œผ๋กœ ์œ ์˜ํ•˜๋‹ค๊ณ  ํŒ๋‹จ
          โžก๏ธ p-๊ฐ’
        • ๊ท€๋ฌด๊ฐ€์„ค์ด ์ฐธ์ผ ๋•Œ, ๊ด€์ฐฐ๋œ ๊ฒฐ๊ณผ ์ด์ƒ์œผ๋กœ ๊ทน๋‹จ์ ์ธ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ฌ ํ™•๋ฅ 
        • ์ผ๋ฐ˜์ ์œผ๋กœ p-๊ฐ’์ด ์œ ์˜์ˆ˜์ค€(α)๋ณด๋‹ค ์ž‘์œผ๋ฉด ๊ท€๋ฌด๊ฐ€์„ค์„ ๊ธฐ๊ฐ
        • ์œ ์˜์ˆ˜์ค€์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ๊ฐ’์ด 0.05
          โžก๏ธ p-๊ฐ’์„ ํ†ตํ•œ ์œ ์˜์„ฑ ํ™•์ธ
        • p-๊ฐ’์ด 0.03์ด๋ผ๋ฉด, 3%์˜ ํ™•๋ฅ ๋กœ ์šฐ์—ฐํžˆ ์ด๋Ÿฌํ•œ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ์Œ
        • ์ผ๋ฐ˜์ ์œผ๋กœ 0.05 ์ดํ•˜๋ผ๋ฉด ์œ ์˜์„ฑ์ด ์žˆ๋‹ค๊ณ  ๋ด„

    ์‹ ๋ขฐ๊ตฌ๊ฐ„๊ณผ ๊ฐ€์„ค๊ฒ€์ •

    • ์‹ ๋ขฐ๊ตฌ๊ฐ„๊ณผ ๊ฐ€์„ค๊ฒ€์ •์€ ๋ฐ€์ ‘ํ•˜๊ฒŒ ๊ด€๋ จ๋œ ๊ฐœ๋…
    • ๋‘˜ ๋‹ค ๋ฐ์ดํ„ฐ์˜ ๋ชจ์ˆ˜(ex.ํ‰๊ท )์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๊ตฌํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒƒ์ด์ง€๋งŒ ์ ‘๊ทผ ๋ฐฉ์‹์ด ๋‹ค๋ฆ„
    • ์‹ ๋ขฐ๊ตฌ๊ฐ„
      • ํŠน์ • ๋ชจ์ˆ˜๊ฐ€ ํฌํ•จ๋  ๋ฒ”์œ„๋ฅผ ์ œ๊ณต
        → ์‹ ๋ขฐ๊ตฌ๊ฐ„์ด๋ž€ ?
        ๋ชจ์ง‘๋‹จ์˜ ํ‰๊ท ์ด ํŠน์ • ๋ฒ”์œ„ ๋‚ด์— ์žˆ์„ ๊ฒƒ์ด๋ผ๋Š” ํ™•๋ฅ 
        ์ผ๋ฐ˜์ ์œผ๋กœ 95% ์‹ ๋ขฐ๊ตฌ๊ฐ„์ด ์‚ฌ์šฉ๋˜๋ฉฐ, ์ด๋Š” ๋ชจ์ง‘๋‹จ ํ‰๊ท ์ด 95% ํ™•๋ฅ ๋กœ ์ด ๊ตฌ๊ฐ„ ๋‚ด์— ์žˆ์Œ์„ ์˜๋ฏธ
        ๋งŒ์•ฝ ์–ด๋–ค ์„ค๋ฌธ์กฐ์‚ฌ์—์„œ ํ‰๊ท  ๋งŒ์กฑ๋„๊ฐ€ 75์ ์ด๊ณ , ์‹ ๋ขฐ๊ตฌ๊ฐ„์ด 70 ~ 80์ด๋ผ๋ฉด,
        ์šฐ๋ฆฌ๋Š” 95% ํ™•๋ฅ ๋กœ ์‹ค์ œ ํ‰๊ท  ๋งŒ์กฑ๋„๊ฐ€ ์ด ๋ฒ”์œ„ ๋‚ด์— ์žˆ๋‹ค๊ณ  ๋งํ•  ์ˆ˜ ์žˆ์Œ
    • ๊ฐ€์„ค๊ฒ€์ •
      • ๋ชจ์ˆ˜๊ฐ€ ํŠน์ • ๊ฐ’๊ณผ ๊ฐ™์€์ง€ ๋‹ค๋ฅธ์ง€ ํ…Œ์ŠคํŠธ
        ex) ์ƒˆ๋กœ์šด ์•ฝ๋ฌผ์ด ๊ธฐ์กด ์•ฝ๋ฌผ๋ณด๋‹ค ํšจ๊ณผ๊ฐ€ ์žˆ๋Š”์ง€ ๊ฒ€์ •
        โœ… ์ด ๋•Œ ์ƒˆ๋กœ์šด ์•ฝ๋ฌผ์€ ๊ธฐ์กด ์•ฝ๋ฌผ๊ณผ ํฐ ์ฐจ์ด๊ฐ€ ์—†๋‹ค๋Š” ๊ฒƒ์ด ๊ท€๋ฌด๊ฐ€์„ค
        โœ… ๋Œ€๋ฆฝ๊ฐ€์„ค์€ ์ƒˆ๋กœ์šด ์•ฝ๋ฌผ์ด ๊ธฐ์กด ์•ฝ๋ฌผ๊ณผ ๋Œ€๋น„ํ•ด ํšจ๊ณผ๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฒƒ
        = ๊ท€๋ฌด๊ฐ€์„ค์€ ํ˜„์žฌ ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋Œ€๋ฆฝ๊ฐ€์„ค์€ ์—ฐ๊ตฌ์ž๊ฐ€ ์ž…์ฆํ•˜๊ณ ์ž ํ•˜๋Š” ์ฃผ์žฅ
      # ๊ธฐ์กด ์•ฝ๋ฌผ(A)์™€ ์ƒˆ๋กœ์šด ์•ฝ๋ฌผ(B) ํšจ๊ณผ ๋ฐ์ดํ„ฐ ์ƒ์„ฑ
      A = np.random.normal(50, 10, 100)
      B = np.random.normal(55, 10, 100)
      	
      # ํ‰๊ท  ํšจ๊ณผ ๊ณ„์‚ฐ
      mean_A = np.mean(A)
      mean_B = np.mean(B)
      	
      # t-๊ฒ€์ • ์ˆ˜ํ–‰
      t_stat, p_value = stats.ttest_ind(A, B)
      	
      print(f"A ํ‰๊ท  ํšจ๊ณผ: {mean_A}")
      print(f"B ํ‰๊ท  ํšจ๊ณผ: {mean_B}")
      print(f"t-๊ฒ€์ • ํ†ต๊ณ„๋Ÿ‰: {t_stat}")
      print(f"p-๊ฐ’: {p_value}")
      
      # t-๊ฒ€์ •์˜ p-๊ฐ’ ํ™•์ธ (์œ„ ์˜ˆ์‹œ์—์„œ ๊ณ„์‚ฐ๋œ p-๊ฐ’ ์‚ฌ์šฉ)
      print(f"p-๊ฐ’: {p_value}")
      if p_value < 0.05:
      	print("๊ท€๋ฌด๊ฐ€์„ค์„ ๊ธฐ๊ฐํ•ฉ๋‹ˆ๋‹ค. ํ†ต๊ณ„์ ์œผ๋กœ ์œ ์˜๋ฏธํ•œ ์ฐจ์ด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.")
      else:
      	print("๊ท€๋ฌด๊ฐ€์„ค์„ ๊ธฐ๊ฐํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ†ต๊ณ„์ ์œผ๋กœ ์œ ์˜๋ฏธํ•œ ์ฐจ์ด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.")

    t๊ฒ€์ •

    ๊ฐ€์„ค๊ฒ€์ •์˜ ๋Œ€ํ‘œ์ ์ธ ๊ฒ€์ •

    t๊ฒ€์ •

    : ๋‘ ์ง‘๋‹จ ๊ฐ„์˜ ํ‰๊ท  ์ฐจ์ด๊ฐ€ ํ†ต๊ณ„์ ์œผ๋กœ ์œ ์˜๋ฏธํ•œ์ง€ ํ™•์ธํ•˜๋Š” ๊ฒ€์ • ๋ฐฉ๋ฒ•

    • ๋…๋ฆฝํ‘œ๋ณธ t๊ฒ€์ •๊ณผ ๋Œ€์‘ํ‘œ๋ณธ t๊ฒ€์ •์œผ๋กœ ๋‚˜๋‰จ

    ๋…๋ฆฝํ‘œ๋ณธ t๊ฒ€์ •

    : ๋‘ ๋…๋ฆฝ๋œ ๊ทธ๋ฃน์˜ ํ‰๊ท ์„ ๋น„๊ต

    ๋Œ€์‘ํ‘œ๋ณธ t๊ฒ€์ •

    • ๋™์ผํ•œ ๊ทธ๋ฃน์˜ ์‚ฌ์ „/์‚ฌํ›„ ํ‰๊ท ์„ ๋น„๊ต
    • ๊ฐ€์„ค๊ฒ€์ •์ด ์‹ค์ œ๋กœ ์–ด๋–ป๊ฒŒ ์ ์šฉ๋˜๋Š”์ง€
      • p-๊ฐ’์„ ํ†ตํ•œ ์œ ์˜์„ฑ ํ™•์ธ
        • ๋‘ ํด๋ž˜์Šค์˜ ์‹œํ—˜ ์„ฑ์  ๋น„๊ต(๋…๋ฆฝํ‘œ๋ณธ t๊ฒ€์ •)
        • ๋‹ค์ด์–ดํŠธ ์ „ํ›„ ์ฒด์ค‘ ๋น„๊ต(๋Œ€์‘ํ‘œ๋ณธ t๊ฒ€์ •)
        			# ํ•™์ƒ ์ ์ˆ˜ ๋ฐ์ดํ„ฐ
        scores_method1 = np.random.normal(70, 10, 30)
        scores_method2 = np.random.normal(75, 10, 30)
        
        # ๋…๋ฆฝํ‘œ๋ณธ t๊ฒ€์ •
        t_stat, p_val = stats.ttest_ind(scores_method1, scores_method2)
        print(f"T-Statistic: {t_stat}, P-value: {p_val}")
        			```

    ๋‹ค์ค‘๊ฒ€์ •

    ์—ฌ๋Ÿฌ ๊ฐ€์„ค์„ ๋™์‹œ์— ๊ฒ€์ • ๐Ÿšซ ํ•˜์ง€๋งŒ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Œ

    ๋‹ค์ค‘๊ฒ€์ •

    : ์—ฌ๋Ÿฌ ๊ฐ€์„ค์„ ๋™์‹œ์— ๊ฒ€์ •ํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ

    • ๊ฐ ๊ฒ€์ •๋งˆ๋‹ค ์œ ์˜์ˆ˜์ค€์„ ์กฐ์ •ํ•˜์ง€ ์•Š์œผ๋ฉด 1์ข… ์˜ค๋ฅ˜(๊ท€๋ฌด๊ฐ€์„ค์ด ์ฐธ์ธ๋ฐ ๊ธฐ๊ฐํ•˜๋Š” ์˜ค๋ฅ˜)๋ฐœ์ƒ ํ™•๋ฅ ์ด ์ฆ๊ฐ€

    ๋ณด์ • ๋ฐฉ๋ฒ•

    • ๋ณธํŽ˜๋กœ๋‹ˆ ๋ณด์ •, ํŠœํ‚ค ๋ณด์ •, ๋˜๋„ท ๋ณด์ •, ์œŒ๋ฆฌ์—„์Šค ๋ณด์ • ๋“ฑ์ด ์žˆ์Œ
    • ๊ฐ€์žฅ ๋Œ€ํ‘œ์ ์ด๊ณ  ๊ธฐ๋ณธ์ ์ธ๊ฒŒ ๋ณธํŽ˜๋กœ๋‹ˆ ๋ณด์ •
      • ๋‹ค์ค‘๊ฒ€์ •๊ณผ ๋ณด์ •์„ ์–ด๋–ป๊ฒŒ ์ ์šฉํ•˜๋Š”์ง€
      • ์ด ๋•Œ ๋ณธํŽ˜๋กœ๋‹ˆ ๋ณด์ •์„ ์‚ฌ์šฉํ•ด๋ณผ ์ˆ˜ ์žˆ์Œ
      import numpy as np
      import scipy.stats as stats
      
      # ์„ธ ๊ทธ๋ฃน์˜ ๋ฐ์ดํ„ฐ ์ƒ์„ฑ
      np.random.seed(42)
      group_A = np.random.normal(10, 2, 30)
      group_B = np.random.normal(12, 2, 30)
      group_C = np.random.normal(11, 2, 30)
      
      # ์„ธ ๊ทธ๋ฃน ๊ฐ„ ํ‰๊ท  ์ฐจ์ด์— ๋Œ€ํ•œ t๊ฒ€์ • ์ˆ˜ํ–‰
      p_values = []
      p_values.append(stats.ttest_ind(group_A, group_B).pvalue)
      p_values.append(stats.ttest_ind(group_A, group_C).pvalue)
      p_values.append(stats.ttest_ind(group_B, group_C).pvalue)
      
      # ๋ณธํŽ˜๋กœ๋‹ˆ ๋ณด์ • ์ ์šฉ
      alpha = 0.05
      adjusted_alpha = alpha / len(p_values)
      
      # ๊ฒฐ๊ณผ ์ถœ๋ ฅ
      print(f"๋ณธํŽ˜๋กœ๋‹ˆ ๋ณด์ •๋œ ์œ ์˜ ์ˆ˜์ค€: {adjusted_alpha:.4f}")
      for i, p in enumerate(p_values):
          if p < adjusted_alpha:
              print(f"๊ฒ€์ • {i+1}: ์œ ์˜๋ฏธํ•œ ์ฐจ์ด ๋ฐœ๊ฒฌ (p = {p:.4f})")
          else:
              print(f"๊ฒ€์ • {i+1}: ์œ ์˜๋ฏธํ•œ ์ฐจ์ด ์—†์Œ (p = {p:.4f})")

    ์นด์ด์ œ๊ณฑ๊ฒ€์ •

    ๋ฒ”์ฃผํ˜• ๋ฐ์ดํ„ฐ์˜ ๋ถ„์„์— ์‚ฌ์šฉํ•œ๋‹ค๋Š” ๊ฒƒ์ด ํฌ์ธํŠธ

    ์นด์ด์ œ๊ณฑ๊ฒ€์ •

    • ํšŸ์ˆ˜ ๊ฒ€์ •์— ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ๊ณ ์•ˆ๋œ ๋ถ„ํฌ
    • ์นด์ด์ œ๊ณฑ ๋ถ„ํฌ๋Š” "ํ‘œ์ค€์ •๊ทœ๋ถ„ํฌ ํ™•๋ฅ ๋ณ€์ˆ˜์˜ ์ œ๊ณฑํ•ฉ"์œผ๋กœ ์ •์˜
    • ๋ฒ”์ฃผํ˜• ๋ฐ์ดํ„ฐ์˜ ํ‘œ๋ณธ ๋ถ„ํฌ๊ฐ€ ๋ชจ์ง‘๋‹จ ๋ถ„ํฌ์™€ ์ผ์น˜ํ•˜๋Š”์ง€ ๊ฒ€์ •(์ ํ•ฉ๋„ ๊ฒ€์ •)ํ•˜๊ฑฐ๋‚˜
    • ๋‘ ๋ฒ”์ฃผํ˜• ๋ณ€์ˆ˜ ๊ฐ„์˜ ๋…๋ฆฝ์„ฑ์„ ๊ฒ€์ •(๋…๋ฆฝ์„ฑ ๊ฒ€์ •)

    ์ ํ•ฉ๋„ ๊ฒ€์ •

    • ๊ด€์ฐฐ๋œ ๋ถ„ํฌ์™€ ๊ธฐ๋Œ€๋œ ๋ถ„ํฌ๊ฐ€ ์ผ์น˜ํ•˜๋Š”์ง€ ๊ฒ€์ •
    • p๊ฐ’์ด ๋†’์œผ๋ฉด ๋ฐ์ดํ„ฐ๊ฐ€ ๊ท€๋ฌด ๊ฐ€์„ค์— ์ž˜ ๋งž์Œ ์ฆ‰, ๊ด€์ฐฐ๋œ ๋ฐ์ดํ„ฐ์™€ ๊ท€๋ฌด ๊ฐ€์„ค์ด ์ ํ•ฉ
    • p๊ฐ’์ด ๋‚ฎ์œผ๋ฉด ๋ฐ์ดํ„ฐ๊ฐ€ ๊ท€๋ฌด ๊ฐ€์„ค์— ์ž˜ ๋งž์ด ์•Š์Œ ์ฆ‰, ๊ด€์ฐฐ๋œ ๋ฐ์ดํ„ฐ์™€ ๊ท€๋ฌด ๊ฐ€์„ค์ด ๋ถ€์ ํ•ฉ

    ๋…๋ฆฝ์„ฑ ๊ฒ€์ •

    • ๋‘ ๋ฒ”์ฃผํ˜• ๋ณ€์ˆ˜ ๊ฐ„์˜ ๋…๋ฆฝ์„ฑ์„ ๊ฒ€์ •
    • p๊ฐ’์ด ๋†’์œผ๋ฉด ๋‘ ๋ณ€์ˆ˜ ๊ฐ„์˜ ๊ด€๊ณ„๊ฐ€ ์—ฐ๊ด€์„ฑ์ด โŒ → ๋…๋ฆฝ์„ฑ โญ•
    • p๊ฐ’์ด ๋‚ฎ์œผ๋ฉด ๋‘ ๋ณ€์ˆ˜ ๊ฐ„์˜ ๊ด€๊ณ„๊ฐ€ ์—ฐ๊ด€์„ฑ์ด โญ• → ๋…๋ฆฝ์„ฑ โŒ
      • ์นด์ด์ œ๊ณฑ๊ฒ€์ •์€ ์–ด๋–ป๊ฒŒ ์ ์šฉ๋˜๋Š”์ง€
        • ๋ฒ”์ฃผํ˜• ๋ฐ์ดํ„ฐ์˜ ๋ถ„ํฌ ํ™•์ธ ๋ฐ ๋…๋ฆฝ์„ฑ ํ™•์ธ์„ ์œ„ํ•ด ์‚ฌ์šฉ
          • ์ฃผ์‚ฌ์œ„์˜ ๊ฐ ๋ฉด์ด ๋™์ผํ•œ ํ™•๋ฅ ๋กœ ๋‚˜์˜ค๋Š”์ง€ ๊ฒ€์ •(์ ํ•ฉ๋„ ๊ฒ€์ •)
          • ์„ฑ๋ณ„๊ณผ ์ง์—… ๋งŒ์กฑ๋„ ๊ฐ„์˜ ๋…๋ฆฝ์„ฑ ๊ฒ€์ •(๋…๋ฆฝ์„ฑ ๊ฒ€์ •)
          # ์ ํ•ฉ๋„ ๊ฒ€์ •
          observed = [20, 30, 25, 25]
          expected = [25, 25, 25, 25]
          chi2_stat, p_value = stats.chisquare(observed, f_exp=expected)
          print(f"์ ํ•ฉ๋„ ๊ฒ€์ • ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰: {chi2_stat}, p-๊ฐ’: {p_value}")
          
          # ๋…๋ฆฝ์„ฑ ๊ฒ€์ •
          observed = np.array([[10, 10, 20], [20, 20, 40]])
          chi2_stat, p_value, dof, expected = stats.chi2_contingency(observed)
          print(f"๋…๋ฆฝ์„ฑ ๊ฒ€์ • ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰: {chi2_stat}, p-๊ฐ’: {p_value}")
          
          # ์„ฑ๋ณ„๊ณผ ํก์—ฐ ์—ฌ๋ถ€ ๋…๋ฆฝ์„ฑ ๊ฒ€์ •
          observed = np.array([[30, 10], [20, 40]])
          chi2_stat, p_value, dof, expected = stats.chi2_contingency(observed)
          print(f"๋…๋ฆฝ์„ฑ ๊ฒ€์ • ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰: {chi2_stat}, p-๊ฐ’: {p_value}")
          • stats.chisquare ํ•จ์ˆ˜ โ“
            • scipy.stats.chisquare ํ•จ์ˆ˜๋Š” ์นด์ด์ œ๊ณฑ ์ ํ•ฉ๋„ ๊ฒ€์ •์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ๊ด€์ฐฐ๋œ ๋นˆ๋„ ๋ถ„ํฌ๊ฐ€ ๊ธฐ๋Œ€๋œ ๋นˆ๋„ ๋ถ„ํฌ์™€ ์ผ์น˜ํ•˜๋Š”์ง€ ํ‰๊ฐ€ํ•จ
              ์ด ๊ฒ€์ •์€ ์ฃผ๋กœ ๋‹จ์ผ ํ‘œ๋ณธ์— ๋Œ€ํ•ด ๊ด€์ฐฐ๋œ ๋นˆ๋„๊ฐ€ ํŠน์ • ์ด๋ก ์  ๋ถ„ํฌ(์˜ˆ: ๊ท ๋“ฑ ๋ถ„ํฌ)์™€ ์ผ์น˜ํ•˜๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ
            • ๋ฐ˜ํ™˜ ๊ฐ’
              • chi2: ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰์ž…๋‹ˆ๋‹ค.
              • p: p-๊ฐ’์ž…๋‹ˆ๋‹ค. ์ด๋Š” ๊ด€์ฐฐ๋œ ๋ฐ์ดํ„ฐ๊ฐ€ ๊ท€๋ฌด ๊ฐ€์„ค ํ•˜์—์„œ ๋ฐœ์ƒํ•  ํ™•๋ฅ ์ž…๋‹ˆ๋‹ค.
          • stats.chi2_contingency ํ•จ์ˆ˜ โ“
            • scipy.stats.chi2_contingency ํ•จ์ˆ˜๋Š” ์นด์ด์ œ๊ณฑ ๊ฒ€์ •์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ๋‘ ๊ฐœ ์ด์ƒ์˜ ๋ฒ”์ฃผํ˜• ๋ณ€์ˆ˜ ๊ฐ„์˜ ๋…๋ฆฝ์„ฑ์„ ๊ฒ€์ •ํ•จ
              ์ด ํ•จ์ˆ˜๋Š” ๊ด€์ธก ๋นˆ๋„๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š” ๊ต์ฐจํ‘œ(contingency table)๋ฅผ ์ž…๋ ฅ์œผ๋กœ ๋ฐ›์•„ ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰, p-๊ฐ’, ์ž์œ ๋„, ๊ทธ๋ฆฌ๊ณ  ๊ธฐ๋Œ€ ๋นˆ๋„(expected frequencies)๋ฅผ ๋ฐ˜ํ™˜
            • ๋ฐ˜ํ™˜ ๊ฐ’
              • chi2 : ์นด์ด์ œ๊ณฑ ํ†ต๊ณ„๋Ÿ‰์ž…๋‹ˆ๋‹ค.
              • p : p-๊ฐ’์ž…๋‹ˆ๋‹ค. ์ด๋Š” ๊ด€์ธก๋œ ๋ฐ์ดํ„ฐ๊ฐ€ ๊ท€๋ฌด ๊ฐ€์„ค ํ•˜์—์„œ ๋ฐœ์ƒํ•  ํ™•๋ฅ 
              • dof : ์ž์œ ๋„์ž…๋‹ˆ๋‹ค. ์ด๋Š” (ํ–‰์˜ ์ˆ˜ - 1) * (์—ด์˜ ์ˆ˜ - 1)๋กœ ๊ณ„์‚ฐ
              • expected : ๊ธฐ๋Œ€ ๋นˆ๋„
                ์ด๋Š” ํ–‰ ํ•ฉ๊ณ„์™€ ์—ด ํ•ฉ๊ณ„๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ณ„์‚ฐ๋œ ์ด๋ก ์  ๋นˆ๋„

    ์ œ 1์ข… ์˜ค๋ฅ˜์™€ ์ œ 2์ข… ์˜ค๋ฅ˜

    ๋‘๊ฐ€์ง€์˜ ์˜ค๋ฅ˜๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ๊ฒƒ์ด ํฌ์ธํŠธ

    ์ œ 1์ข… ์˜ค๋ฅ˜

    • ๊ท€๋ฌด๊ฐ€์„ค์ด ์ฐธ์ธ๋ฐ ๊ธฐ๊ฐํ•˜๋Š” ์˜ค๋ฅ˜
    • ์ž˜๋ชป๋œ ๊ธ์ •์„ ์˜๋ฏธ (์•„๋ฌด๋Ÿฐ ์˜ํ–ฅ์ด ์—†๋Š”๋ฐ ์˜ํ–ฅ์ด ์žˆ๋‹ค๊ณ  ํ•˜๋Š” ๊ฒƒ)
    • ํ•œ ๋‹จ์–ด๋กœ ์œ„์–‘์„ฑ
    • α๋ฅผ ๊ฒฝ๊ณ„๋กœ ๊ท€๋ฌด๊ฐ€์„ค์„ ๊ธฐ๊ฐํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ œ1์ข… ์˜ค๋ฅ˜๊ฐ€ α๋งŒํผ ๋ฐœ์ƒ
    • ๋”ฐ๋ผ์„œ ์œ ์˜์ˆ˜์ค€(α)์„ ์ •ํ•จ์œผ๋กœ์จ ์ œ 1์ข… ์˜ค๋ฅ˜ ์ œ์–ด ๊ฐ€๋Šฅ
    • ๋งŒ์•ฝ, ์œ ์˜์ˆ˜์ค€์ด 0.05๋ผ๋ฉด 100๋ฒˆ ์ค‘ 5๋ฒˆ์ •๋„ ์ผ์–ด๋‚  ์ˆ˜ ์žˆ๋Š” ์ œ 1์ข… ์˜ค๋ฅ˜๋Š” ๊ฐ์ˆ˜ํ•˜๊ฒ ๋‹ค๋Š” ๊ฒƒ
      • ๋‹ค์ค‘ ๊ฒ€์ •์‹œ ์ œ 1์ข… ์˜ค๋ฅ˜๊ฐ€ ์ฆ๊ฐ€ํ•˜๋Š” ์ด์œ  โ“
        • ํ•˜๋‚˜์˜ ๊ฒ€์ •์—์„œ ์ œ 1์ข… ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์„ ํ™•๋ฅ ์€ 1 - α
        • m๊ฐœ์˜ ๋…๋ฆฝ๋œ ๊ฒ€์ •์—์„œ ์ œ1์ข… ์˜ค๋ฅ˜๊ฐ€ ์ „ํ˜€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์„ ํ™•๋ฅ ์€ 
        • ๋”ฐ๋ผ์„œ, m๊ฐœ์˜ ๊ฒ€์ •์—์„œ ํ•˜๋‚˜ ์ด์ƒ์˜ ์ œ1์ข… ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ (์ฆ‰, ์ „์ฒด ์ œ 1์ข… ์˜ค๋ฅ˜์œจ)์€ 
        • ์ด ๊ฐ’์€ m์ด ์ปค์งˆ์ˆ˜๋ก ๋น ๋ฅด๊ฒŒ ์ฆ๊ฐ€ํ•จ
          ex) α=0.05, m=10์ธ ๊ฒฝ์šฐ
        • ์ฆ‰, 10๊ฐœ์˜ ๊ฐ€์„ค์„ ๋™์‹œ์— ๊ฒ€์ •ํ•  ๋•Œ ํ•˜๋‚˜ ์ด์ƒ์˜ ๊ฐ€์„ค์—์„œ ์ œ 1์ข… ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ ์ด ์•ฝ 40.1% ์ด๋ฏ€๋กœ ๊ฐœ๋ณ„๊ฒ€์ฆ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜์œจ(5%)๋ณด๋‹ค ๋†’์Œ

    ์ œ 2์ข… ์˜ค๋ฅ˜

    • ๊ท€๋ฌด๊ฐ€์„ค์ด ๊ฑฐ์ง“์ธ๋ฐ ๊ธฐ๊ฐํ•˜์ง€ ์•Š๋Š” ์˜ค๋ฅ˜
    • ์ž˜๋ชป๋œ ๋ถ€์ •์„ ์˜๋ฏธ ( ์˜ํ–ฅ์ด ์žˆ๋Š”๋ฐ ์˜ํ–ฅ์ด ์—†๋‹ค๊ณ  ํ•˜๋Š” ๊ฒƒ )
    • ํ•œ ๋‹จ์–ด๋กœ ์œ„์Œ์„ฑ
    • ์ œ 2์ข… ์˜ค๋ฅ˜๊ฐ€ ์ผ์–ด๋‚  ํ™•๋ฅ ์€ β๋กœ ์ •์˜
    • ์ œ 2์ข… ์˜ค๋ฅ˜๊ฐ€ ์ผ์–ด๋‚˜์ง€ ์•Š์„ ํ™•๋ฅ ์€ ๊ฒ€์ •๋ ฅ(1-β)์œผ๋กœ ์ •์˜
    • ํ•˜์ง€๋งŒ ์ด๋ฅผ ์ง์ ‘ ํ†ต์ œํ•  ์ˆ˜๋Š” ์—†์Œ
    • ๊ทธ๋‚˜๋งˆ ํ†ต์ œ๋ฅผ ํ•ด๋ณผ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ๋Š”…
      • ํ‘œ๋ณธํฌ๊ธฐ n์ด ์ปค์งˆ ์ˆ˜๋ก β๊ฐ€ ์ž‘์•„์ง
      • α์™€ β๋Š” ์ƒ์ถฉ๊ด€๊ณ„์— ์žˆ์–ด์„œ ๋„ˆ๋ฌด ๋‚ฎ์€ α๋ฅผ ๊ฐ€์ง€๊ฒŒ ๋˜๋ฉด β๋Š” ๋”์šฑ ๋†’์•„์ง

    ์˜ˆ์‹œ

    ์ƒˆ๋กœ์šด ๊ณ ํ˜ˆ์••์•ฝ์„ ๊ฐœ๋ฐœํ•˜๋Š” ์ œ์•ฝ์‚ฌ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค ์‹์•ฝ์ฒ˜๋Š” ๊ตญ๋ฏผ์˜ ๊ฑด๊ฐ•์„ ๊ณ ๋ คํ•˜์—ฌ ์Šน์ธ์„ ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค ๊ณ ํ˜ˆ์••์„ ๊ฐœ๋ฐœํ•œ ์ œ์•ฝ์‚ฌ๋Š” ์ž์‹ ๋“ค์˜ ๊ฐœ๋ฐœํ•œ ์•ฝ์ด ์—„์ฒญ๋‚œ ํšจ๊ณผ๊ฐ€ ์žˆ๋‹ค๋ผ๊ณ  ์ฃผ์žฅํ•˜์ง€๋งŒ ๊ธ€์Ž„? ์ด ๊ณผ์ •์—์„œ ์ผ์–ด๋‚  ์ˆ˜ ์žˆ๋Š” ํ†ต๊ณ„์  ์˜ค๋ฅ˜์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ด…์‹œ๋‹ค

    • ์‹์•ฝ์ฒ˜๋Š” ์—„๊ฒฉํ•œ ํ—ˆ๊ฐ€ ๊ณผ์ •์ด ํ•„์š”ํ•˜๋ฏ€๋กœ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐ€์„ค์„ ์„คใ…ˆ์–ด
      • ๊ท€๋ฌด๊ฐ€์„ค (H_0) : ๊ณ ํ˜ˆ์•• ์•ฝ์ด ํšจ๊ณผ๊ฐ€ ์—…์Œ
      • ๋Œ€๋ฆฝ๊ฐ€์„ค (H_1) : ๊ณ ํ˜ˆ์•• ์•ฝ์ด ํšจ๊ณผ๊ฐ€ ์žˆ์Œ (์ œ์•ฝ์‚ฌ๊ฐ€ ์ฃผ์žฅํ•˜๋Š” ๊ฐ€์„ค)
    • ๋งค์šฐ๋งค์šฐ ์—„๊ฒฉํ•œ ๊ธฐ์ค€์œผ๋กœ ์•ฝ์„ ํ—ˆ๊ฐ€๋‚ธ๋‹ค๋ฉด ๊ตญ๋ฏผ๋“ค์ด ์œ„ํ—˜ ๋Œ€๋น„ ์–ป๋Š” ํŽธ์ต์ด ์ ์Œ
    • ๋ฐ˜๋ฉด ๋„๋„ํ•œ ๊ธฐ์ค€์œผ๋กœ ์•ฝ์„ ํ—ˆ๊ฐ€๋‚ธ๋‹ค๋ฉด ๊ตญ๋ฏผ์˜ ์œ„ํ•ด๊ฐ€ ๊ฑฑ์ •
      • case 1)
        • ๊ท€๋ฌด๊ฐ€์„ค์ด ์‚ฌ์‹ค์ธ๋ฐ๋„ ๋ถˆ๊ตฌํ•˜๊ณ  ๋Œ€๋ฆฝ๊ฐ€์„ค์„ ์„ ํƒํ•˜๋Š” ๊ฒฝ์šฐ
        • ์ด ๊ฒฝ์šฐ ๊ณ ํ˜ˆ์•• ์•ฝ์ด ํšจ๊ณผ๊ฐ€ ์—†๋Š”๋ฐ ๋งˆ์น˜ ์žˆ๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ํŒ๋‹จ๋˜๋ฏ€๋กœ ์ด๋Š” ๊ตญ๋ฏผ์˜ ์œ„ํ•ด๊ฐ€ ์šฐ๋ ค๋˜๋Š” ์ƒํ™ฉ์ž…๋‹ˆ๋‹ค ์ด๋ฅผ 1์ข… ์˜ค๋ฅ˜(type 1 error)๋ผ๊ณ  ํ•จ
      • case 2)
        • ์‹ค์ œ๋กœ ๊ณ ํ˜ˆ์•• ์•ฝ์ด ํšจ๊ณผ๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ ์—†๋‹ค๋‹ˆ ์ œ์•ฝ์‚ฌ ์ž…์žฅ์—์„œ๋Š” ์–ต์šธ .. ์ด๋ฅผ 2์ข… ์˜ค๋ฅ˜(type 2 error)
      • ์‹ค์ œ๋กœ case 1์ด ๋” ํฐ ์œ„ํ—˜์ด๋ผ๊ณ  ํŒ๋‹จํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์šฐ๋ฆฌ๋Š” ์ด๋ฅผ ์œ ์˜์ˆ˜์ค€์œผ๋กœ ์ •์˜ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๊ฒŒ ๋จ

    https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=uranusjj&logNo=221610312776

     

    ์—ฐ์Šต๋ฌธ์ œ

    (๋‚œ ๋„์›€์ด ๋งŽ์ด ๋๊ธฐ๋•Œ๋ฌธ์—)

    1. ๊ฐ€์„ค๊ฒ€์ •์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ฃผ์š” ๊ฐœ๋… ์ค‘ ํ•˜๋‚˜์ธ p-value์˜ ์˜๋ฏธ๋ฅผ ์„ค๋ช…ํ•˜์„ธ์š”.
      p-value๋Š” ๊ท€๋ฌด๊ฐ€์„ค์ด ์ฐธ์ผ ๋•Œ, ๊ด€์ฐฐ๋œ ๋ฐ์ดํ„ฐ ๋˜๋Š” ๋” ๊ทน๋‹จ์ ์ธ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‚˜ํƒ€๋‚  ํ™•๋ฅ ์ด๋‹ค.

    2.๊ฐ€์„ค๊ฒ€์ •์—์„œ ๊ท€๋ฌด๊ฐ€์„ค(null hypothesis)๊ณผ ๋Œ€๋ฆฝ๊ฐ€์„ค(alternative hypothesis)์˜ ์ฐจ์ด์— ๋Œ€ํ•œ ์„ค๋ช…์œผ๋กœ ์˜ณ์€ ๊ฒƒ์„ ๊ณ ๋ฅด์„ธ์š”.
    ๊ท€๋ฌด๊ฐ€์„ค์€ ํ˜„์žฌ ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋Œ€๋ฆฝ๊ฐ€์„ค์€ ์—ฐ๊ตฌ์ž๊ฐ€ ์ž…์ฆํ•˜๊ณ ์ž ํ•˜๋Š” ์ฃผ์žฅ์ด๋‹ค.

    1. ๋‘ ๊ทธ๋ฃน์˜ ํ‰๊ท ์ด ์„œ๋กœ ๋‹ค๋ฅธ์ง€ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” t๊ฒ€์ •์˜ ์ข…๋ฅ˜๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?
      ๋…๋ฆฝ ํ‘œ๋ณธ t๊ฒ€์ •

    4.๋‹ค์ค‘๊ฒ€์ •์—์„œ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌธ์ œ์ ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?
    ์—ฌ๋Ÿฌ ๋ฒˆ์˜ ๊ฒ€์ •์„ ์ˆ˜ํ–‰ํ•  ๋•Œ, ์ „์ฒด ์‹คํ—˜์—์„œ ์ œ 1์ข… ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ ์ด ์ฆ๊ฐ€ํ•œ๋‹ค.

    1. ์นด์ด์ œ๊ณฑ๊ฒ€์ •์€ ์ฃผ๋กœ ์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ ๋ถ„์„ํ•  ๋•Œ ์‚ฌ์šฉ๋˜๋‚˜์š”?
      ๋ฒ”์ฃผํ˜• ๋ฐ์ดํ„ฐ
    2. ์ œ 1์ข… ์˜ค๋ฅ˜(Type I error)์™€ ์ œ 2์ข… ์˜ค๋ฅ˜(Type II error)์˜ ์ฐจ์ด์— ๋Œ€ํ•œ ์„ค๋ช…์œผ๋กœ ์˜ณ์€ ๊ฒƒ์„ ๊ณ ๋ฅด์„ธ์š”.
      ์ œ 1์ข… ์˜ค๋ฅ˜๋Š” ๊ท€๋ฌด๊ฐ€์„ค์ด ์ฐธ์ธ๋ฐ ๊ธฐ๊ฐํ•˜๋Š” ์˜ค๋ฅ˜์ด๊ณ , ์ œ 2์ข… ์˜ค๋ฅ˜๋Š” ๋Œ€๋ฆฝ๊ฐ€์„ค์ด ์ฐธ์ธ๋ฐ ๊ธฐ๊ฐํ•˜๋Š” ์˜ค๋ฅ˜์ด๋‹ค.

    'ํ†ต๊ณ„ํ•™' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

    ๊ฐ€์„ค๊ฒ€์ •์˜ ์ฃผ์˜์   (0) 2025.01.13
    ์ƒ๊ด€๊ด€๊ณ„  (1) 2025.01.13
    ํ†ต๊ณ„ํ•™ ๊ธฐ์ดˆ 2  (1) 2025.01.10
    ํ†ต๊ณ„ํ•™ ๊ธฐ์ดˆ  (2) 2025.01.10