SlideShare a Scribd company logo
統計軟體實作與應用
Statistical Computing
徐峻賢
中央研究院語言學研究所
大腦與語言實驗室
a brief introduction of myself
• neurolinguistic studies of word recognition
• a database of Mandarin Chinese characters/words
• human perception in detecting F0 changes
• nonlinearity of brain waves and speech sounds
Cognitive
Psychology
Neuroscien
ce
Linguistics
Machine
Learning
Core
Abilitie
s
a brief introduction of myself
Computation Skills
1. Scripting in MATLAB, R, Python, UNIX, C.
2. Human Event-Related Potential (ERP) recording and analyses using Scan.
3. Source analysis and time-frequency analyses of EEG/MEG data using MNE toolbox and
Freesurfer.
4. EEG/MEG data analyses using fieldtrip toolbox
5. Conducting psychological experiments using Psychophysics Toolbox
6. Analyze/synthesize spoken sounds using Praat and STRAIGHT toolbox.
7. Machine Learning: GLM, SVM, & deep learning
8. Text Mining: LSA & word2vector
a brief introduction of myself
課程目標
• 將統計理論應用於資料分析。比如:
• 機率 >> 產生模擬數據
• 推論統計 >> 假設檢定 (Null Hypothesis
Significant test)
• 使用計算工具執行分析
• R & SPSS
• 不太可靠的大綱... (依據大家掌握 computing 的狀況
做調整)
• 機率 (隨機抽樣、中央極限定理)
• 描述統計 (類別量尺、連續量尺)
• 推論統計 (ttest, ANOVA, regression, chi-square)
• The number of analytics jobs available for R and SPSS
across time
• source: Muenchen @ http://r4stats.com/articles/popularity/
• The number of analytics jobs for the more popular
software (2/2014).
• source: Muenchen @ http://r4stats.com/articles/popularity/
Statistical computing 00
• 不太可靠的大綱之 bonus hours:
• basics of machine learning
• word to vector
A B
Count 15251 15251
Average 100 100
Standard Deviation 20 20
Median 100.35 100.92
10 Percentile 73.89 73.95
90 Percentile 125.61 124.72
Descriptive statistics for two synthetic data sets
Statistical computing 00
Statistical computing 00
Prediction of time reference rating
There is an early and automatic semantic stimulus analysis wh
Statistical computing 00
Statistical computing 00
Statistical computing 00
• Text Mining: word frequency
• http://tidytextmining.com/sentiment.html
• Text Mining: sentiment analysis
• http://tidytextmining.com/sentiment.html
• Pestian et al. (2011): Suicide Note Classification
Using Natural Language Processing: A Content
Analysis
• Data: Sixty-six notes were divided into two groups:
33 completers and 33 elicitors.
Statistical computing 00
Statistical computing 00
• 抓取首頁新聞,分為time,title,catagory,url儲存
• source: https://www.jerrynest.com/big-data-workshop-r-crawler/
library(rvest)
surl = "http://www.appledaily.com.tw/realtimenews/section/new/"
apple = read_html(surl,encoding="UTF-8")
apple %>% iconv(from = 'UTF-8', to = 'UTF-8')
rddt = apple %>% html_nodes('.rtddt')
time = rddt %>% html_nodes('time') %>% html_text()
title = rddt %>% html_nodes('h1') %>% html_text() %>% iconv(from = 'UTF-8', to = 'UTF-8')
category = rddt %>% html_nodes('h2') %>% html_text() %>% iconv(from = 'UTF-8', to = 'UTF-8')
domain = "http://www.appledaily.com.tw"
url = rddt %>% html_nodes('a') %>% html_attr('href')
url = paste0(domain, url)
news = data.frame(time=time, title=title, category=category, url=url)
news = data.frame(time=time, title=title, category=category, url=url)
R 統計軟體發展歷史
• R 統計軟體最初是由Ross Ihaka及Robert
Gentleman兩人以統計分析及繪圖為目的,
仿S語言的架構為基礎而發展出來的統計軟體
,可視為改進版本的S語言。大部分的S語言
程式碼可直接或稍做修改後就在R上面執行
• R屬於GNU計畫中的一個項目,目前是由 R
Development Core Team維護及發展
• 目前R最新的版本為3.1.1版(2014.07.10)
=
wizard
“R” 使用者就像巫師,他們使用統計學家研發的咒語,或者自行開發的指令。R使用者不用付
錢請統計學家工作,而且累積足夠的經驗之後,使用者會釋放無限的力量,改變統計分析的環
境 (就像鄧布利多那樣)。
R的特色及功能
• 有效的資料處理及存取能力
• 方便的矩陣操作與運算能力
• 簡單且發展完善的程式語言環境(S 語言)
– open source, 開放原始碼
• 活躍的咨詢社群
• 強迫使用者理解統計分析的步驟
•免費
R的缺點
• 圖形化界面較簡單 (相較於 SPSS, Excel…)
• 需要較長的學習時間
• 沒有公司/企業支援(不能客訴),使用者必須
自行克服問題(容易有挫折感)
• 常常在不知不覺中犯錯
– 要反覆檢查指令、輸出結果
• help 訊息幫助不大
Statistical computing 00
• R 的主要操作界面
• 兩種視窗:
– Document (scripts)
– Console
Statistical computing 00
最後,確認程式無誤
並且存入語法檔,將
來可以使用
• R程式IDE (Integrated development environment) 編
輯器: RStudio
• 回家作業:
• 安裝 R主程式 以及 Rstudio (Desktop Free version)
• 瀏覽一下 R 相關資源:
• R bloggers
• RPubs
• 吳漢銘教授的教學資源:
• http://www.hmwu.idv.tw/index.php/r-software
學習目標
• 初學者:
• 讀入外部資料,直接使用別人寫好的
packages/functions
• 讀入外部資料作資料處理/轉換/彙整
• 入門:
• 讀入外部資料,並作資料處理/轉換,再使用現有的
packages/functions 計算
• 修改他人所寫的packages/functions,以適用於自己的
資料分析任務
• 大師:
• 依照自己的特殊需求寫出全新的程式
如何使用計算工具?
• 和撰寫論文一樣:
– 研究動機與文獻探討
• 從R社群找過去的Q&A; 尋找可用的 package
– 方法
• 演算程序 (e.g., 公式、參數、ANOVA)
– 材料
• 讀取外部資料、自製模擬資料
– 程序
• 轉換資料、各種想像不到的細節…
– 結果與結論

