Categorical Data Analysis (For this handout, the tables and figures used are from introduction to Categorical Data Analysis, 1 st and 2 nd eds, 1996 a

Similar documents
untitled

(Microsoft PowerPoint - 25\272\330\262\316\255p\244\350\252k\257\265\247\3361_Ruth.ppt)

untitled

)

Microsoft Word - p11.doc

<4D F736F F D20A4BDA640BDC3A5CDAED6A4DFBDD2B57BB0F2A5BBAFE0A44FB4FAC5E72DAC79A6E6AF66BEC7B8D5C344A4BDA FA7B9BD5AAAA9>

第 一 节 科 研 设 计 的 主 要 内 容 确 定 研 究 对 象 设 对 照 组 随 机 分 组 确 定 观 察 指 标 2

% % 34

歯WP02-12-부속물.PDF

<4D F736F F D B14DA7DEB0AAA6D2AAC0A475AE76312DAAC0B77CA475A740ACE3A873A4E8AA6B>

UDC Empirical Researches on Pricing of Corporate Bonds with Macro Factors 厦门大学博硕士论文摘要库

1 ABSTRACT

: 29 : n ( ),,. T, T +,. y ij i =, 2,, n, j =, 2,, T, y ij y ij = β + jβ 2 + α i + ɛ ij i =, 2,, n, j =, 2,, T, (.) β, β 2,. jβ 2,. β, β 2, α i i, ɛ i

(baking powder) 1 ( ) ( ) 1 10g g (two level design, D-optimal) 32 1/2 fraction Two Level Fractional Factorial Design D-Optimal D

( ) t ( ) ( ) ( ) ( ) ( ) t-

Microsoft Word - Probability.doc

% GIS / / Fig. 1 Characteristics of flood disaster variation in suburbs of Shang

1

(D) 比 例 (Ratio) 6. 狂 犬 病 病 毒 是 引 起 狂 犬 病 的 : (A) 充 分 且 必 要 條 件 (B) 充 分 條 件 (C) 必 要 條 件 (D) 以 上 皆 非 7. 某 研 究 指 出, 在 100 位 憂 鬱 症 患 者 中, 血 型 為 O 型 佔 50%,

( 413 1), (2003) ,,,,

國家圖書館典藏電子全文

國家圖書館典藏電子全文

Microsoft PowerPoint - ch1_2.ppt

國立屏東教育大學碩士班研究生共同修業要點

山东2014第四季新教材《会计基础》冲刺卷第三套

A. B. C. D. 2. A. B. C. D. 3. A. 4 N B. 18 N C. 40 N D N 1

32 醫 學 新 知 (I) (adjusted hazard ratio: 0.35; 95% confidence interval: 0.18 to 0.70; p = 0.003)

[9] R Ã : (1) x 0 R A(x 0 ) = 1; (2) α [0 1] Ã α = {x A(x) α} = [A α A α ]. A(x) Ã. R R. Ã 1 m x m α x m α > 0; α A(x) = 1 x m m x m +

: ( ),,

九十六學年度第一學期第三次定期考國文科試題

2007年普通高等学校招生全国统一考试


PowerPoint Presentation

