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
13
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
P 値と有意差/分散分析 / P-value, Significant Difference and Analysis of Variance
ks91
PRO
0
17
関連2群のt検定/独立2群のt検定 / Related 2-group t-test and independent 2-group t-test
ks91
PRO
0
47
A Guide to Paper Writing Support with Generative AI - A Joint Zemi
ks91
PRO
0
9
正規分布と簡単な統計理論/t分布と信頼区間 / Normal distribution, simple statistical theory, t-distribution and confidence intervals
ks91
PRO
0
42
じわじわ迫ってきている自動化社会 (その先にメタ・ネイチャー) / The Slowly Approaching Automated Society (and its beyond: Meta-Nature)
ks91
PRO
0
6
起こりうる誤った推論/平均・分散・標準偏差・自由度 / Possible false inferences, means, variances, standard deviations and degrees of freedom
ks91
PRO
0
57
LaTeX と Overleaf によるショートペーパー作成 / Short paper writing with LaTeX and Overleaf
ks91
PRO
0
23
R を用いた検定(補講) (1) — Welch 検定 / Tests using R (supplementary) (1) - Welch test
ks91
PRO
0
12
R を用いた分析(補講) (1) — 重回帰分析 / Analysis using R (supplementary) (1) - Multiple regression analysis
ks91
PRO
0
13
Other Decks in Technology
See All in Technology
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
180
多様なメトリックとシステムの健全性維持
masaaki_k
0
130
20241125 - AI 繪圖實戰魔法工作坊 @ 實踐大學
dpys
1
340
ガバナンスを支える新サービス / New Services to Support Governance
sejima1105
1
620
AWS re:Invent 2024 Recap in ZOZO - Serverless で好きなものをしゃべってみた
chongmyungpark
0
620
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
39k
12 Days of OpenAIから読み解く、生成AI 2025年のトレンド
shunsukeono_am
0
770
ISUCON、今年も参加してみた / ISUCON, I challenged it again this year.
dero1to
0
110
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
210
20240513 - 框裡框外_文學院學生如何在AI世代安身立命 @ 淡江大學
dpys
0
460
Server-Side Engineer of LINE Sukimani
lycorp_recruit_jp
1
450
Storage Browser for Amazon S3
miu_crescent
1
320
Featured
See All Featured
Navigating Team Friction
lara
183
15k
Adopting Sorbet at Scale
ufuk
74
9.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Building an army of robots
kneath
302
44k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Rails Girls Zürich Keynote
gr2m
94
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
The Language of Interfaces
destraynor
155
24k
Side Projects
sachag
452
42k
A designer walks into a library…
pauljervisheath
205
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
190
The Pragmatic Product Professional
lauravandoore
32
6.3k
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