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) — カイ二乗検定 / Other Tests Using R...
Search
Kenji Saito
PRO
January 21, 2024
Business
160
0
Share
R を用いた検定(補講) (2) — カイ二乗検定 / Other Tests Using R (1) - Chi-Square Test
早稲田大学大学院経営管理研究科「企業データ分析」2023 冬のオンデマンド教材 第10回で使用したスライドです。
Kenji Saito
PRO
January 21, 2024
More Decks by Kenji Saito
See All by Kenji Saito
インターネットの技術 / Internet technology
ks91
PRO
0
110
大規模言語モデルの原理と使いこなしの原則 / Principles of Large Language Models and How to Use Them Effectively
ks91
PRO
0
31
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
230
研究って何だっけ / What is research anyway?
ks91
PRO
0
24
ブロックチェーンと分散ファイナンス概論 / Introduction to Blockchain and Decentralized Finance
ks91
PRO
0
14
サイバーフィジカル社会とは何か / What Is a Cyber-Physical Society?
ks91
PRO
0
190
本授業におけるエージェント・ハブの使い方 / How to Use the Agent Hub in This Course
ks91
PRO
0
73
LLM とプロンプトエンジニアリング/チューターを定義する / LLMs and Prompt Engineering, and Defining Tutors
ks91
PRO
0
400
Running Coding Agents (Windows WSL Edition)
ks91
PRO
0
51
Other Decks in Business
See All in Business
ドクターベネフィットG紹介資料‗エムスリー / Introduction of Doctor Benefit Group of M3inc
m3
0
370
株式会社ハイウェイ_採用候補者様向け会社紹介資料
recruit_hiway
0
220
2000年前の「心の整理術」で、ふりかえり後の1アクションを決める!〜ストア哲学で、チームをもっと軽やかに〜
doiko123
0
470
LW_brochure_business
lincwellhr
1
80k
エンジニア職/新卒向け会社紹介資料(テックファーム株式会社)
techfirm
1
5.8k
株式会社ハイパー 会社紹介資料
hypermarketingteam
0
9.5k
【エンジニア職】中途採用向け会社説明資料(テックファーム株式会社)
techfirm
0
7k
New Space Intelligence - 会社説明資料 -
recruitnsi
0
460
合同会社DMM.com ヘルスケア本部 サービス紹介資料
dmm
0
1.4k
withエンジニア_Real Voices
enito
PRO
0
120
AIツール入れたのに、 なぜ意思決定は遅いまま?
unson
0
110
三井物産グループのデジタル証券~文京区・世田谷区レジデンス~徹底解説セミナー
c0rp_mdm
PRO
0
1.2k
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.8k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
150
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
130
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Building AI with AI
inesmontani
PRO
1
880
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
What's in a price? How to price your products and services
michaelherold
247
13k
Accessibility Awareness
sabderemane
0
98
Transcript
generated by Stable Diffusion XL v1.0 2023 10 R (
) (2) — χ2 (WBS) 2023 10 R ( ) (2) — χ 2 — 2024-01 – p.1/14
https://speakerdeck.com/ks91/collections/corporate-data-analysis-2023-winter 2023 10 R ( ) (2) — χ 2
— 2024-01 – 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/21 ) / (2 ) OK / 2023 10 R ( ) (2) — χ 2 — 2024-01 – p.3/14
χ2 : : ( ) 3 ( ) 2023 10
R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – 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) 2023 10 R ( ) (2) — χ 2 — 2024-01 – p.13/14
2023 10 R ( ) (2) — χ 2 —
2024-01 – p.14/14