Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
7
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
LaTeX と Overleaf によるショートペーパー作成 / Short paper writing with LaTeX and Overleaf
ks91
PRO
0
12
R を用いた検定(補講) (1) — Welch 検定 / Tests using R (supplementary) (1) - Welch test
ks91
PRO
0
8
R を用いた分析(補講) (1) — 重回帰分析 / Analysis using R (supplementary) (1) - Multiple regression analysis
ks91
PRO
0
5
R を用いた分析(補講) (2) — 人工データの生成 / Analysis using R (supplementary) (2) - Generating artificial data
ks91
PRO
0
6
GPT-4 を用いたデータ分析 / Data analysis using GPT-4
ks91
PRO
0
8
GPT-4 を用いた論文生成 / Paper generation using GPT-4
ks91
PRO
0
8
棒グラフ、帯グラフ(、円グラフ) / Bar chart, band chart (, pie chart)
ks91
PRO
0
13
さまざまなグラフ描画(1) / Various graphical representations (1)
ks91
PRO
0
10
さまざまなグラフ描画(2) / Various graphical representations (2)
ks91
PRO
0
12
Other Decks in Technology
See All in Technology
レガシーシステムへのDatadog APM導入奮闘記
mtakeya4062
0
130
RDRAとLLM
kanzaki
4
490
MediaPipe と ML Kit ってどう ちがうの? / What is the difference between MediaPipe and ML Kit?
yanzm
0
220
生成AI時代のセキュリティはAWSでどう進化する? ~AWSセキュリティの3つのポイントからアップデートを予測する~ / How will Security Evolve on AWS in the Era of Generative AI and Predicting Updates from 3 Points of AWS Security
yuj1osm
0
100
Kubernetesを知る
logica0419
17
4.4k
クルマのサブスクを Next.jsで内製化した経験とその1年後
kintotechdev
2
430
GAS × Discord bot × Gemini で作ったさいきょーの情報収集ツール
ysknsid25
1
420
Kubernetes だけじゃない!Amazon ECS で実現するクラウドネイティブな GitHub Actions セルフホストランナー / CNDW2024
ponkio_o
PRO
6
410
【CNDW2024】SIerで200人クラウドネイティブのファンを増やした話
yuta1979
1
280
プルリクが全てじゃない!実は喜ばれるOSS貢献の方法8選
tkikuc
17
2.2k
LLMを「速く」「安く」 動かすには / CloudNative Days Winter 2024
pfn
PRO
5
1.2k
GDGoC開発体験談 - Gemini生成AI活用ハッカソン / GASとFirebaseで挑むパン屋のフードロス解決 -
hotekagi
1
450
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
24k
Making Projects Easy
brettharned
115
5.9k
Ruby is Unlike a Banana
tanoku
97
11k
GraphQLとの向き合い方2022年版
quramy
44
13k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
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