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
R を用いた検定(補講) (2) — カイ二乗検定 / Tests using R (sup...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kenji Saito
PRO
November 30, 2024
Technology
99
0
Share
R を用いた検定(補講) (2) — カイ二乗検定 / Tests using R (supplementary) (2) - Chi-squared test
早稲田大学大学院経営管理研究科「企業データ分析」2024 冬のオンデマンド教材 第10回で使用したスライドです。
Kenji Saito
PRO
November 30, 2024
More Decks by Kenji Saito
See All by Kenji Saito
ウェブとイノベーション / The Web and Innovation
ks91
PRO
0
14
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
47
アカデミーキャンプ2026GW「前倒し!ウチらとヤツらの自由研究」DAY 4 / Academy Camp 2026 GW "Bringing It Forward! Our and Their Free Research Projects" DAY 4
ks91
PRO
0
30
アカデミーキャンプ2026GW「前倒し!ウチらとヤツらの自由研究」DAY 3 / Academy Camp 2026 GW "Bringing It Forward! Our and Their Free Research Projects" DAY 3
ks91
PRO
0
47
アカデミーキャンプ2026GW「前倒し!ウチらとヤツらの自由研究」DAY 2 / Academy Camp 2026 GW "Bringing It Forward! Our and Their Free Research Projects" DAY 2
ks91
PRO
0
56
アカデミーキャンプ2026GW「前倒し!ウチらとヤツらの自由研究」DAY 1 / Academy Camp 2026 GW "Bringing It Forward! Our and Their Free Research Projects" DAY 1
ks91
PRO
0
83
コードや知識を組み込む / Incorporate Code and Knowledge
ks91
PRO
0
190
2026年度 生成AI を活用した論文執筆ガイド/ワークショップ / 2026 Academic Year Guide to Writing Papers Using Generative AI - Workshop
ks91
PRO
0
110
インターネットのガバナンスと応用 / Internet Governance and Applications
ks91
PRO
0
73
Other Decks in Technology
See All in Technology
拝啓、あの夏の僕へ〜あなたも知っているApp Runnerの世界〜
news_it_enj
0
160
大学職員のための生成AI最前線 :最前線を、AIガバナンスとして読み直すためのTips
gmoriki
0
2.3k
COBOL婆さんの伝説
poropinai1966
0
130
AgentCore×VPCでの設計パターンn選と勘所
har1101
4
360
AI活用時代の事業判断高度化を導くエンジニアリング基盤 / 20260424 Atsushi Funahashi
shift_evolve
PRO
2
120
VespaのParent Childを用いたフィードパフォーマンスの改善
taking
0
170
要件定義の精度を高めるための型と生成AIの活用 / Using Types and Generative AI to Improve the Accuracy of Requirements Definition
haru860
0
260
サービスの信頼性を高めるため、形骸化した「プロダクションミーティング」を立て直すまでの取り組み
stefafafan
0
140
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
1
520
AI時代に越境し、 組織を変えるQAスキルの正体 / QA Skills for Transforming an Organization
mii3king
0
470
ブラウザの投機的読み込みと投機ルールAPIを理解し、Webサービスのパフォーマンスを最適化する
shuta13
1
240
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
3.1k
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
320
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
130
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
For a Future-Friendly Web
brad_frost
183
10k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
330
A Modern Web Designer's Workflow
chriscoyier
698
190k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
350
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
550
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
Designing for humans not robots
tammielis
254
26k
30 Presentation Tips
portentint
PRO
1
280
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
Transcript
Boxes and whiskers — generated by Stable Diffusion XL v1.0
2024 10 R ( ) (2) — χ2 (WBS) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.1/14
https://speakerdeck.com/ks91/collections/corporate-data-analysis-2024-winter 2024 10 R ( ) (2) — χ 2
— 2024-11 – p.2/14
( 20 ) 1 • 2 R • 3 •
4 • 5 • 6 ( ) • 7 (1) • 8 (2) • 9 R ( ) (1) — Welch • 10 R ( ) (2) — χ2 • 11 R ( ) (1) — 12 R ( ) (2) — 13 GPT-4 14 GPT-4 15 ( ) LaTeX Overleaf 8 (12/16 ) / (2 ) OK / 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.3/14
χ2 : : ( ) 3 ( ) 2024 10
R ( ) (2) — χ 2 — 2024-11 – p.4/14
χ2 ( ) ( ) ( ) χ2 = n
i=1 (fi − ˆ fi )2 ˆ fi ( f (frequency) ˆ f ( )) χ2 df df = n − 1 χ2 = nj j=1 ni i=1 (fji − ˆ fji )2 ˆ fji (ni × nj ) df = (ni − 1) × (nj − 1) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.5/14
R 10 4 14 2 4 6 12 8 20
= × ( 12:8 14 ) 8.4 5.6 14 3.6 2.4 6 12 8 20 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.6/14
χ2 ( ) 1 6 (H0 ) # ( H_0
) > chisq.test(c(28, 33, 25, 35, 27, 32), p=c(1/6, 1/6, 1/6, 1/6, 1/6, 1/6)) # ( H_0 ) > chisq.test(c(42, 33, 25, 35, 27, 18), p=c(1/6, 1/6, 1/6, 1/6, 1/6, 1/6)) ‘chisq.test(. . . )’ ( ) ( ) ( ) ← R χ2 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.7/14
( ) 0 5 10 15 20 0.00 0.05 0.10
0.15 χ2(5) x dchisq(x, df) χ2 0.05 (5) = 11.1 χ2 = 2.53 “ .R” source chisqdistg(5, chisq=2.5333) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.8/14
( ) 0 5 10 15 20 0.00 0.05 0.10
0.15 χ2(5) x dchisq(x, df) χ2 0.05 (5) = 11.1 χ2 = 11.9 chisqdistg(5, chisq=11.867) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.9/14
χ2 (1) R A 16 4 20 12 8 20
28 12 40 options(digits=7) # A <- matrix(c(16, 12, 4, 8), 2, 2) chisq.test(A, correct=F) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.10/14
0 5 10 15 20 0.0 0.2 0.4 0.6 0.8
χ2(1) x dchisq(x, df) χ2 0.05 (1) = 3.84 χ2 = 1.9 options(digits=3) chisqdistg(1, chisq=1.9048) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.11/14
χ2 (2) B 160 40 200 120 80 200 280
120 400 options(digits=7) # B <- matrix(c(160, 120, 40, 80), 2, 2) chisq.test(B, correct=F) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.12/14
0 5 10 15 20 0.0 0.2 0.4 0.6 0.8
χ2(1) x dchisq(x, df) χ2 0.05 (1) = 3.84 χ2 = 19 options(digits=3) chisqdistg(1, chisq=19.048) 2024 10 R ( ) (2) — χ 2 — 2024-11 – p.13/14
2024 10 R ( ) (2) — χ 2 —
2024-11 – p.14/14