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
Kenji Saito
PRO
November 30, 2024
Technology
0
42
R を用いた検定(補講) (2) — カイ二乗検定 / Tests using R (supplementary) (2) - Chi-squared test
早稲田大学大学院経営管理研究科「企業データ分析」2024 冬のオンデマンド教材 第10回で使用したスライドです。
Kenji Saito
PRO
November 30, 2024
Tweet
Share
More Decks by Kenji Saito
See All by Kenji Saito
コードや知識を組み込む / Incorporating Codes and Knowledge
ks91
PRO
0
110
シリアスゲームとしての RPG / RPGs as Serious Games
ks91
PRO
0
40
"September 12th" ゲームのプロンプトの構造 / "September 12th" Game Prompt Structure
ks91
PRO
0
32
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
130
自然言語の扱いと翻訳のためのプロンプト / Natural Language Handling and Prompts for Translation
ks91
PRO
0
37
研究って何だっけ / What is Research?
ks91
PRO
0
33
ブロックチェーンと分散ファイナンス概論 / Introduction to Blockchain and Decentralized Finance
ks91
PRO
0
17
大規模言語モデルの原理と使いこなしの原則 / Principles of Large Language Models and Their Use
ks91
PRO
0
33
講師研究紹介 / Research Introduction of the Lecturer
ks91
PRO
0
42
Other Decks in Technology
See All in Technology
SmartHR プロダクトエンジニア求人ガイド_2025 / PdE job guide 2025
smarthr
0
170
3D生成AIのための画像生成
kosukeito
1
220
地味にいろいろあった! 2025春のAmazon Bedrockアップデートおさらい
minorun365
PRO
1
460
Aspire をカスタマイズしよう & Aspire 9.2
nenonaninu
0
170
生成AIによるCloud Native基盤構築の可能性と実践的ガードレールの敷設について
nwiizo
7
1.2k
Spring Bootで実装とインフラをこれでもかと分離するための試み
shintanimoto
7
880
AIにおけるソフトウェアテスト_ver1.00
fumisuke
0
190
PagerDuty×ポストモーテムで築く障害対応文化/Building a culture of incident response with PagerDuty and postmortems
aeonpeople
2
400
白金鉱業Meetup_Vol.18_AIエージェント時代のUI/UX設計
brainpadpr
1
200
PdM採用とAIの製品活用を同時に頑張ってみた話 / EM oasis 20250418
rakus_dev
0
120
Microsoft の SSE の現在地
skmkzyk
0
160
コスト最適重視でAurora PostgreSQLのログ分析基盤を作ってみた #jawsug_tokyo
non97
1
630
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
119
51k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Being A Developer After 40
akosma
91
590k
Adopting Sorbet at Scale
ufuk
76
9.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A better future with KSS
kneath
239
17k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Gamification - CAS2011
davidbonilla
81
5.2k
Practical Orchestrator
shlominoach
186
11k
KATA
mclloyd
29
14k
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