More Related Content

PPTX
PDF
repeated-measure-ANOVA
PDF
Kirk' Experimental Design, Chapter 2
PDF
資料檢索
PDF
Kirk' Experimental Design, Chapter 5
PDF
語言議題
PDF
Kirk' Experimental Design, Chapter 3
PDF
Kirk' Experimental Design, Chapter 4
repeated-measure-ANOVA
Kirk' Experimental Design, Chapter 2
資料檢索
Kirk' Experimental Design, Chapter 5
語言議題
Kirk' Experimental Design, Chapter 3
Kirk' Experimental Design, Chapter 4

Similar to Statistical computing 00 (20)

PPTX
從統計到資料科學
PPTX
R 語言教學: 探索性資料分析與文字探勘初探
PDF
給軟體工程師的不廢話 R 語言精要班
PPTX
教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521
PPTX
Machine Learning Study Framework
PPTX
R intro 20140716-basic
PDF
手把手教你 R 語言分析實務
PDF
資料科學家未曾公開之資安研究事件簿
PDF
Introduction: Semantic web (20120521)
PDF
Practical data analysis in R: from data collection to data insight
PDF
Practical Data Analysis in R
PDF
[系列活動] 手把手教你R語言資料分析實務
PDF
Python introduction and data visualization publish
PPTX
資工人的學習成長之路
PDF
[DSC 2016] 系列活動:李祈均 / 人類行為大數據分析
PPTX
Ling2016.clliu
PDF
深入淺出 autocomplete
PDF
Nvivo10質性研究軟應用-三星統計陳群典顧問-20130727
PDF
Social network analysis
 
PDF
Python in word cloud
 
從統計到資料科學
R 語言教學: 探索性資料分析與文字探勘初探
給軟體工程師的不廢話 R 語言精要班
教材摘要版 -Big data-海量資料的資料採礦方法-三星課程網陳景祥顧問-20130521
Machine Learning Study Framework
R intro 20140716-basic
手把手教你 R 語言分析實務
資料科學家未曾公開之資安研究事件簿
Introduction: Semantic web (20120521)
Practical data analysis in R: from data collection to data insight
Practical Data Analysis in R
[系列活動] 手把手教你R語言資料分析實務
Python introduction and data visualization publish
資工人的學習成長之路
[DSC 2016] 系列活動:李祈均 / 人類行為大數據分析
Ling2016.clliu
深入淺出 autocomplete
Nvivo10質性研究軟應用-三星統計陳群典顧問-20130727
Social network analysis
 
Python in word cloud
 
Ad

More from Kevin Chun-Hsien Hsu (14)

PDF
[1062BPY12001] Data analysis with R / April 26
PDF
[1062BPY12001] Data analysis with R / April 19
PDF
[1062BPY12001] Data analysis with R / week 4
PDF
[1062BPY12001] Data analysis with R / week 3
PDF
[1062BPY12001] Data analysis with R / week 2
PPTX
Regression 0410
PDF
Statistical computing 03
PDF
Statistical computing 01
PPTX
Multiple regression
PPTX
Model III ANOVA & Simple Main Effects
PPTX
Essentials of EEG/MEG
PPTX
PDF
Kirk' Experimental Design, Chapter 1
PPTX
R intro 20140716-advance
[1062BPY12001] Data analysis with R / April 26
[1062BPY12001] Data analysis with R / April 19
[1062BPY12001] Data analysis with R / week 4
[1062BPY12001] Data analysis with R / week 3
[1062BPY12001] Data analysis with R / week 2
Regression 0410
Statistical computing 03
Statistical computing 01
Multiple regression
Model III ANOVA & Simple Main Effects
Essentials of EEG/MEG
Kirk' Experimental Design, Chapter 1
R intro 20140716-advance
Ad

Statistical computing 00

Editor's Notes

  • #15: an early, automatic semantic stimulus analysis, which might be related to the high relevance of ‘time reference’ to everyday decision-making and preference formation