一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM

Size: px
Start display at page:

Download "一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM"

Transcription

1 .. ( ) (2) GLMM kubo@ees.hokudai.ac.jp I : :29 kubostat2013ou2 ( ( ) (2) / 74

2 I.1 N k.2 binomial distribution logit link function.3.4! offset.5 GLM!.6.7 kubostat2013ou2 ( ( ) (2) / 74

3 II.8 r i.9 GLMM (A) f i =C (B) f i =T yi x i x i kubostat2013ou2 ( ( ) (2) / 74

4 6 7 : : kubostat2013ou2 ( ( ) (2) / 74

5 kubostat2013ou2 ( ( ) (2) / 74

6 ? (GLM) (Poisson regression) (logistic regression) (linear regression) kubostat2013ou2 ( ( ) (2) / 74

7 (GLM)??? kubostat2013ou2 ( ( ) (2) / 74

8 GLM : : e.g., β 1 + β 2 x i : kubostat2013ou2 ( ( ) (2) / 74

9 GLM logistic : : e.g., β 1 + β 2 x i : logit yi x i kubostat2013ou2 ( ( ) (2) / 74

10 N k 1. N k y i {0, 1, 2,, 8} kubostat2013ou2 ( ( ) (2) / 74

11 N k? 8 y! f i C: T: i N i = 8 y i = 3 (alive) (dead) x i kubostat2013ou2 ( ( ) (2) / 74

12 N k data4a.csv CSV (comma separated value) format file R : > d <- read.csv("data4a.csv") or > d <- read.csv( + " d data frame ( ) kubostat2013ou2 ( ( ) (2) / 74

13 N k data frame d > summary(d) N y x f Min. :8 Min. :0.00 Min. : C:50 1st Qu.:8 1st Qu.:3.00 1st Qu.: T:50 Median :8 Median :6.00 Median : Mean :8 Mean :5.08 Mean : rd Qu.:8 3rd Qu.:8.00 3rd Qu.: Max. :8 Max. :8.00 Max. : kubostat2013ou2 ( ( ) (2) / 74

14 N k > plot(d$x, d$y, pch = c(21, 19)[d$f]) > legend("topleft", legend = c("c", "T"), pch = c(21, 19)) yi C T x i? kubostat2013ou2 ( ( ) (2) / 74

15 binomial distribution logit link function 2. binomial distribution logit link function kubostat2013ou2 ( ( ) (2) / 74

16 binomial distribution logit link function : N y ( N y p(y N, q) = ( ) N q y (1 q) N y y ) N y p(y i 8, q) q = 0.1 q = 0.8 q = y i kubostat2013ou2 ( ( ) (2) / 74

17 binomial distribution logit link function (z i : e.g. z i = β 1 + β 2 x i ) 1 q i = logistic(z i ) = 1 + exp( z i ) > logistic <- function(z) 1 / (1 + exp(-z)) # > z <- seq(-6, 6, 0.1) > plot(z, logistic(z), type = "l") q q = z 1 1+exp( z) kubostat2013ou2 ( ( ) (2) / 74

18 binomial distribution logit link function {β 1, β 2 } = {0, 2} (A) β 2 = 2 β 1 (B) β 1 = 0 β 2 q (A) β 2 = 2 β 1 = 2 β 1 = x β 1 = (B) β 1 = 0 β 2 = 4 β 2 = x β 2 = 1 {β 1, β 2 } x q 0 q 1 kubostat2013ou2 ( ( ) (2) / 74

19 binomial distribution logit link function logit link function logistic 1 q = 1 + exp( (β 1 + β 2 x)) = logistic(β 1 + β 2 x) logit logit(q) = log q 1 q = β 1 + β 2 x logit logistic logistic logit logit is the inverse function of logistic function, vice versa kubostat2013ou2 ( ( ) (2) / 74

20 binomial distribution logit link function R β 1 β 2 (A) f i =C (B) y x x > glm(cbind(y, N - y) ~ x + f, data = d, family = binomial)... Coefficients: (Intercept) x ft kubostat2013ou2 ( ( ) (2) / 74

21 binomial distribution logit link function : (A) f i =C (B) f i =T yi x i x i kubostat2013ou2 ( ( ) (2) / 74

22 3. kubostat2013ou2 ( ( ) (2) / 74

23 ? logit(q) = log q 1 q = β 1 + β 2 x + β 3 f + β 4 xf... in case that β 4 < 0, sometimes it predicts... y T C x kubostat2013ou2 ( ( ) (2) / 74

24 glm(y ~ x + f,...) glm(y ~ x + f + x:f,...) (A) (B) y T C T C x x kubostat2013ou2 ( ( ) (2) / 74

25 ! offset 4.! offset kubostat2013ou2 ( ( ) (2) / 74

26 ! offset? / : ? ( ) kubostat2013ou2 ( ( ) (2) / 74

27 ! offset : N k : : specific leaf area (SLA) : offset! kubostat2013ou2 ( ( ) (2) / 74

28 ! offset kubostat2013ou2 ( ( ) (2) / 74

29 ! offset offset : x {0.1, 0.2,, 1.0} 10 glm(..., family = poisson) kubostat2013ou2 ( ( ) (2) / 74

30 ! offset?! x A = /! glm() offset kubostat2013ou2 ( ( ) (2) / 74

31 ! offset R data.frame: Area, x, y > load("d2.rdata") > head(d, 8) # 8 Area x y kubostat2013ou2 ( ( ) (2) / 74

32 ! offset vs > plot(d$x, d$y / d$area) d$y/d$area d$x kubostat2013ou2 ( ( ) (2) / 74

33 ! offset A vs y > plot(d$area, d$y) d$y d$area A y kubostat2013ou2 ( ( ) (2) / 74

34 ! offset x ( ) > plot(d$area, d$y, cex = d$x * 2) d$y d$area? kubostat2013ou2 ( ( ) (2) / 74

35 ! offset x y x kubostat2013ou2 ( ( ) (2) / 74

36 ! offset = 1. i y i λ i : y i Pois(λ i ) 2. λ i A i x i λ i = A i exp(β 1 + β 2 x i ) λ i = exp(β 1 + β 2 x i + log(a i )) log(λ i ) = β 1 + β 2 x i + log(a i ) log(a i ) offset ( β ) kubostat2013ou2 ( ( ) (2) / 74

37 ! offset GLM! family: poisson, link : "log" : y ~ x offset : log(area) z = β 1 + β 2 x + log(area) a, b λ log(λ) = z λ = exp(z) = exp(β 1 + β 2 x + log(area)) λ : kubostat2013ou2 ( ( ) (2) / 74

38 ! offset glm() kubostat2013ou2 ( ( ) (2) / 74

39 ! offset R glm() > fit <- glm(y ~ x, family = poisson(link = "log"), data = d, offset = log(area)) > print(summary(fit)) Call: glm(formula = y ~ x, family = poisson(link = "log"), data = d, offset = log(area)) (......) Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) x e-06 kubostat2013ou2 ( ( ) (2) / 74

40 ! offset d$y x = 0.9 light environment x = 0.1 dark environment d$area glm() kubostat2013ou2 ( ( ) (2) / 74

41 ! offset : glm() offset offset = exp( ) d$y d$area kubostat2013ou2 ( ( ) (2) / 74

42 ! offset : N k : : specific leaf area (SLA) : offset! kubostat2013ou2 ( ( ) (2) / 74

43 GLM! 5. GLM! (overdispersion)? kubostat2013ou2 ( ( ) (2) / 74

44 GLM! :?! (A) i N i = 8 (B) 100 x i y i y i = 3 x i {2, 3, 4, 5, 6} yi x i kubostat2013ou2 ( ( ) (2) / 74

45 GLM! N y? number of alive seeds y i : : β 1 + β 2 x i : logit number of leaves x i kubostat2013ou2 ( ( ) (2) / 74

46 GLM! GLM! yi (A) β 2 (B)! x i = 4 y i x i y i kubostat2013ou2 ( ( ) (2) / 74

47 6.? kubostat2013ou2 ( ( ) (2) / 74

48 (overdispersion)? (A) Not or less overdispersed (B) Overdispersed!! y i y i kubostat2013ou2 ( ( ) (2) /

49 GLM GLM does not take into account individual differences kubostat2013ou2 ( ( ) (2) / 74

50 Almost all real data are overdispersed! kubostat2013ou2 ( ( ) (2) / 74

51 7. kubostat2013ou2 ( ( ) (2) / 74

52 number of alive seeds y i : : β 1 + β 2 x i + r i : logit number of leaves x i kubostat2013ou2 ( ( ) (2) / 74

53 i r i qi r i > 0 r i = 0 r i < x i kubostat2013ou2 ( ( ) (2) / 74

54 {r i } s = 1.0 s = r i s = 3.0 p(r i s) = 1 2πs 2 exp ( r2 i 2s 2 p(r i s) r i r i r i kubostat2013ou2 ( ( ) (2) / 74 )

55 r i (A) (B) p(r i s) s = {r i } s = 3.0 I III I II I I r i II I II I II I I I III I II I I I I I r i 1 q i = 1+exp( r i ) y i p(y i q i ) y i kubostat2013ou2 ( ( ) (2) / 74

56 > # defining logistic function > logistic <- function(z) { 1 / (1 + exp(-z)) } > # random numbers following binomial distribution > rbinom(100, 8, prob = logistic(0)) > # random numbers following Gausssian distribution > rnorm(100, mu = 0, sd = 0.5) > r <- rnorm(100, mu = 0, sd = 0.5) > # random numbers following...? > rbinom(100, 8, prob = logistic(0 + r)) kubostat2013ou2 ( ( ) (2) / 74

57 Generalized Linear Mixed Model (GLMM) Mixed : β 1 + β 2 x i + r i fixed effects: β 1 + β 2 x i random effects: +r i fixed? random?? kubostat2013ou2 ( ( ) (2) / 74

58 : fixed effects random effects kubostat2013ou2 ( ( ) (2) / 74

59 : (linear mixed model, LMM) random effects : : kubostat2013ou2 ( ( ) (2) / 74

60 global parameter, local parameter? Generalized Linear Mixed Model (GLMM) : β 1 + β 2 x i + r i fixed effects: β 1 + β 2 x i global parameter s global parameter random effects: +r i local parameter i ( ) global/local parameter kubostat2013ou2 ( ( ) (2) / 74

61 全データ 個体個体 3 3 のデータのデータ個体 1 のデータ個体個体 3 3 のデータのデータ個体 2 のデータ {r 1, r 2, r 3,..., r 100 } β 1 β 2 local parameter global parameter? kubostat2013ou2 ( ( ) (2) / 74 s

62 r i 8. r i kubostat2013ou2 ( ( ) (2) / 74

63 r i r i local parameters: {r 1, r 2,, r 100 } 100 r i > d <- read.csv("data.csv") > head(d) N y x id kubostat2013ou2 ( ( ) (2) / 74

64 r i r i y i ( ) 8 p(y i β 1, β 2 ) = q yi i (1 q i) 8 y i r i i r i L i = p(r i s) = β 1, β 2, s y i ) 1 ( exp r2 i 2πs 2 2s 2 p(y i β 1, β 2, r i ) p(r i s)dr i L(β 1, β 2, s) = i L i kubostat2013ou2 ( ( ) (2) / 74

65 r i global parameter local parameter Generalized Linear Mixed Model (GLMM) Mixed : β 1 + β 2 x i + r i global parameter fixed effects: β 1, β 2 : s local parameter random effects: {r 1, r 2,, r 100 } kubostat2013ou2 ( ( ) (2) / 74

66 r i r i kubostat2013ou2 ( ( ) (2) / 74

67 r i r r = 2.20 q = 0.10 y r = 0.60 q = 0.35 y r = 1.00 q = 0.73 y r = 2.60 q = 0.93 y r p(r s) p(r) = 0.10 r p(r) = 0.13 r p(r) = 0.13 r p(r) = 0.09 r y kubostat2013ou2 ( ( ) (2) / 74

68 r i r r = 1.10 λ = 0.55 y r = 0.30 λ = 1.22 y r = 0.50 λ = 2.72 y r = 1.30 λ = 6.05 y r p(r s) p(r) = 0.22 r p(r) = 0.38 r p(r) = 0.35 r p(r) = 0.17 r y kubostat2013ou2 ( ( ) (2) / 74

69 r i glmmml package GLMM > install.packages("glmmml") # if you don t have glmmml > library(glmmml) > glmmml(cbind(y, N - y) ~ x, data = d, family = binomial, + cluster = id) > d <- read.csv("data.csv") > head(d) N y x id kubostat2013ou2 ( ( ) (2) / 74

70 r i GLMM : ˆβ1, ˆβ 2, ŝ > glmmml(cbind(y, N - y) ~ x, data = d, family = binomial, + cluster = id)...(snip)... coef se(coef) z Pr(> z ) (Intercept) e-06 x e-06 Scale parameter in mixing distribution: 2.49 gaussian Std. Error: Residual deviance: 264 on 97 degrees of freedom AIC: 270 ˆβ 1 = 4.13, ˆβ 2 = 0.99, ŝ = 2.49 kubostat2013ou2 ( ( ) (2) / 74

71 r i GLMM (A) (B) x = 4 yi x i y kubostat2013ou2 ( ( ) (2) / 74

72 GLMM 9. GLMM kubostat2013ou2 ( ( ) (2) / 74

73 GLMM + GLMM I (A) pot A pot A pot B pot B (B) logitq i = β 1 + β 2 x i (GLM) q i : logitq i = β 1 + β 2 x i + r i (A) (B) kubostat2013ou2 ( ( ) (2) / 74

74 GLMM + GLMM II (C) pot A pot B logitq i = β 1 + β 2 x i + r j (D) pot A pot B logitq i = β 1 + β 2 x i + r i + r j kubostat2013ou2 ( ( ) (2) / 74

75 GLMM GLMM random effects global parameter local parameter GLMM global parameter local parameter local parameter (e.g. + ) kubostat2013ou2 ( ( ) (2) / 74

kubostat2015e p.2 how to specify Poisson regression model, a GLM GLM how to specify model, a GLM GLM logistic probability distribution Poisson distrib

kubostat2015e p.2 how to specify Poisson regression model, a GLM GLM how to specify model, a GLM GLM logistic probability distribution Poisson distrib kubostat2015e p.1 I 2015 (e) GLM kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2015 07 22 2015 07 21 16:26 kubostat2015e (http://goo.gl/76c4i) 2015 (e) 2015 07 22 1 / 42 1 N k 2 binomial distribution logit

More information

kubostat2017e p.1 I 2017 (e) GLM logistic regression : : :02 1 N y count data or

kubostat2017e p.1 I 2017 (e) GLM logistic regression : : :02 1 N y count data or kubostat207e p. I 207 (e) GLM kubo@ees.hokudai.ac.jp https://goo.gl/z9ycjy 207 4 207 6:02 N y 2 binomial distribution logit link function 3 4! offset kubostat207e (https://goo.gl/z9ycjy) 207 (e) 207 4

More information

kubostat7f p GLM! logistic regression as usual? N? GLM GLM doesn t work! GLM!! probabilit distribution binomial distribution : : β + β x i link functi

kubostat7f p GLM! logistic regression as usual? N? GLM GLM doesn t work! GLM!! probabilit distribution binomial distribution : : β + β x i link functi kubostat7f p statistaical models appeared in the class 7 (f) kubo@eeshokudaiacjp https://googl/z9cjy 7 : 7 : The development of linear models Hierarchical Baesian Model Be more flexible Generalized Linear

More information

講義のーと : データ解析のための統計モデリング. 第3回

講義のーと :  データ解析のための統計モデリング. 第3回 Title 講義のーと : データ解析のための統計モデリング Author(s) 久保, 拓弥 Issue Date 2008 Doc URL http://hdl.handle.net/2115/49477 Type learningobject Note この講義資料は, 著者のホームページ http://hosho.ees.hokudai.ac.jp/~kub ードできます Note(URL)http://hosho.ees.hokudai.ac.jp/~kubo/ce/EesLecture20

More information

kubostat2017c p (c) Poisson regression, a generalized linear model (GLM) : :

kubostat2017c p (c) Poisson regression, a generalized linear model (GLM) : : kubostat2017c p.1 2017 (c), a generalized linear model (GLM) : kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2017 11 14 : 2017 11 07 15:43 kubostat2017c (http://goo.gl/76c4i) 2017 (c) 2017 11 14 1 / 47 agenda

More information

k2 ( :35 ) ( k2) (GLM) web web 1 :

k2 ( :35 ) ( k2) (GLM) web   web   1 : 2012 11 01 k2 (2012-10-26 16:35 ) 1 6 2 (2012 11 01 k2) (GLM) kubo@ees.hokudai.ac.jp web http://goo.gl/wijx2 web http://goo.gl/ufq2 1 : 2 2 4 3 7 4 9 5 : 11 5.1................... 13 6 14 6.1......................

More information

60 (W30)? 1. ( ) 2. ( ) web site URL ( :41 ) 1/ 77

60 (W30)? 1. ( ) 2. ( ) web site URL ( :41 ) 1/ 77 60 (W30)? 1. ( ) kubo@ees.hokudai.ac.jp 2. ( ) web site URL http://goo.gl/e1cja!! 2013 03 07 (2013 03 07 17 :41 ) 1/ 77 ! : :? 2013 03 07 (2013 03 07 17 :41 ) 2/ 77 2013 03 07 (2013 03 07 17 :41 ) 3/ 77!!

More information

講義のーと : データ解析のための統計モデリング. 第5回

講義のーと :  データ解析のための統計モデリング. 第5回 Title 講義のーと : データ解析のための統計モデリング Author(s) 久保, 拓弥 Issue Date 2008 Doc URL http://hdl.handle.net/2115/49477 Type learningobject Note この講義資料は, 著者のホームページ http://hosho.ees.hokudai.ac.jp/~kub ードできます Note(URL)http://hosho.ees.hokudai.ac.jp/~kubo/ce/EesLecture20

More information

/ 60 : 1. GLM? 2. A: (pwer functin) x y?

/ 60 : 1. GLM? 2. A: (pwer functin) x y? 2009-03-17 1/ 60 (2009-03-17) GLM 1. GLM :, link,, deviance (20 ) 2. GLM : (60 ) 3. GLM ( ): ffset (40 ) http://hsh.ees.hkudai.ac.jp/ kub/ce/ecsj2009.html 2009-03-17 2/ 60 : 1. GLM? 2. A: (pwer functin)

More information

kubo2017sep16a p.1 ( 1 ) : : :55 kubo ( ( 1 ) / 10

kubo2017sep16a p.1 ( 1 ) :   : :55 kubo (  ( 1 ) / 10 kubo2017sep16a p.1 ( 1 ) kubo@ees.hokudai.ac.jp 2017 09 16 : http://goo.gl/8je5wh : 2017 09 13 16:55 kubo (http://goo.gl/ufq2) ( 1 ) 2017 09 16 1 / 106 kubo (http://goo.gl/ufq2) ( 1 ) 2017 09 16 2 / 106

More information

kubostat2017j p.2 CSV CSV (!) d2.csv d2.csv,, 286,0,A 85,0,B 378,1,A 148,1,B ( :27 ) 10/ 51 kubostat2017j (http://goo.gl/76c4i

kubostat2017j p.2 CSV CSV (!) d2.csv d2.csv,, 286,0,A 85,0,B 378,1,A 148,1,B ( :27 ) 10/ 51 kubostat2017j (http://goo.gl/76c4i kubostat2017j p.1 2017 (j) Categorical Data Analsis kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2017 11 15 : 2017 11 08 17:11 kubostat2017j (http://goo.gl/76c4i) 2017 (j) 2017 11 15 1 / 63 A B C D E F G

More information

/ 55 2 : : (GLM) 1. 1/23 ( )? GLM? (GLM ) 2.! 1/25 ( ) ffset (GLM )

/ 55 2 : : (GLM) 1. 1/23 ( )? GLM? (GLM ) 2.! 1/25 ( ) ffset (GLM ) 2012 01 25 1/ 55 ( II) : (2012 1 ) 2 2 (GLM) 2012 01 25! kub@ees.hkudai.ac.jp http://g.gl/76c4i 2012 01 25 2/ 55 2 : : (GLM) 1. 1/23 ( )? GLM? (GLM ) 2.! 1/25 ( ) ffset (GLM ) 2012 01 25 3/ 55 1. : 2.

More information

k3 ( :07 ) 2 (A) k = 1 (B) k = 7 y x x 1 (k2)?? x y (A) GLM (k

k3 ( :07 ) 2 (A) k = 1 (B) k = 7 y x x 1 (k2)?? x y (A) GLM (k 2012 11 01 k3 (2012-10-24 14:07 ) 1 6 3 (2012 11 01 k3) kubo@ees.hokudai.ac.jp web http://goo.gl/wijx2 web http://goo.gl/ufq2 1 3 2 : 4 3 AIC 6 4 7 5 8 6 : 9 7 11 8 12 8.1 (1)........ 13 8.2 (2) χ 2....................

More information

講義のーと : データ解析のための統計モデリング. 第2回

講義のーと :  データ解析のための統計モデリング. 第2回 Title 講義のーと : データ解析のための統計モデリング Author(s) 久保, 拓弥 Issue Date 2008 Doc URL http://hdl.handle.net/2115/49477 Type learningobject Note この講義資料は, 著者のホームページ http://hosho.ees.hokudai.ac.jp/~kub ードできます Note(URL)http://hosho.ees.hokudai.ac.jp/~kubo/ce/EesLecture20

More information

(2/24) : 1. R R R

(2/24) : 1. R R R R? http://hosho.ees.hokudai.ac.jp/ kubo/ce/2004/ : kubo@ees.hokudai.ac.jp (2/24) : 1. R 2. 3. R R (3/24)? 1. ( ) 2. ( I ) : (p ) : cf. (power) p? (4/24) p ( ) I p ( ) I? ( ) (5/24)? 0 2 4 6 8 A B A B (control)

More information

12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? ( :51 ) 2/ 71

12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? ( :51 ) 2/ 71 2010-12-02 (2010 12 02 10 :51 ) 1/ 71 GCOE 2010-12-02 WinBUGS kubo@ees.hokudai.ac.jp http://goo.gl/bukrb 12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? 2010-12-02 (2010 12

More information

kubostat2018d p.2 :? bod size x and fertilization f change seed number? : a statistical model for this example? i response variable seed number : { i

kubostat2018d p.2 :? bod size x and fertilization f change seed number? : a statistical model for this example? i response variable seed number : { i kubostat2018d p.1 I 2018 (d) model selection and kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2018 06 25 : 2018 06 21 17:45 1 2 3 4 :? AIC : deviance model selection misunderstanding kubostat2018d (http://goo.gl/76c4i)

More information

1 15 R Part : website:

1 15 R Part : website: 1 15 R Part 4 2017 7 24 4 : website: email: http://www3.u-toyama.ac.jp/kkarato/ kkarato@eco.u-toyama.ac.jp 1 2 2 3 2.1............................... 3 2.2 2................................. 4 2.3................................

More information

,, Poisson 3 3. t t y,, y n Nµ, σ 2 y i µ + ɛ i ɛ i N0, σ 2 E[y i ] µ * i y i x i y i α + βx i + ɛ i ɛ i N0, σ 2, α, β *3 y i E[y i ] α + βx i

,, Poisson 3 3. t t y,, y n Nµ, σ 2 y i µ + ɛ i ɛ i N0, σ 2 E[y i ] µ * i y i x i y i α + βx i + ɛ i ɛ i N0, σ 2, α, β *3 y i E[y i ] α + βx i Armitage.? SAS.2 µ, µ 2, µ 3 a, a 2, a 3 a µ + a 2 µ 2 + a 3 µ 3 µ, µ 2, µ 3 µ, µ 2, µ 3 log a, a 2, a 3 a µ + a 2 µ 2 + a 3 µ 3 µ, µ 2, µ 3 * 2 2. y t y y y Poisson y * ,, Poisson 3 3. t t y,, y n Nµ,

More information

kubostat2017b p.1 agenda I 2017 (b) probability distribution and maximum likelihood estimation :

kubostat2017b p.1 agenda I 2017 (b) probability distribution and maximum likelihood estimation : kubostat2017b p.1 agenda I 2017 (b) probabilit distribution and maimum likelihood estimation kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2017 11 14 : 2017 11 07 15:43 1 : 2 3? 4 kubostat2017b (http://goo.gl/76c4i)

More information

(lm) lm AIC 2 / 1

(lm) lm AIC 2 / 1 W707 s-taiji@is.titech.ac.jp 1 / 1 (lm) lm AIC 2 / 1 : y = β 1 x 1 + β 2 x 2 + + β d x d + β d+1 + ϵ (ϵ N(0, σ 2 )) y R: x R d : β i (i = 1,..., d):, β d+1 : ( ) (d = 1) y = β 1 x 1 + β 2 + ϵ (d > 1) y

More information

y i OLS [0, 1] OLS x i = (1, x 1,i,, x k,i ) β = (β 0, β 1,, β k ) G ( x i β) 1 G i 1 π i π i P {y i = 1 x i } = G (

y i OLS [0, 1] OLS x i = (1, x 1,i,, x k,i ) β = (β 0, β 1,, β k ) G ( x i β) 1 G i 1 π i π i P {y i = 1 x i } = G ( 7 2 2008 7 10 1 2 2 1.1 2............................................. 2 1.2 2.......................................... 2 1.3 2........................................ 3 1.4................................................

More information

DAA09

DAA09 > summary(dat.lm1) Call: lm(formula = sales ~ price, data = dat) Residuals: Min 1Q Median 3Q Max -55.719-19.270 4.212 16.143 73.454 Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) 237.1326

More information

Use R

Use R Use R! 2008/05/23( ) Index Introduction (GLM) ( ) R. Introduction R,, PLS,,, etc. 2. Correlation coefficient (Pearson s product moment correlation) r = Sxy Sxx Syy :, Sxy, Sxx= X, Syy Y 1.96 95% R cor(x,

More information

% 10%, 35%( 1029 ) p (a) 1 p 95% (b) 1 Std. Err. (c) p 40% 5% (d) p 1: STATA (1). prtesti One-sample test of pr

% 10%, 35%( 1029 ) p (a) 1 p 95% (b) 1 Std. Err. (c) p 40% 5% (d) p 1: STATA (1). prtesti One-sample test of pr 1 1. 2014 6 2014 6 10 10% 10%, 35%( 1029 ) p (a) 1 p 95% (b) 1 Std. Err. (c) p 40% 5% (d) p 1: STATA (1). prtesti 1029 0.35 0.40 One-sample test of proportion x: Number of obs = 1029 Variable Mean Std.

More information

/22 R MCMC R R MCMC? 3. Gibbs sampler : kubo/

/22 R MCMC R R MCMC? 3. Gibbs sampler :   kubo/ 2006-12-09 1/22 R MCMC R 1. 2. R MCMC? 3. Gibbs sampler : kubo@ees.hokudai.ac.jp http://hosho.ees.hokudai.ac.jp/ kubo/ 2006-12-09 2/22 : ( ) : : ( ) : (?) community ( ) 2006-12-09 3/22 :? 1. ( ) 2. ( )

More information

1 環境統計学ぷらす 第 5 回 一般 ( 化 ) 線形混合モデル 高木俊 2013/11/21

1 環境統計学ぷらす 第 5 回 一般 ( 化 ) 線形混合モデル 高木俊 2013/11/21 1 環境統計学ぷらす 第 5 回 一般 ( 化 ) 線形混合モデル 高木俊 shun.takagi@sci.toho-u.ac.jp 2013/11/21 2 予定 第 1 回 : Rの基礎と仮説検定 第 2 回 : 分散分析と回帰 第 3 回 : 一般線形モデル 交互作用 第 4.1 回 : 一般化線形モデル 第 4.2 回 : モデル選択 (11/29?) 第 5 回 : 一般化線形混合モデル

More information

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x 80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = n λ x i e λ x i! = λ n x i e nλ n x i! n n log l(λ) = log(λ) x i nλ log( x i!) log l(λ) λ = 1 λ n x i n =

More information

第11回:線形回帰モデルのOLS推定

第11回:線形回帰モデルのOLS推定 11 OLS 2018 7 13 1 / 45 1. 2. 3. 2 / 45 n 2 ((y 1, x 1 ), (y 2, x 2 ),, (y n, x n )) linear regression model y i = β 0 + β 1 x i + u i, E(u i x i ) = 0, E(u i u j x i ) = 0 (i j), V(u i x i ) = σ 2, i

More information

²¾ÁÛ¾õ¶·É¾²ÁË¡¤Î¤¿¤á¤Î¥Ñ¥Ã¥±¡¼¥¸DCchoice ¡Ê»ÃÄêÈÇ¡Ë

²¾ÁÛ¾õ¶·É¾²ÁË¡¤Î¤¿¤á¤Î¥Ñ¥Ã¥±¡¼¥¸DCchoice ¡Ê»ÃÄêÈÇ¡Ë DCchoice ( ) R 2013 2013 11 30 DCchoice package R 2013/11/30 1 / 19 1 (CV) CV 2 DCchoice WTP 3 DCchoice package R 2013/11/30 2 / 19 (Contingent Valuation; CV) WTP CV WTP WTP 1 1989 2 DCchoice package R

More information

kubo2015ngt6 p.2 ( ( (MLE 8 y i L(q q log L(q q 0 ˆq log L(q / q = 0 q ˆq = = = * ˆq = 0.46 ( 8 y 0.46 y y y i kubo (ht

kubo2015ngt6 p.2 ( ( (MLE 8 y i L(q q log L(q q 0 ˆq log L(q / q = 0 q ˆq = = = * ˆq = 0.46 ( 8 y 0.46 y y y i kubo (ht kubo2015ngt6 p.1 2015 (6 MCMC kubo@ees.hokudai.ac.jp, @KuboBook http://goo.gl/m8hsbm 1 ( 2 3 4 5 JAGS : 2015 05 18 16:48 kubo (http://goo.gl/m8hsbm 2015 (6 1 / 70 kubo (http://goo.gl/m8hsbm 2015 (6 2 /

More information

第13回:交差項を含む回帰・弾力性の推定

第13回:交差項を含む回帰・弾力性の推定 13 2018 7 27 1 / 31 1. 2. 2 / 31 y i = β 0 + β X x i + β Z z i + β XZ x i z i + u i, E(u i x i, z i ) = 0, E(u i u j x i, z i ) = 0 (i j), V(u i x i, z i ) = σ 2, i = 1, 2,, n x i z i 1 3 / 31 y i = β

More information

: (GLMM) (pseudo replication) ( ) ( ) & Markov Chain Monte Carlo (MCMC)? /30

: (GLMM) (pseudo replication) ( ) ( ) & Markov Chain Monte Carlo (MCMC)? /30 PlotNet 6 ( ) 2006-01-19 TOEF(1998 2004), AM, growth6 DBH growth (mm) 1998 1999 2000 2001 2002 2003 2004 10 20 30 40 50 70 DBH (cm) 1. 2. - - : kubo@ees.hokudai.ac.jp http://hosho.ees.hokudai.ac.jp/ kubo/show/2006/plotnet/

More information

untitled

untitled 2011/6/22 M2 1*1+2*2 79 2F Y YY 0.0 0.2 0.4 0.6 0.8 0.000 0.002 0.004 0.006 0.008 0.010 0.012 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Y 0 50 100 150 200 250 YY A (Y = X + e A ) B (YY = X + e B ) X 0.00 0.05 0.10

More information

1 Stata SEM LightStone 4 SEM 4.. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press 3.

1 Stata SEM LightStone 4 SEM 4.. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press 3. 1 Stata SEM LightStone 4 SEM 4.. Alan C. Acock, 2013. Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press 3. 2 4, 2. 1 2 2 Depress Conservative. 3., 3,. SES66 Alien67 Alien71,

More information

201711grade2.pdf

201711grade2.pdf 2017 11 26 1 2 28 3 90 4 5 A 1 2 3 4 Web Web 6 B 10 3 10 3 7 34 8 23 9 10 1 2 3 1 (A) 3 32.14 0.65 2.82 0.93 7.48 (B) 4 6 61.30 54.68 34.86 5.25 19.07 (C) 7 13 5.89 42.18 56.51 35.80 50.28 (D) 14 20 0.35

More information

2 / 39

2 / 39 W707 s-taiji@is.titech.ac.jp 1 / 39 2 / 39 1 2 3 3 / 39 q f (x; α) = α j B j (x). j=1 min α R n+2 n ( d (Y i f (X i ; α)) 2 2 ) 2 f (x; α) + λ dx 2 dx. i=1 f B j 4 / 39 : q f (x) = α j B j (x). j=1 : x

More information

yamadaiR(cEFA).pdf

yamadaiR(cEFA).pdf R 2012/10/05 Kosugi,E.Koji (Yamadai.R) Categorical Factor Analysis by using R 2012/10/05 1 / 9 Why we use... 3 5 Kosugi,E.Koji (Yamadai.R) Categorical Factor Analysis by using R 2012/10/05 2 / 9 FA vs

More information

卒業論文

卒業論文 Y = ax 1 b1 X 2 b2...x k bk e u InY = Ina + b 1 InX 1 + b 2 InX 2 +...+ b k InX k + u X 1 Y b = ab 1 X 1 1 b 1 X 2 2...X bk k e u = b 1 (ax b1 1 X b2 2...X bk k e u ) / X 1 = b 1 Y / X 1 X 1 X 1 q YX1

More information

「産業上利用することができる発明」の審査の運用指針(案)

「産業上利用することができる発明」の審査の運用指針(案) 1 1.... 2 1.1... 2 2.... 4 2.1... 4 3.... 6 4.... 6 1 1 29 1 29 1 1 1. 2 1 1.1 (1) (2) (3) 1 (4) 2 4 1 2 2 3 4 31 12 5 7 2.2 (5) ( a ) ( b ) 1 3 2 ( c ) (6) 2. 2.1 2.1 (1) 4 ( i ) ( ii ) ( iii ) ( iv)

More information

H22 BioS t (i) treat1 treat2 data d1; input patno treat1 treat2; cards; ; run; 1 (i) treat = 1 treat =

H22 BioS t (i) treat1 treat2 data d1; input patno treat1 treat2; cards; ; run; 1 (i) treat = 1 treat = H BioS t (i) treat treat data d; input patno treat treat; cards; 3 8 7 4 8 8 5 5 6 3 ; run; (i) treat treat data d; input group patno period treat y; label group patno period ; cards; 3 8 3 7 4 8 4 8 5

More information

kubostat1g p. MCMC binomial distribution q MCMC : i N i y i p(y i q = ( Ni y i q y i (1 q N i y i, q {y i } q likelihood q L(q {y i } = i=1 p(y i q 1

kubostat1g p. MCMC binomial distribution q MCMC : i N i y i p(y i q = ( Ni y i q y i (1 q N i y i, q {y i } q likelihood q L(q {y i } = i=1 p(y i q 1 kubostat1g p.1 1 (g Hierarchical Bayesian Model kubo@ees.hokudai.ac.jp http://goo.gl/7ci The development of linear models Hierarchical Bayesian Model Be more flexible Generalized Linear Mixed Model (GLMM

More information

AR(1) y t = φy t 1 + ɛ t, ɛ t N(0, σ 2 ) 1. Mean of y t given y t 1, y t 2, E(y t y t 1, y t 2, ) = φy t 1 2. Variance of y t given y t 1, y t

AR(1) y t = φy t 1 + ɛ t, ɛ t N(0, σ 2 ) 1. Mean of y t given y t 1, y t 2, E(y t y t 1, y t 2, ) = φy t 1 2. Variance of y t given y t 1, y t 87 6.1 AR(1) y t = φy t 1 + ɛ t, ɛ t N(0, σ 2 ) 1. Mean of y t given y t 1, y t 2, E(y t y t 1, y t 2, ) = φy t 1 2. Variance of y t given y t 1, y t 2, V(y t y t 1, y t 2, ) = σ 2 3. Thus, y t y t 1,

More information

こんにちは由美子です

こんにちは由美子です 1 2 . sum Variable Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- var1 13.4923077.3545926.05 1.1 3 3 3 0.71 3 x 3 C 3 = 0.3579 2 1 0.71 2 x 0.29 x 3 C 2 = 0.4386

More information

PackageSoft/R-033U.tex (2018/March) R:

PackageSoft/R-033U.tex (2018/March) R: ................................................................................ R: 2018 3 29................................................................................ R AI R https://cran.r-project.org/doc/contrib/manuals-jp/r-intro-170.jp.pdf

More information

今回 次回の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ Danger!! (危 1) 時系列データの GLM あてはめ (危 2) 時系列Yt 時系列 Xt 各時刻の個体数 気温 とか これは次回)

今回 次回の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ Danger!! (危 1) 時系列データの GLM あてはめ (危 2) 時系列Yt 時系列 Xt 各時刻の個体数 気温 とか これは次回) 生態学の時系列データ解析でよく見る あぶない モデリング 久保拓弥 mailto:kubo@ees.hokudai.ac.jp statistical model for time-series data 2017-07-03 kubostat2017 (h) 1/59 今回 次回の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ Danger!! (危 1) 時系列データの

More information

p.1/22

p.1/22 p.1/22 & & & & Excel / p.2/22 & & & & Excel / p.2/22 ( ) ( ) p.3/22 ( ) ( ) Baldi Web p.3/22 ( ) ( ) Baldi Web ( ) ( ) ( p.3/22 ) Text Mining for Clementine True Teller Text Mining Studio Text Miner Trustia

More information

2 と入力すると以下のようになる > x1<-c(1.52,2,3.01,9,2,6.3,5,11.2) > y1<-c(4,0.21,-1.5,8,2,6,9.915,5.2) > cor(x1,y1) [1] > cor.test(x1,y1) Pearson's produ

2 と入力すると以下のようになる > x1<-c(1.52,2,3.01,9,2,6.3,5,11.2) > y1<-c(4,0.21,-1.5,8,2,6,9.915,5.2) > cor(x1,y1) [1] > cor.test(x1,y1) Pearson's produ 1 統計 データ解析セミナーの予習 2010.11.24 粕谷英一 ( 理 生物 生態 ) GCOE アジア保全生態学 本日のメニュー R 一般化線形モデル (Generalized Linear Models 略して GLM) R で GLM を使う R でグラフを描く 説明しないこと :R でできること全般 たくさんあるので時間的に無理 R でするプログラミング-データ解析なら使いやすい R 起動と終了

More information

kubostat2018a p.1 統計モデリング入門 2018 (a) The main language of this class is 生物多様性学特論 Japanese Sorry An overview: Statistical Modeling 観測されたパターンを説明する統計モデル

kubostat2018a p.1 統計モデリング入門 2018 (a) The main language of this class is 生物多様性学特論 Japanese Sorry An overview: Statistical Modeling 観測されたパターンを説明する統計モデル p.1 統計モデリング入門 2018 (a) The main language of this class is 生物多様性学特論 Japanese Sorry An overview: Statistical Modeling 観測されたパターンを説明する統計モデル 久保拓弥 (北海道大 環境科学) Why in Japanese? because even in Japanese, statistics

More information

統計モデリング入門 2018 (a) 生物多様性学特論 An overview: Statistical Modeling 観測されたパターンを説明する統計モデル 久保拓弥 (北海道大 環境科学) 統計モデリング入門 2018a 1

統計モデリング入門 2018 (a) 生物多様性学特論 An overview: Statistical Modeling 観測されたパターンを説明する統計モデル 久保拓弥 (北海道大 環境科学) 統計モデリング入門 2018a 1 統計モデリング入門 2018 (a) 生物多様性学特論 An overview: Statistical Modeling 観測されたパターンを説明する統計モデル 久保拓弥 (北海道大 環境科学) kubo@ees.hokudai.ac.jp 1/56 The main language of this class is Japanese Sorry Why in Japanese? because

More information

Microsoft PowerPoint - GLMMexample_ver pptx

Microsoft PowerPoint - GLMMexample_ver pptx Linear Mixed Model ( 以下 混合モデル ) の短い解説 この解説のPDFは http://www.lowtem.hokudai.ac.jp/plantecol/akihiro/sumida-index.html の お勉強 のページにあります. ver 20121121 と との間に次のような関係が見つかったとしよう 全体的な傾向に対する回帰直線を点線で示した ところが これらのデータは実は異なる

More information

Stata11 whitepapers mwp-037 regress - regress regress. regress mpg weight foreign Source SS df MS Number of obs = 74 F(

Stata11 whitepapers mwp-037 regress - regress regress. regress mpg weight foreign Source SS df MS Number of obs = 74 F( mwp-037 regress - regress 1. 1.1 1.2 1.3 2. 3. 4. 5. 1. regress. regress mpg weight foreign Source SS df MS Number of obs = 74 F( 2, 71) = 69.75 Model 1619.2877 2 809.643849 Prob > F = 0.0000 Residual

More information

インターネットを活用した経済分析 - フリーソフト Rを使おう

インターネットを活用した経済分析 - フリーソフト Rを使おう R 1 1 1 2017 2 15 2017 2 15 1/64 2 R 3 R R RESAS 2017 2 15 2/64 2 R 3 R R RESAS 2017 2 15 3/64 2-4 ( ) ( (80%) (20%) 2017 2 15 4/64 PC LAN R 2017 2 15 5/64 R R 2017 2 15 6/64 3-4 R 15 + 2017 2 15 7/64

More information

: Bradley-Terry Burczyk

: Bradley-Terry Burczyk 58 (W15) 2011 03 09 kubo@ees.hokudai.ac.jp http://goo.gl/edzle 2011 03 09 (2011 03 09 19 :32 ) : Bradley-Terry Burczyk ? ( ) 1999 2010 9 R : 7 (1) 8 7??! 15 http://www.atmarkit.co.jp/fcoding/articles/stat/07/stat07a.html

More information

R John Fox R R R Console library(rcmdr) Rcmdr R GUI Windows R R SDI *1 R Console R 1 2 Windows XP Windows * 2 R R Console R ˆ R

R John Fox R R R Console library(rcmdr) Rcmdr R GUI Windows R R SDI *1 R Console R 1 2 Windows XP Windows * 2 R R Console R ˆ R R John Fox 2006 8 26 2008 8 28 1 R R R Console library(rcmdr) Rcmdr R GUI Windows R R SDI *1 R Console R 1 2 Windows XP Windows * 2 R R Console R ˆ R GUI R R R Console > ˆ 2 ˆ Fox(2005) jfox@mcmaster.ca

More information

H22 BioS (i) I treat1 II treat2 data d1; input group patno treat1 treat2; cards; ; run; I

H22 BioS (i) I treat1 II treat2 data d1; input group patno treat1 treat2; cards; ; run; I H BioS (i) I treat II treat data d; input group patno treat treat; cards; 8 7 4 8 8 5 5 6 ; run; I II sum data d; set d; sum treat + treat; run; sum proc gplot data d; plot sum * group ; symbol c black

More information

/ *1 *1 c Mike Gonzalez, October 14, Wikimedia Commons.

/ *1 *1 c Mike Gonzalez, October 14, Wikimedia Commons. 2010 05 22 1/ 35 2010 2010 05 22 *1 kubo@ees.hokudai.ac.jp *1 c Mike Gonzalez, October 14, 2007. Wikimedia Commons. 2010 05 22 2/ 35 1. 2. 3. 2010 05 22 3/ 35 : 1.? 2. 2010 05 22 4/ 35 1. 2010 05 22 5/

More information

J1順位と得点者数の関係分析

J1順位と得点者数の関係分析 2015 年度 S-PLUS & Visual R Platform 学生研究奨励賞応募 J1 順位と得点者数の関係分析 -J リーグの得点数の現状 - 目次 1. はじめに 2. 研究目的 データについて 3.J1 リーグの得点数の現状 4. 分析 5. まとめ 6. 今後の課題 - 参考文献 - 東海大学情報通信学部 経営システム工学科 山田貴久 1. はじめに 1993 年 5 月 15 日に

More information

最小2乗法

最小2乗法 2 2012 4 ( ) 2 2012 4 1 / 42 X Y Y = f (X ; Z) linear regression model X Y slope X 1 Y (X, Y ) 1 (X, Y ) ( ) 2 2012 4 2 / 42 1 β = β = β (4.2) = β 0 + β (4.3) ( ) 2 2012 4 3 / 42 = β 0 + β + (4.4) ( )

More information

2009 5 1...1 2...3 2.1...3 2.2...3 3...10 3.1...10 3.1.1...10 3.1.2... 11 3.2...14 3.2.1...14 3.2.2...16 3.3...18 3.4...19 3.4.1...19 3.4.2...20 3.4.3...21 4...24 4.1...24 4.2...24 4.3 WinBUGS...25 4.4...28

More information

tokei01.dvi

tokei01.dvi 2. :,,,. :.... Apr. - Jul., 26FY Dept. of Mechanical Engineering, Saga Univ., JAPAN 4 3. (probability),, 1. : : n, α A, A a/n. :, p, p Apr. - Jul., 26FY Dept. of Mechanical Engineering, Saga Univ., JAPAN

More information

dvi

dvi 2017 65 2 185 200 2017 1 2 2016 12 28 2017 5 17 5 24 PITCHf/x PITCHf/x PITCHf/x MLB 2014 PITCHf/x 1. 1 223 8522 3 14 1 2 223 8522 3 14 1 186 65 2 2017 PITCHf/x 1.1 PITCHf/x PITCHf/x SPORTVISION MLB 30

More information

1 Tokyo Daily Rainfall (mm) Days (mm)

1 Tokyo Daily Rainfall (mm) Days (mm) ( ) r-taka@maritime.kobe-u.ac.jp 1 Tokyo Daily Rainfall (mm) 0 100 200 300 0 10000 20000 30000 40000 50000 Days (mm) 1876 1 1 2013 12 31 Tokyo, 1876 Daily Rainfall (mm) 0 50 100 150 0 100 200 300 Tokyo,

More information

1 Stata SEM LightStone 3 2 SEM. 2., 2,. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press.

1 Stata SEM LightStone 3 2 SEM. 2., 2,. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press. 1 Stata SEM LightStone 3 2 SEM. 2., 2,. Alan C. Acock, 2013. Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press. 2 3 2 Conservative Depress. 3.1 2. SEM. 1. x SEM. Depress.

More information

GLM PROC GLM y = Xβ + ε y X β ε ε σ 2 E[ε] = 0 var[ε] = σ 2 I σ 2 0 σ 2 =... 0 σ 2 σ 2 I ε σ 2 y E[y] =Xβ var[y] =σ 2 I PROC GLM

GLM PROC GLM y = Xβ + ε y X β ε ε σ 2 E[ε] = 0 var[ε] = σ 2 I σ 2 0 σ 2 =... 0 σ 2 σ 2 I ε σ 2 y E[y] =Xβ var[y] =σ 2 I PROC GLM PROC MIXED ( ) An Introdunction to PROC MIXED Junji Kishimoto SAS Institute Japan / Keio Univ. SFC / Univ. of Tokyo e-mail address: jpnjak@jpn.sas.com PROC MIXED PROC GLM PROC MIXED,,,, 1 1.1 PROC MIXED

More information

udc-2.dvi

udc-2.dvi 13 0.5 2 0.5 2 1 15 2001 16 2009 12 18 14 No.39, 2010 8 2009b 2009a Web Web Q&A 2006 2007a20082009 2007b200720082009 20072008 2009 2009 15 1 2 2 2.1 18 21 1 4 2 3 1(a) 1(b) 1(c) 1(d) 1) 18 16 17 21 10

More information

Rによる計量分析:データ解析と可視化 - 第3回 Rの基礎とデータ操作・管理

Rによる計量分析:データ解析と可視化 - 第3回  Rの基礎とデータ操作・管理 R 3 R 2017 Email: gito@eco.u-toyama.ac.jp October 23, 2017 (Toyama/NIHU) R ( 3 ) October 23, 2017 1 / 34 Agenda 1 2 3 4 R 5 RStudio (Toyama/NIHU) R ( 3 ) October 23, 2017 2 / 34 10/30 (Mon.) 12/11 (Mon.)

More information

2.1 R, ( ), Download R for Windows base. R ( ) R win.exe, 2.,.,.,. R > 3*5 # [1] 15 > c(19,76)+c(11,13)

2.1 R, ( ),   Download R for Windows base. R ( ) R win.exe, 2.,.,.,. R > 3*5 # [1] 15 > c(19,76)+c(11,13) 3 ( ) R 3 1 61, 2016/4/7( ), 4/14( ), 4/21( ) 1 1 2 1 2.1 R, ( )................ 2 2.2 ggm............................ 3 2.3,................ 4 2.4...................................... 6 2.5 1 ( )....................

More information

1. 2 Blank and Winnick (1953) 1 Smith (1974) Shilling et al. (1987) Shilling et al. (1987) Frew and Jud (1988) James Shilling Voith (1992) (Shilling e

1. 2 Blank and Winnick (1953) 1 Smith (1974) Shilling et al. (1987) Shilling et al. (1987) Frew and Jud (1988) James Shilling Voith (1992) (Shilling e Estimation of the Natural Vacancy Rate and it s Instability: Evidence from the Tokyo Office Market * ** *** Sho Kuroda*, Morito Tsutsumi**, Toyokazu Imazeki*** * ** *** rent adjustment mechanismnatural

More information

28

28 y i = Z i δ i +ε i ε i δ X y i = X Z i δ i + X ε i [ ] 1 δ ˆ i = Z i X( X X) 1 X Z i [ ] 1 σ ˆ 2 Z i X( X X) 1 X Z i Z i X( X X) 1 X y i σ ˆ 2 ˆ σ 2 = [ ] y i Z ˆ [ i δ i ] 1 y N p i Z i δ ˆ i i RSTAT

More information

> usdata01 と打ち込んでエンター キーを押すと V1 V2 V : : : : のように表示され 読み込まれていることがわかる ここで V1, V2, V3 は R が列のデータに自 動的につけた変数名である ( variable

> usdata01 と打ち込んでエンター キーを押すと V1 V2 V : : : : のように表示され 読み込まれていることがわかる ここで V1, V2, V3 は R が列のデータに自 動的につけた変数名である ( variable R による回帰分析 ( 最小二乗法 ) この資料では 1. データを読み込む 2. 最小二乗法によってパラメーターを推定する 3. データをプロットし 回帰直線を書き込む 4. いろいろなデータの読み込み方について簡単に説明する 1. データを読み込む 以下では read.table( ) 関数を使ってテキストファイル ( 拡張子が.txt のファイル ) のデー タの読み込み方を説明する 1.1

More information

10:30 12:00 P.G. vs vs vs 2

10:30 12:00 P.G. vs vs vs 2 1 10:30 12:00 P.G. vs vs vs 2 LOGIT PROBIT TOBIT mean median mode CV 3 4 5 0.5 1000 6 45 7 P(A B) = P(A) + P(B) - P(A B) P(B A)=P(A B)/P(A) P(A B)=P(B A) P(A) P(A B) P(A) P(B A) P(B) P(A B) P(A) P(B) P(B

More information

untitled

untitled IT (1, horiike@ml.me.titech.ac.jp) (1, jun-jun@ms.kagu.tus.ac.jp) 1. 1-1 19802000 2000ITIT IT IT TOPIX (%) 1TOPIX 2 1-2. 80 80 ( ) 2004/11/26 S-PLUS 2 1-3. IT IT IT IT 2. 2-1. a. b. (Size) c. B/M(Book

More information

N Express5800/R320a-E4 N Express5800/R320a-M4 ユーザーズガイド

N Express5800/R320a-E4  N Express5800/R320a-M4  ユーザーズガイド 7 7 Phoenix BIOS 4.0 Release 6.0.XXXX : CPU=Pentium III Processor XXX MHz 0640K System RAM Passed 0127M Extended RAM Passed WARNING 0212: Keybord Controller Failed. : Press to resume, to setup

More information

Express5800/R320a-E4, Express5800/R320b-M4ユーザーズガイド

Express5800/R320a-E4, Express5800/R320b-M4ユーザーズガイド 7 7 Phoenix BIOS 4.0 Release 6.0.XXXX : CPU=Pentium III Processor XXX MHz 0640K System RAM Passed 0127M Extended RAM Passed WARNING 0212: Keybord Controller Failed. : Press to resume, to setup

More information

こんにちは由美子です

こんにちは由美子です Analysis of Variance 2 two sample t test analysis of variance (ANOVA) CO 3 3 1 EFV1 µ 1 µ 2 µ 3 H 0 H 0 : µ 1 = µ 2 = µ 3 H A : Group 1 Group 2.. Group k population mean µ 1 µ µ κ SD σ 1 σ σ κ sample mean

More information

と入力する すると最初の 25 行が表示される 1 行目は変数の名前であり 2 列目は企業番号 (1,,10),3 列目は西暦 (1935,,1954) を表している ( 他のパネルデータを分析する際もデ ータをこのように並べておかなくてはならない つまりまず i=1 を固定し i=1 の t に関

と入力する すると最初の 25 行が表示される 1 行目は変数の名前であり 2 列目は企業番号 (1,,10),3 列目は西暦 (1935,,1954) を表している ( 他のパネルデータを分析する際もデ ータをこのように並べておかなくてはならない つまりまず i=1 を固定し i=1 の t に関 R によるパネルデータモデルの推定 R を用いて 静学的パネルデータモデルに対して Pooled OLS, LSDV (Least Squares Dummy Variable) 推定 F 検定 ( 個別効果なしの F 検定 ) GLS(Generalized Least Square : 一般化最小二乗 ) 法による推定 およびハウスマン検定を行うやり方を 動学的パネルデータモデルに対して 1 階階差

More information

1 2 3 4 10 5 30 87 50 20 3 7 2 2 6 3 70 7 5 10 20 20 30 14 5 1,000 24 112 2 3 1 8 110 9 JR 10 110 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 25 30 31 32 25 A 33 B C D E F G PR PR or 34 35

More information

201711grade1ouyou.pdf

201711grade1ouyou.pdf 2017 11 26 1 2 52 3 12 13 22 23 32 33 42 3 5 3 4 90 5 6 A 1 2 Web Web 3 4 1 2... 5 6 7 7 44 8 9 1 2 3 1 p p >2 2 A 1 2 0.6 0.4 0.52... (a) 0.6 0.4...... B 1 2 0.8-0.2 0.52..... (b) 0.6 0.52.... 1 A B 2

More information

1 kawaguchi p.1/81

1 kawaguchi p.1/81 1 kawaguchi atsushi@kurume-u.ac.jp 2005 7 2 p.1/81 2.1 2.2 2.2.3 2.3 AUC 4.4 p.2/81 X Z X = α + βz + e α : Z = 0 X ( ) β : Z X ( ) e : 0 σ 2 p.3/81 2.1 Z X 1 0.045 2 0.114 4 0.215 6 0.346 7 0.41 8 0.52

More information

Stata 11 Stata ts (ARMA) ARCH/GARCH whitepaper mwp 3 mwp-083 arch ARCH 11 mwp-051 arch postestimation 27 mwp-056 arima ARMA 35 mwp-003 arima postestim

Stata 11 Stata ts (ARMA) ARCH/GARCH whitepaper mwp 3 mwp-083 arch ARCH 11 mwp-051 arch postestimation 27 mwp-056 arima ARMA 35 mwp-003 arima postestim TS001 Stata 11 Stata ts (ARMA) ARCH/GARCH whitepaper mwp 3 mwp-083 arch ARCH 11 mwp-051 arch postestimation 27 mwp-056 arima ARMA 35 mwp-003 arima postestimation 49 mwp-055 corrgram/ac/pac 56 mwp-009 dfgls

More information

JMP V4 による生存時間分析

JMP V4 による生存時間分析 V4 1 SAS 2000.11.18 4 ( ) (Survival Time) 1 (Event) Start of Study Start of Observation Died Died Died Lost End Time Censor Died Died Censor Died Time Start of Study End Start of Observation Censor

More information

2/50 Auction: Theory and Practice 3 / 50 (WTO) 10 SDR ,600 Auction: Theory and Practice 4 / 50 2

2/50 Auction: Theory and Practice 3 / 50 (WTO) 10 SDR ,600 Auction: Theory and Practice 4 / 50 2 stakagi@econ.hokudai.ac.jp June 24, 2011 2.... 3... 4... 7 8... 9.... 10... 11... 12 IPV 13 SPSB... 15 SPSB.... 17 SPSB.... 19 FPSB... 20 FPSB.... 22 FPSB.... 23... 24 Low Price Auction.... 27 APV 29...

More information

Presentation Title Goes Here

Presentation  Title Goes Here SAS 9: (reprise) SAS Institute Japan Copyright 2004, SAS Institute Inc. All rights reserved. Greetings, SAS 9 SAS 9.1.3 Copyright 2004, SAS Institute Inc. All rights reserved. 2 Informations of SAS 9 SAS

More information

Excess Capacity and Effectiveness of Policy Interventions: Evidence from the Cement Industry SMU

Excess Capacity and Effectiveness of Policy Interventions: Evidence from the Cement Industry SMU Excess Capacity and Effectiveness of Policy Interventions: Evidence from the Cement Industry SMU 2017 12 22 (1/2): - 1970-2010 HDD - 2010 (Misallocation) Ghemawat and Nalebuff (1990) / War of Attrition

More information

untitled

untitled 3 3. (stochastic differential equations) { dx(t) =f(t, X)dt + G(t, X)dW (t), t [,T], (3.) X( )=X X(t) : [,T] R d (d ) f(t, X) : [,T] R d R d (drift term) G(t, X) : [,T] R d R d m (diffusion term) W (t)

More information

Microsoft Word - 計量研修テキスト_第5版).doc

Microsoft Word - 計量研修テキスト_第5版).doc Q10-2 テキスト P191 1. 記述統計量 ( 変数 :YY95) 表示変数として 平均 中央値 最大値 最小値 標準偏差 観測値 を選択 A. 都道府県別 Descriptive Statistics for YY95 Categorized by values of PREFNUM Date: 05/11/06 Time: 14:36 Sample: 1990 2002 Included

More information

Microsoft Word - D JP.docx

Microsoft Word - D JP.docx Application Service Gateway Thunder/AX Series vthunder ライセンスキー インストール 手順 1 1.... 3 2. vthunder... 3 3. ACOS... 3 4. ID... 5 5.... 8 6.... 8 61... 8 62 GUI... 10 2 1. 概要 2. vthunder へのアクセス 方法 SSHHTTPSvThunder

More information

untitled

untitled 2 : n =1, 2,, 10000 0.5125 0.51 0.5075 0.505 0.5025 0.5 0.4975 0.495 0 2000 4000 6000 8000 10000 2 weak law of large numbers 1. X 1,X 2,,X n 2. µ = E(X i ),i=1, 2,,n 3. σi 2 = V (X i ) σ 2,i=1, 2,,n ɛ>0

More information

ECCS. ECCS,. ( 2. Mac Do-file Editor. Mac Do-file Editor Windows Do-file Editor Top Do-file e

ECCS. ECCS,. (  2. Mac Do-file Editor. Mac Do-file Editor Windows Do-file Editor Top Do-file e 1 1 2015 4 6 1. ECCS. ECCS,. (https://ras.ecc.u-tokyo.ac.jp/guacamole/) 2. Mac Do-file Editor. Mac Do-file Editor Windows Do-file Editor Top Do-file editor, Do View Do-file Editor Execute(do). 3. Mac System

More information

2 H23 BioS (i) data d1; input group patno t sex censor; cards;

2 H23 BioS (i) data d1; input group patno t sex censor; cards; H BioS (i) data d1; input group patno t sex censor; cards; 0 1 0 0 0 0 1 0 1 1 0 4 4 0 1 0 5 5 1 1 0 6 5 1 1 0 7 10 1 0 0 8 15 0 1 0 9 15 0 1 0 10 4 1 0 0 11 4 1 0 1 1 5 1 0 1 1 7 0 1 1 14 8 1 0 1 15 8

More information

BMIdata.txt DT DT <- read.table("bmidata.txt") DT head(dt) names(dt) str(dt)

BMIdata.txt DT DT <- read.table(bmidata.txt) DT head(dt) names(dt) str(dt) ?read.table read.table(file, header = FALSE, sep = "", quote = "\" ", dec = ".", numerals = c("allow.loss", "warn.loss", "no.loss"), row.names, col.names, as.is =!stringsasfactors, na.strings = "NA", colclasses

More information

s = 1.15 (s = 1.07), R = 0.786, R = 0.679, DW =.03 5 Y = 0.3 (0.095) (.708) X, R = 0.786, R = 0.679, s = 1.07, DW =.03, t û Y = 0.3 (3.163) + 0

s = 1.15 (s = 1.07), R = 0.786, R = 0.679, DW =.03 5 Y = 0.3 (0.095) (.708) X, R = 0.786, R = 0.679, s = 1.07, DW =.03, t û Y = 0.3 (3.163) + 0 7 DW 7.1 DW u 1, u,, u (DW ) u u 1 = u 1, u,, u + + + - - - - + + - - - + + u 1, u,, u + - + - + - + - + u 1, u,, u u 1, u,, u u +1 = u 1, u,, u Y = α + βx + u, u = ρu 1 + ɛ, H 0 : ρ = 0, H 1 : ρ 0 ɛ 1,

More information

Stata User Group Meeting in Kyoto / ( / ) Stata User Group Meeting in Kyoto / 21

Stata User Group Meeting in Kyoto / ( / ) Stata User Group Meeting in Kyoto / 21 Stata User Group Meeting in Kyoto / 2017 9 16 ( / ) Stata User Group Meeting in Kyoto 2017 9 16 1 / 21 Rosenbaum and Rubin (1983) logit/probit, ATE = E [Y 1 Y 0 ] ( / ) Stata User Group Meeting in Kyoto

More information

1 (1) (2)

1 (1) (2) 1 2 (1) (2) (3) 3-78 - 1 (1) (2) - 79 - i) ii) iii) (3) (4) (5) (6) - 80 - (7) (8) (9) (10) 2 (1) (2) (3) (4) i) - 81 - ii) (a) (b) 3 (1) (2) - 82 - - 83 - - 84 - - 85 - - 86 - (1) (2) (3) (4) (5) (6)

More information

- 2 -

- 2 - - 2 - - 3 - (1) (2) (3) (1) - 4 - ~ - 5 - (2) - 6 - (1) (1) - 7 - - 8 - (i) (ii) (iii) (ii) (iii) (ii) 10 - 9 - (3) - 10 - (3) - 11 - - 12 - (1) - 13 - - 14 - (2) - 15 - - 16 - (3) - 17 - - 18 - (4) -

More information