One sample t-test : The Moon Illusion

2022. 4. 27. 23:04·.../Math
728x90
728x90

Kaufman and Rock (1962)의 실험 데이터 일부임.

달을 볼 때, 천공(zeneith or highest point)에 있는 달이 지평선에 가깝게 위치한 달에 비해 훨씬 작게 보이는 현상에 대한 실험임.
(실제로 지평선의 달이 3배 가량 되는 것으로 알려짐)

import numpy as np
import pandas as pd
import scipy.stats as stats

obtained_ratio = [1.73, 1.06, 2.03, 1.40, 0.95, 1.13, 1.41, 1.73, 1.63, 1.56]
df = pd.DataFrame(data=obtained_ratio, columns=['obtained_ratio'])
print('sample size:',df.count()[0])
print('sample mean:',df.mean()[0])
print('sample std:',df.std()[0])

위의 코드는 sample size와 sample mean, sample std를 구해줌.
결과

sample size: 10
sample mean: 1.463
sample std: 0.3406872139922157

Testing을 할 가설은 다음과 같음.

  • null hypothesis : $H_0: \mu=1.0$
  • alternative hypothesis : $H_1: \mu \ne 1.0$
stats.ttest_1samp(df['obtained_ratio'], popmean=1)

결과

Ttest_1sampResult(statistic=4.297591739651884, pvalue=0.001997695334372524)

기본적으로 stats.ttest_1samp는 two-tailed test (or two-sided test)를 수행함.

  • p-value가 0.2% 정도로 significance level을 0.05로 둘 경우엔 null hypothesis를 reject할 수 있음.
  • critical value $t_{0.05}(9)=\pm 2.262$임 (two side이므로 ppf(0.025)) .
rv = stats.t(df=9)
rf.ppf(0.025)

결과

-2.262157162740992

Reference

Fundamental Statistics for the Behavioral Sciences 8th Edition, Ch12.5

'... > Math' 카테고리의 다른 글

Closed-form solution and Closed-form expression - Analytical Method  (1) 2022.04.29
Normal Equation : Vector derivative 를 이용한 유도  (0) 2022.04.28
Chi Square : Independence Test (Analysis of Contingency Table)  (0) 2022.04.25
Chi Square Test : Goodness of fit test  (0) 2022.04.25
Chi Square for Large Contingency Table  (0) 2022.04.25
'.../Math' 카테고리의 다른 글
  • Closed-form solution and Closed-form expression - Analytical Method
  • Normal Equation : Vector derivative 를 이용한 유도
  • Chi Square : Independence Test (Analysis of Contingency Table)
  • Chi Square Test : Goodness of fit test
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (748)
      • Private Life (13)
      • Programming (56)
        • DIP (112)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    SIGNAL
    SS
    인허가제도
    math
    function
    fourier transform
    Term
    opencv
    DIP
    Convolution
    Programming
    Optimization
    numpy
    linear algebra
    cv2
    signals_and_systems
    Vector
    signal_and_system
    Probability
    Python
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
One sample t-test : The Moon Illusion
상단으로

티스토리툴바