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
RBC202003_Day2_Period7
Search
sakaue
March 20, 2020
Education
0
60
RBC202003_Day2_Period7
sakaue
March 20, 2020
Tweet
Share
More Decks by sakaue
See All by sakaue
SappoRo.R #11「R によるThe Multilingual Eye-tracking COrpus (MECO) の探索的データ分析」
sakaue
0
75
RBC202003_Day2_Period5
sakaue
0
32
RBC202003_Day2_Period6
sakaue
0
64
Rbootcamp202003_Day2_p8.pdf
sakaue
0
67
RBC202003_Day1_Period1
sakaue
1
49
RBC202003_Day1_Period2
sakaue
0
52
RBC202003_Day1_Period3
sakaue
0
61
RBC202003_Day1_Period4
sakaue
0
35
Other Decks in Education
See All in Education
コンセプトシェアハウス講演資料
uchinomasahiro
0
380
Medicare 101 for 2025
robinlee
PRO
0
200
Human Perception and Cognition - Lecture 4 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
700
1106
cbtlibrary
0
410
Library Prefects 2024-2025
cbtlibrary
0
110
勉強したらどうなるの?
mineo_matsuya
9
6.4k
Kindleストアで本を探すことの善悪 #Izumo Developers' Guild 第1回 LT大会
totodo713
0
130
Canva
matleenalaakso
0
420
ルクソールとツタンカーメン
masakamayama
1
750
Web Application Frameworks - Lecture 4 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
2409_CompanyInfo_Hanji_published.pdf
yosukemurata
0
300
20240810_ワンオペ社内勉強会のノウハウ
ponponmikankan
2
880
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Designing Experiences People Love
moore
138
23k
GitHub's CSS Performance
jonrohan
1030
460k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Agile that works and the tools we love
rasmusluckow
327
21k
Navigating Team Friction
lara
183
14k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Documentation Writing (for coders)
carmenintech
65
4.4k
Transcript
2020-03-20 ୈ7ݶ σʔλͷՄࢹԽ (1) bootcamp
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
σʔλΛूΊͨΒ ཁ͚ͩͰͳ͘ σʔλͷՄࢹԽඞཁ 1. ͳͥՄࢹԽ͕ඞཁ͔
1. ͳͥՄࢹԽ͕ඞཁ͔ ʢ݁ՌΛݟΔਓͷͨΊʹʣ ੳ݁ՌΛΘ͔Γ͑͘͢Δ ʢ݁ՌΛग़ࣗ͢ͷͨΊʹʣ ੳΛ࢝ΊΔख͕͔ΓΛಘΔ cf. p. 82
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
جຊతͳ࡞ਤखॱ 1. มʹΛೖ͢Δ 2. ࡞ਤ༻ͷؔΛ࣮ߦ 2. ώετάϥϜΛඳ͘
ͨͬͨ2ஈ֊ Excel SPSS Ͱ͜͏͍͔ͳ͍
ʲࣄྫʳ corporaύοέʔδͷ BNCbiber σʔληοτΛͬͨ සσʔλͷՄࢹԽ 2. ώετάϥϜΛඳ͘
• σʔλΛಡΈࠐΈɼ֬ೝ͠ͳ͕ΒɼώετάϥϜΛඳ͘ 1. > install.packages("corpora") #ࠓճͷRStudio Server Ͱෆཁ 2. >
library(corpora) #RStudio ͰνΣοΫΛೖΕΔͷΈ 3. > data(BNCbiber) #σʔληοτ४උ 4. > head(BNCbiber, 5) #σʔληοτͷ࠷ॳ5ߦΛදࣔ 5. > hist(BNCbiber[, 2]) #ώετάϥϜͷඳը 6. > class(BNCbiber) #σʔλͷΫϥεʢmatrixʣΛ֬ೝ 7. > BNCbiber2 <- as.data.frame(BNCbiber) #data.frame ѻ͍ʹ 8. > hist(BNCbiber2$f01_past_tense) #σʔλ໊$ྻϥϕϧ໊Ͱࢦఆ ͠ඳը 2. ώετάϥϜΛඳ͘
Histogram of BNCbiber[, 2] BNCbiber[, 2] Frequency 0 20 40
60 80 100 0 200 600 1000
σʔλϑϨʔϜͱ • ͍ΖΜͳσʔλΛಥͬࠐΜͩͷ • ͍ΖΜͳʹ࣭తσʔλʴྔతσʔλ • ಥͬࠐΉʹҰॹʹฒΜͰ͍Δ͜ͱ 2. ώετάϥϜΛඳ͘
໊લ ݂ӷܕ ମॏ ࡔຊ B 175 65 ߴڮ B
177 70 Ѩ෦ B 174 75 A 179 70 দຊ O 170 60 2. ώετάϥϜΛඳ͘ σʔλϑϨʔϜͱ
• Excel ͷ WS ͱ΄΅ಉ͡Πϝʔδ • طଘσʔλͷಡࠐʼࣗྗͰ࡞Δ • data.frame() ͕ؔ͑Δ
• ϕΫτϧΛ࿈݁ͯ͠࡞Δ • ߦྻΛσʔλϑϨʔϜʹม 2. ώετάϥϜΛඳ͘ σʔλϑϨʔϜͱ
• ώετάϥϜͷௐΛ͢Δ • # ώετάϥϜͷλΠτϧͱ࣠ϥϕϧΛมߋ • > hist(BNCbiber[, 2], main
= "past tense", xlab = "frequency", ylab = "number of texts") • # ώετάϥϜͷ৭Λมߋ • > hist(BNCbiber[, 2], main = "past tense", xlab = "frequency", ylab = "number of texts", col = "grey") • > colors()ɹ#͑Δ৭ͷ֬ೝ 2. ώετάϥϜΛඳ͘
past tense frequency number of texts 0 20 40 60
80 100 0 200 600 1000
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
• ਖ਼໊ࣜɿbox-and-whisker plot [Tukey, 1977] • ෳͷඪຊΛൺֱ͢Δͷʹར༻ • ശͷ͔͞Βσʔλͷʮ෯ʯΛൺֱ •
3ͭҎ্ͷඪຊͰൺֱ͍͢͠ • ͳ͔ͥ͋·Γݟ͔͚ͳ͍... ؾͷ͍ͤʁ 3. ശͻ͛ਤΛඳ͘
ਤɿӳޠͷϑϨʔζΛಡΜͩࡍͷԠ࣌ؒͷ 3. ശͻ͛ਤΛඳ͘
• boxplot() ؔͰ͋ͬ͞Γ࡞ਤ • usage: boxplot(x, horizontal=TRUE) • horizontal ɼശΛԣʹ͢ΔΦϓγϣϯ
• boxplot.stats() ͍ؔͭͰʹ • ཁ౷ܭྔΛग़ͯ͘͠ΕΔ 3. ശͻ͛ਤΛඳ͘
தԝ ֎Ε ശͷʴ࢛Ґˎ1.5ͷൣғͰ Ұ൪େ͖ͳʢͻ͛ઌʣ ࢛Ґ 3. ശͻ͛ਤΛඳ͘
ΦϓγϣϯʢҾʣ ػೳ col ശΛృΔ৭ names ֤ശͷϥϕϧ range ശͷ͔Βώή·Ͱͷ෯ width ശͷ෯
notch ശͷΣετΛࡉ͘ 3. ശͻ͛ਤΛඳ͘
• > boxplot(BNCbiber[, 2], range = 0) # ശͻ͛ਤͷඳը •
> boxplot.stats(BNCbiber[, 2]) # ཁ౷ܭྔͷ֬ೝ • > boxplot(BNCbiber[, 2], range = 0, main = "past tense", col = "grey") # ശͻ͛ਤͷλΠτϧͱ৭Λมߋ • boxplot(BNCbiber[, 2], main = "past tense", col = "grey") # ശͻ͛ਤͷ֎ΕΛදࣔ 3. ശͻ͛ਤΛඳ͘
• σʔλΛಡΈࠐΈɼ֬ೝ͠ͳ͕Βɼ2ͭͷശͻ͛ਤΛඳ͘ 1. > pym <- read.csv(file.choose(), header = TRUE,
row.names = 1) 2. > head(pym, 5) 3. > boxplot(pym[, 2] ~ pym[, 6], names = c("high", "low"), col = "grey")ɹ#άϧʔϓผͷശͻ͛ਤͷඳը 4. > boxplot(pym[, 2] ~ pym[, 6], names = c("high", "low"), col = "grey", notch = TRUE) #ϊονͷ͋Δശͻ͛ਤͷඳը 3. ശͻ͛ਤΛඳ͘
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘ violin plot ≒ boxplot+hist boxplot + beeswarm
• ശͻ͛ਤͱ๘܈ਤͷॏͶඳ͖ 1. install.packages("beeswarm", dependencies = TRUE) 2. library(beeswarm) 3.
boxplot(pym[, 2] ~ pym[, 6], names = c("high", "low"), col = "grey") 4. beeswarm(pym[, 2] ~ pym[, 6], col = "black", pch = 16, add = TRUE)ɹ# ശͻ͛ਤͷ্ʹݸʑͷσʔλͷΛ ॏͶͯඳը 4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘
• ϰΝΠΦϦϯϓϩοτΛඳ͘ 1. install.packages("vioplot", dependencies = TRUE) 2. library(vioplot) 3.
vioplot(pym[1 : 50, 2], pym[51 : 101, 2], names = c("high", "low"), col = "grey") #ϰΝΠΦϦϯϓ ϩοτͷඳը 4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
Agenda 1. ͳͥՄࢹԽ͕ඞཁ͔ (5) 2. ώετάϥϜΛඳ͘ (20) 3. ശͻ͛ਤΛඳ͘ (20)
4. ๘܈ਤͱϰΝΠΦϦϯϓϩοτΛඳ͘(15) 5. ԋशʹ͙࣍ԋश (30)
5. ԋशʹ͙࣍ԋश 1. http://sakaue.info ͷ RBC ಛઃαΠτ͔Βຊԋश ༻σʔλΛऔͬͯ͘Δ 2. μϯϩʔυͨ͠σʔλΛ
RStudio Server ʹҠಈ 3. ϑΝΠϧͷதΛ֬ೝ͠ɼ֤ྻͷฏۉΛٻΊΔ 4. Pre test ͱ Post testͷώετάϥϜΛඳ͘ 5. Pre test ͱ Post testͷശͻ͛ਤΛඳ͘ 1. X࣠ʹɼPRE, POST ͱϥϕϧΛ͚Δ 2. ശΛԣʹ͢Δ 3. ശΛ৭Λ͚Δ 4. y࣠ͷൣғΛ 0͔Β100·ͰʹࢦఆʢάάΔ!ʣ
5. ԋशʹ͙࣍ԋशʢώϯτʣ 1. http://sakaue.info ͷ RBC ಛઃαΠτ͔Βຊԋश༻ σʔλΛऔͬͯ͘Δ 2. Studio
Server ͷ Upload ϘλϯΛԡ͠·͠ΐ͏ 3. apply() ؔͱ mean() ؔΛ߹Θ͍ͤͯ·͠ΐ͏ 4. ͦΕͧΕͷྻͷσʔλΛผͷมʹೖΕ͔ͯΒɼώ ετάϥϜΛඳؔ͘Λ͍·͠ΐ͏ 5. 4ͰͬͨมΛͬͯശͻ͛ਤΛඳ͖·͠ΐ͏ 1. Ҿʹ names Λ༻͍·͢ 2. Ҿʹ horizontal Λ༻͍·͢ 3. Ҿʹ col Λ༻͍·͢ 4. Ҿʹ ylim Λ༻͍·͢
࡞ਤखॱͷ·ͱΊ 1. มʹΛೖ͢Δ 2. ࡞ਤ༻ͷؔΛͬͯॲཧ͢Δ 3. ܗࣜΛࢦఆͯ͠อଘ ʴਓʹঝʢtwitter, blogʣ
http://www.flickr.com/photos/rosengrant/4751386872/ खܰʹඒ͘͠ ࡞ਤͰ͖Δ ɹɹɹΛ ͑ΔΑ͏ʹͳΕ Excel ʹ͓͞Βʂ “y2.d175 | Lasershow!
Relax!” by B Rosen
Enjoy ! twitter: @sakaue e-mail: tsakaue<AT>hiroshima-u.ac.jp