就 构 成 了 盗 窃 罪 与 破 坏 交 通 设 施 罪 的 想 象 竞 合, 按 照 其 中 处 罚 较 重 的 犯 罪 处 罚 5. 答 案 :B 本 题 主 要 考 察 如 何 区 分 收 买 被 拐 卖 的 妇 女 儿 童 罪 与 拐 卖 妇 女 儿 童 罪 的 共 犯 问 题 ( 对 向

untitled

考 查 知 识 点 肝 气 疏 泄 调 畅 气 机 的 作 用, 主 要 表 现 在 以 下 几 个 方 面 :(1) 促 进 血 液 与 津 液 的 运 行 输 布 ;(2) 促 进 脾 胃 的 运 化 功 能 和 胆 汁 分 泌 排 泄 ;(3) 调 畅 情 志 ;(4) 促 进 男 子 排 精

To Construct a Forecasting Model of Unscheduled Emergency Department Revist within72 Hours Student: Fei-Chen LAI Advisor: Prof. Chin-Yin Huang Departm

《米开朗琪罗传》

untitled

Microsoft Word - ZLI14A0-105

天 主 教 輔 仁 大 學 社 會 學 系 學 士 論 文 小 別 勝 新 婚? 久 別 要 離 婚? 影 響 遠 距 家 庭 婚 姻 感 情 因 素 之 探 討 Separate marital relations are getting better or getting worse? -Exp

153

When the rejection rule for a test at every level α can be re-written as then xxx is the p-value of the test. xxx < α, If p-value < α, then the test c

Stochastic Processes (XI) Hanjun Zhang School of Mathematics and Computational Science, Xiangtan University 508 YiFu Lou talk 06/

Microsoft Word - ch 01+

Vol. 15 No. 1 JOURNAL OF HARBIN UNIVERSITY OF SCIENCE AND TECHNOLOGY Feb O21 A

Chinese Journal of Applied Probability and Statistics Vol.25 No.4 Aug (,, ;,, ) (,, ) 应用概率统计 版权所有, Zhang (2002). λ q(t)

TI 3 TI TABLE 4 RANDBIN Research of Modern Basic Education

C19 (1)

第一章合成.ppt

Li An

第二部分 企业持续经营风险恶化影响因素分析与风险恶化预测研究

3 : 121,, [1 ] (Stage Theory),,,,,,, 1 :, ;,,,,, 1 :11, 6,116 ; , 2003 ; 31 = Π ; 2, 1996 ;1996,,2000, Walt Rostow (1960, 1971), A. F. K. Organ

Myers Majluf 1984 Lu Putnam R&D R&D R&D R&D

( ) ( ) ( NSC M )

(156) / Spurious Regression Unit Root Test Cointergration TestVector Error Correction Model Granger / /

Microsoft Word - A doc

< > by /10() 8/11() 1 vs. 2 Z () t 3 Z- t- () 4 () () () 3

(C) 比 得 上 (D) 如 果 17. ( ) 聖 賢 經 傳 和 傳 奇 小 說 兩 個 傳 字, 其 音 義 關 係 為 何? (A) 音 同 義 異 (B) 音 義 皆 同 (C) 義 同 音 異 (D) 音 義 皆 異 18. ( ) 下 列 選 項 中 的 形 似 字, 何 者 讀 音

: 459,. (2011),, Zhu (2008). Y = Xθ + ε, (1.1) Y = (y 1,..., y n ) T, ε = (ε 1,..., ε n ) T, θ = (θ 1,..., θ p ) T, X n p, X i X i, E(ε) = 0, Var (ε)

Microsoft Word 谢雯雯.doc

北京2014年会计从业资格考试《会计基础》备考机试卷一

θ 1 = φ n -n 2 2 n AR n φ i = 0 1 = a t - θ θ m a t-m 3 3 m MA m 1. 2 ρ k = R k /R 0 5 Akaike ρ k 1 AIC = n ln δ 2

30 ml polystyrene 4 mm ph 0.1 mg blender M -cm D. pulex D. magna 20 L 2 20

Microsoft PowerPoint - NCBA_Cattlemens_College_Darrh_B

1970 Roulac (1996) (shock) (structure change) Barras and Ferguson (1985) Barras (1994) (1990) (1996) (1997) 1

11第十一章階層線性模式.DOC

~ 10 2 P Y i t = my i t W Y i t 1000 PY i t Y t i W Y i t t i m Y i t t i 15 ~ 49 1 Y Y Y 15 ~ j j t j t = j P i t i = 15 P n i t n Y

Microsoft Word - 24-BF03.doc

天 主 教 輔 仁 大 學 社 會 學 系 學 士 論 文 百 善 孝 為 先? 奉 養 父 母 與 接 受 子 女 奉 養 之 態 度 及 影 響 因 素 : 跨 時 趨 勢 分 析 Changes in attitude toward adult children's responsibilit

Microsoft PowerPoint - CH 04 Techniques of Circuit Analysis

Corporate Social Responsibility CSR CSR CSR 1 2 ~ CSR 6 CSR 7 CSR 8 CSR 9 10 ~ CSR 14 CSR CSR 2013 A A 23.

THE APPLICATION OF ISOTOPE RATIO ANALYSIS BY INDUCTIVELY COUPLED PLASMA MASS SPECTROMETER A Dissertation Presented By Chaoyong YANG Supervisor: Prof.D

$$% % $ (%) % %$ $ ( *+,)(-)-./0-1//0- %) %) % - $%2)33%0 $ % ((3./. 3/3 )3 / % (()33(1 % (()3(/ %89856%:;< % (()3 0()0 3 (. <<=330(<</ 3 3. ()

102_BS

11-3-Cover-1

Vocabulary Development in Armenian Children Attending Armenian-English Bilingual Preschools

untitled

大數據天文學 — 時間序列分析 .2cmMichael Ting-Chang Yang 楊庭彰

Microsoft Word - S28 匯訊 _F4_.doc

% 5 CPI CPI PPI Benjamin et al Taylor 1993 Cukierman and Gerlach 2003 Ikeda 2013 Jonas and Mishkin

Microsoft Word - A doc

zt

Microsoft PowerPoint - ATF2015.ppt [相容模式]

Microsoft Word 任 辉_new_.doc

( CIP. :, / ISBN D CIP ( ( 010) ( ) ( 010) / ( ) ( 010) 884

bingdian001.com

% 30% 1% U Zhou &Ruland 2006 Liu Jesen

Z-I A b Z-I A b Z Z-I A A b Z-I Miller [5] Z i I i Z-I [6] Z-I Z-I Z-I Z-I Z I Wilson [7] 1970 [8] [9] 20.32% Sasaki [10] Nino- miya [11] [12]

統計課程目錄95

Microsoft PowerPoint - spss2-1.ppt

第五章 實驗面面觀


d y d = d 2 y d 2 = > 0 Figure45 :Price consumer curve not a Giffen good X & Y are substitutes From the demand curves. Figure46 Deman

ii

2011-论文选集-2.cdr

202,., IEC1123 (1991), GB8051 (2002) [4, 5],., IEC1123,, : 1) IEC1123 N t ( ). P 0 = , P 1 = , (α, β) = (0.05, 0.05), N t = [4]. [6

1362 A Research on the Performance of Probability Concepts on Sixth-Grade Students Hsin-Chien Tsai Chi-Tsuen Yeh National University of Tainan Abstrac

(),,,,;, , (Π, ), , , 5162 %, U , ,,1992, , : ;

Analysis of Cultural Elements of Meinong s Paper Umbrella Painting Abstract Meinong paper umbrellas are a traditional industrial art for the Hakka peo

Transcription:

類別資料分析 (Categorical Data Analysis) Instructor: 蔣國司 (Kuo-Szu Chiang), Ph.D. kucst@dragon.nchu.edu.tw Phone: 22840777 ext 301 or 305 Time: Monday at 9: AM to noon Place: 2F Computer Room of Crop Science Building Text Book: An Introduction to Categorical Data Analysis, 2 ed. Alan Agresti, Wiley Series, 2007. Reference book: Categorical Data Analysis, 2 ed. Alan Agresti, Wiley Series, 2002. Contents: Introduction Contingency tables Generalized linear model Logistic regression Loglinear model And the other topics if time permitted Grade: Homework and Project (40%), Midterm (30%), Final (30%). 1

Categorical Data Analysis (For this handout, the tables and figures used are from introduction to Categorical Data Analysis, 1 st and 2 nd eds, 1996 and 2007, Allan Agresti, Wiley Series) Preliminary knowledge of Categorical Data Analysis (1) Two-sample Test for Binomial Proportions (Normal-Theory Test) H : p p H : p p 0 1 2 0 1 2 => 1 2 Z p p x x p1 n n 1 1 pq n 1 n 2 q1 p Indep. samples The samples will be assumed large enough So that the normal approx. to the binomial dist. is valid. 1 2 1 2 (2) Contingency-Table Method o 11 o 12 o 21 o 22 1 Test whether or not the proportions are the same in the two indep. Samples. 2 Test for the indep. of two characteristics. o e 2 e 2 2 ~ ( r 1)( c 1) if no expected value in the table is less than 5. Some Corrected? (e.g. Yates) (3) If the prob. of a success = p p then the odds in favor of success = 1 p let p1, p2 be the prob. of success for two populations. The odds ratio (OR) 2

p1 q pq OR p pq pq 1 1 2 1 2 estimated by OR 2 2 1 pq 2 1 q2 yes disease no exposure yes a b a+b no c d c+d a+c b+d Estimation of the Risk Ratio for case control studies ad RR OR bc a d a b c d ad OR c b bc c d a b point interval Estimation for the odds ratio (4) Fisher s Exact Test exist.) (for the standard chi-square test is not applicable, because small expected values (5) R C Contingency Tables Trend (6) Mantel-Haenszel Test To assess the association between a dichotomous disease and dichotomous exposure variable after controlling for one or more confounding variable. (7) McNemar s test two-sample Test for Binomial Proportions for Method-Pair Data 3

Chapter 1 Introduction 類別資料的兩個主要的機率分布 : 二項分布和卜瓦松分布 1.1 Categorical response data count data not measure data response variable not explanatory variable two primary types of measurement scales:ordinal variables( 有次序分別 ) and nominal variables( 無大小次序分別 ). ordinal 的分析方法不能用在 nominal, 但 nominal 的分析方法可用在 ordinal 和 nominal 1.2 Sampling models Poisson sampling 類別資料中有一種重要的抽樣模型是把每一個類別的次數當成是獨立的卜 瓦松觀測值, 這中抽樣叫做卜瓦松抽樣, 卜瓦松分布有一個特性是變異數會隨著 平均值上升, 實際上次數觀測值的變異數常常超過平均數, 這種現象叫做過度離 勢 (overdispersion) Binomial sampling Define: N 次獨立且相同的試驗, 每次試驗的結果不是成功就是失敗 當二項分布和卜瓦松分布的平均數變大時, 會更接近鐘型並趨近常態分布 1.3 Inference for a proportion MLE: 讓觀測資料出現機率最大的參數值 估計量 (estimator): 在我們看資料之前, 估計值是未知的, 他是一個抽樣分布 的變量, 我們稱這個變量為估計量 信賴區間的優點在於比點估計多了不確定性 4

資料類型 ( 離散型 ) 1. 二項分佈 (e.g. 發芽率 ) 2. 社會科學 (e.g. 助教課是否有助於學生成績提升 ) 3. o e 2 2 2 ~ ( r 1)( c 1) ( 大樣本底下適用 (n 5)) e 2x2 table (Contingency-Table) o 11 o 12 o 21 o 22 Fisher exact test ( 小樣本適用 ) (1)case contral;(2)cohort study 4. 種子是否帶毒 (group testing) 5. 診斷是否有病 ( 貝氏的計算 ) (1) 敏感度 : 有病檢測出有病 ;(2) 特異度 : 沒病檢測出沒病兩者具有 拮抗作用, 無法同時提高 Generalized Linear Model Y = B 0 + B 1 X 1 + B 2 X 2 + + B k X k +ε If ε~bin(n,p) as y coding 0 or coding 1 π=prob(y=1) ln ( π 1 π ) 將該轉換稱為 logit transformation 其中 ( π 1 π ) 則稱為勝算 (odds) 因為使用 logit transformation, 所以稱之為 logistic regression 5

CH 1. Introduction Probability dist. 1. Binomial dist. 2. Multinomial dist. Continuous data => quantitative data Categorical data => qualitative data Categorical data : 1. nominal data ex: 政黨 性別 ( 不可以用 ordinal data 的方法 ) 2. ordinal data ex: 汽車品牌水準 ( 有次序性, 可以用 nominal data 的方法, 但是會 lose information) 何謂參數? 用來描述或形容族群, 是未知固定的 parameter 的估計 :M.L.E. y 0 1 x y: 反應 (dependent) 變數 x: 解釋 (independent) 變數 在 categorical data 中, 有時無法分辨反應或解釋變數 ex: two-way ANOVA Binomial dist. 的假設 :1. 每次試驗彼此獨立 2. p 是固定的 =>i.i.d 6

統計估計的兩大學派 : 1. Frequentist approach - 參數是固定未知的 2. Bayesian approach -prior dist. and posterior dist. x ; f x f p x x f x f x p x Why 常使用 M.L.E.?1. 不偏 2. Var 最小 下圖如何畫出? 如何求得 M.L.E.? 令 1 次微分 = 0,2 次微分 < 0 點估計沒有將樣本數的 information 考慮進去, 所以區間估計較好 x t Z S. Ex pˆ Z S. Epˆ Meta analysis: 牽扯到不同研究所做的合併 Multinomial dist.: Binomial dist. 的擴充 7

法一 : Wald C.I. for Bin. Proportion => p Z S.E α 2, S.E p 1-p n E.X:Survey results on legalizing abortion 400 p 0. 893 Yes 400 448 C.I. 0.448 1.96 0. 448 1-0. 448 893 0. 415, 0. 481 p 用這個公式 ( 1 -p p Z S.E, S.E ) 的限制 : (1)p 接近 0.5 (2) 或是 n 很大 因此當 p 接近 0 or 1 時並不適用法二 : Score E.X:p = 0.90 : 0.596 α 2 H0 0 n By Eq.13 0. 9 01. 0. 9 196. 0. 714, 86. 上界超出 1 π p-π 0 0 1-π 0 n 196. 0.9-0.596 Z 1.96, Z 0.596 0.404 0.9-0.982 0.982 0.018 1.96 法三 : paper(1998) 9 2 0. 786 0. 214 p = 0. 786 S.E 4 14 C.I. for 95% is(0.57,1) 8

Probabilit y theory Measurement theory 統計理論 Math. Stat. Estimation Inference Wald, Score, and Likelihood-Ratio Wald : Score : Likelihood-Ratio : 0.9-0.5 0.9 0.1 0.9-0.5 0. 5 P 0.001 P 0.011-2 ln 7. 36 P 0. 007 0.5 0.5 0. 9 Wald 是 3 種方法中最不適合小樣本的,Wald 須在大樣本下才有較 好的結果 Small sample Binomial inference 若要使用 Z score 檢定最好是在 np 5的情況下 p-value 在離散型的分布上都會大一點 E.X: Py p-value 1. 0000. 001 0. 9990. 01 0. 00. 001 0. 59 0. 5 mid p-value P 9 E.X: P 0. 006 2 9

大樣本的估計方法 :(1)wald test (2)likelihood ratio test (3)scroe test Wald test: 唯一好處就是方便計算 p = x n var(p ) = var ( x n ) = np(1 p) n 2 = p(1 p) n p ± 1.96 p (1 p ) n Likelihook function L(X 1, X 2,, X n ; θ) = f(x 1 )f(x 2 ) f(x n ) e.g. ( n x )px (1 p) n x if n=1, p x (1 p) 1 x, p n i=1 x i(1 p) n n i=1 x i 補充 : 兩層的 Binormal( 實際上就是 group testing) P group = 1 (1 P individual ) k, k:group size 台灣使用 group testing : 蘭花種子檢測 種苗廠 (potato) 農友會 估計 group testing 的 P value =? group testing { 分類 group 裡頭是否帶毒 估計 P individual 時會有偏差 (bias) 如何去分配 group? 估計完後, 檢測是否帶毒 dilutior effect 稀釋效應 ( 類似 group testing ) 差別在建立於不同分配 { group teating binormal dilutior effect poission