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
27
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
AGI (人工一般知能) と創る新しく奇妙な社会 / New and Stranger Society built with AGI
ks91
PRO
0
12
回帰分析/大規模言語モデルと統計 / Regression Analysis, Large Language Models and Statistics
ks91
PRO
0
58
多重比較/相関分析 / Multiple Comparison and Correlation Analysis
ks91
PRO
0
58
アカデミーキャンプ 2025冬「考えるのは奴らだ」 / Academy Camp 2025 Winter - Live and Let Think DAY 3
ks91
PRO
0
51
アカデミーキャンプ 2025冬「考えるのは奴らだ」 / Academy Camp 2025 Winter - Live and Let Think DAY 2
ks91
PRO
0
40
アカデミーキャンプ 2025冬「考えるのは奴らだ」 / Academy Camp 2025 Winter - Live and Let Think DAY 1
ks91
PRO
1
66
インクルーシブな社会へ / Toward an Inclusive Society
ks91
PRO
0
12
P 値と有意差/分散分析 / P-value, Significant Difference and Analysis of Variance
ks91
PRO
0
63
関連2群のt検定/独立2群のt検定 / Related 2-group t-test and independent 2-group t-test
ks91
PRO
0
70
Other Decks in Technology
See All in Technology
教師なし学習の基礎
kanojikajino
4
360
プロダクト観点で考えるデータ基盤の育成戦略 / Growth Strategy of Data Analytics Platforms from a Product Perspective
yamamotoyuta
0
240
private spaceについてあれこれ調べてみた
operando
1
170
20250125_Agent for Amazon Bedrock試してみた
riz3f7
2
110
EDRからERM: PFN-SIRTが関わるセキュリティとリスクへの取り組み
pfn
PRO
0
110
HCP TerraformとAzure:イオンスマートテクノロジーのインフラ革新 / HCP Terraform and Azure AEON Smart Technology's Infrastructure Innovation
aeonpeople
3
990
[SRE kaigi 2025] ガバメントクラウドに向けた開発と変化するSRE組織のあり方 / Development for Government Cloud and the Evolving Role of SRE Teams
kazeburo
4
1.9k
CloudWatch Container Insightsを使ったAmazon ECSのリソース監視
umekou
1
120
Skip Skip Run Run Run ♫
temoki
0
360
RevOpsへ至る道 データ活用による事業革新への挑戦 / path-to-revops
pei0804
3
810
アクセシブルなマークアップの上に成り立つユーザーファーストなドロップダウンメニューの実装 / 20250127_cloudsign_User1st_FE
bengo4com
2
1.2k
Postman Vaultを使った秘密情報の安全な管理
nagix
3
140
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
74
9.2k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
The Cult of Friendly URLs
andyhume
78
6.2k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
The Invisible Side of Design
smashingmag
299
50k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Designing for Performance
lara
604
68k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Embracing the Ebb and Flow
colly
84
4.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
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