Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
応用セッション_同じデータでもP値が変わる話/key_considerations_in_NH...
Search
florets1
January 17, 2024
Education
1
1.1k
応用セッション_同じデータでもP値が変わる話/key_considerations_in_NHST_2
florets1
January 17, 2024
Tweet
Share
More Decks by florets1
See All by florets1
直積は便利/direct_product_is_useful
florets1
3
220
butterfly_effect/butterfly_effect_in-house
florets1
1
90
データハンドリング/data_handling
florets1
2
140
カイ二乗検定との遭遇/The_path_to_encountering_the_chi-square_test
florets1
1
190
率の平均を求めてはいけない/Do_Not_Average_Rates
florets1
10
15k
請求と支払を照合する技術/using_full_join_in_r
florets1
2
200
お名前から性別を推測する/Guessing_gender_from_name
florets1
1
410
バタフライ効果/butterfly_effect
florets1
0
220
尤度/likelihood
florets1
3
870
Other Decks in Education
See All in Education
week@tcue2024
nonxxxizm
0
510
The Gender Gap in the Technology Field and Efforts to Address It
codeforeveryone
0
140
Adobe Express
matleenalaakso
1
7.4k
本の虫になろう
kenjiro56
0
130
Evaluation Methods - Lecture 6 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
660
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
770
勉強する必要ある?
mineo_matsuya
2
1.1k
オープンソース防災教育ARアプリの開発と地域防災での活用
nro2daisuke
0
140
Web Architectures - Lecture 2 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
H5P-työkalut
matleenalaakso
4
35k
Comezando coas redes
irocho
0
310
Kindleストアで本を探すことの善悪 #Izumo Developers' Guild 第1回 LT大会
totodo713
0
120
Featured
See All Featured
Teambox: Starting and Learning
jrom
132
8.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
13
1.9k
Agile that works and the tools we love
rasmusluckow
327
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Rails Girls Zürich Keynote
gr2m
93
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
Thoughts on Productivity
jonyablonski
67
4.3k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Producing Creativity
orderedlist
PRO
341
39k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
360
The Straight Up "How To Draw Better" Workshop
denniskardys
232
130k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Transcript
1 応用セッション 2024.01.20 Tokyo.R #110 同じデータでもP値が変わる話
2 統計的仮説検定 同じデータからは同じ検定結果が得られるもの と考えられがちですが 実際には必ずしもその通りではありません。
3 例えば コイン投げをして24回中7回が表になったという単純 なデータを考えてみましょう。 このようなデータでも、実験の設定や投げる回数の制 約によって、統計的仮説検定の結果が変わることがあ るのです。
4 コインを1回投げる 𝑝 𝑦 𝜃 = 𝜃𝑦(1 − 𝜃)(1−𝑦) 𝜃
= 0.5 ベルヌーイ分布 θ: 表が出る確率 y: 1 は表, 0 は裏
5 コインをN回投げる 裏裏表表裏裏表裏裏裏裏裏裏裏裏裏表裏裏表表裏裏表 表が出る確率 θ 投げる回数 N 表の回数 z 二項分布
6 統計的仮説検定の流れ 帰無仮説をたてる ↓ 標本分布を計算する ↓ データを観測してP値を求める
7 帰無仮説をたてる ある統計量がある値と等しいということを帰無仮説と して設定します。 例) コインの裏表が出る確率が50%と等しい 平均値が等しい
8 標本分布を計算する 帰無仮説が成り立つ場合にその統計量が従うであろう 確率分布(=標本分布)を計算します。 例) コインの裏表が出る確率 → 二項分布など 平均値 →
t分布など
9 データを観測してP値を求める 実際に観測された値、もしくはそれ以上に極端な値が 標本分布に占める面積、つまりそのような値が観測さ れる確率(P値)を求めます。
10 P値があらかじめ設定したしきい値(たとえば5%)よ りも小さければ、そもそも帰無仮説が間違っていたの だと結論づけます。 逆に小さくなければ帰無仮説を棄却せず、判断を保留 します。 P値で判断
11 コインを24回投げて7回表が出た このコインは公平か。 データ観測者の意図 コインを24回投げると決めていた。結果として7回表 がでた。
12 標本分布 表が出る確率 θ 投げる回数 N 表の回数 z 二項分布
13 データを観測 θ = 0.5 N = 24 z =
7 P値 = 0.064 Sample Proportion z/N p(z/N)
14 Rのコード
15 Pythonのコード
16 コインを24回投げて7回表が出た このコインは公平か。 データ観測者の意図 7回表が出るまで投げ続けると決めていた。結果として 24回投げた。 ↓ 23回投げた時点で6回表が出ており、24回目では表が 出た。
17 標本分布 N-1回投げた時点でz-1回表が出て N回目は表
18 データを観測 θ = 0.5 z = 7 N =
24 P値 = 0.017 Sample Proportion z/N p(z/N)
19 Rのコード
20 Pythonのコード
21 投げる回数N 表が出る回数 z • Nを固定する意図ではP値=0.064(判断を保留) • zを固定する意図ではP値=0.017(帰無仮説を棄却) 同じデータを観測しても、観測者の意図によって 検定結果が変わる!
22 意外にも 観察者の意図やデータ収集の方法が、統計的な結果に 影響を与える可能性があるのです。 このような現象は、統計的な検定の限界や留意すべき 要点を浮き彫りにします。単に数値を見るだけではな く、実験の文脈や条件を正しく理解することの重要性 を示しています。
23 参考書 飯塚修平. ウェブ最適化ではじめる機械学習. オライ リー・ジャパン, 2020 John K. Kruschke.
Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan EDITION 2. Academic Press, 2014