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

Size: px
Start display at page:

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

Transcription

1 kubostat2017c p (c), a generalized linear model (GLM) : kubo@ees.hokudai.ac.jp : :43 kubostat2017c ( (c) / 47 agenda I 1 response variable y 2 :? 3 GLM 4 R GLM 5 GLM kubostat2017c ( (c) / 47 agenda II Normal distribution and identity link function Poisson distribution and log link function log 3 (GLM) y y : : kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 response variable y? Generalized Linear Model (GLM) () (logistic regression) (linear regression) 1. response variable y kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

2 kubostat2017c p.2 statistaical models appeared in the class response variable y suppose that you have a count data set... 0, 1, 2 response variable y The development of linear models Hierarchical Bayesian Model Be more fleible Generalized Linear Mied Model (GLMM) Incoporating random effects such as individuality parameter estimation MCMC MLE Generalized Linear Model (GLM) Always normal distribution? That's non-sense! MSE Linear model Kubo Doctrine: Learn the evolution of linear-model family, firstly! kubostat2017c ( (c) / 47 (y {0, 1, 2, 3, } ) response variable y e.g. egg number () e.g. body size () y? kubostat2017c ( (c) / 47 the normal distribution... is NOT this one!? response variable y the Poisson disribution approimates data?! response variable y response variable y? y 0? NO! kubostat2017c ( (c) / 47 response variable y fair distribution non-negative mean YES! bye-bye, the normal distribution kubostat2017c ( (c) / 47 :? :? body size and fertilization f change seed number y? 2. :? Modeling number of seeds of plants using GLM response variable seed number : {y i } : body size { i } fertilization {f i } f i C: T: i sample size control (f i = C): 50 sample (i {1, 2, 50}) treated (f i = T): 50 sample (i {51, 52, 100}) y i i kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

3 kubostat2017c p.3 : Reading data file? :? data frame d : data: data3a.csv CSV (comma separated value) format file R : > d <- read.csv("data3a.csv") d data frame ( ) data frame d > d y f C C C T T > d$ [1] [9] [97] > d$y [1] [17] [97] kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 :? data frame d : :? data type and class R f > d$f [1] C C C C C C C C C C C C C C C C C C C C C C C C C [26] C C C C C C C C C C C C C C C C C C C C C C C C C [51] T T T T T T T T T T T T T T T T T T T T T T T T T [76] T T T T T T T T T T T T T T T T T T T T T T T T T Levels: C T data type: factor levels : levels C T 2 > class(d) # d data.frame [1] "data.frame" > class(d$y) # y integer [1] "integer" > class(d$) # numeric [1] "numeric" > class(d$f) # f factor [1] "factor" kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 :? :? data frame summary()! Generate Data Plots! Always! > summary(d) y f Min. : 2.00 Min. : C:50 1st Qu.: st Qu.: T:50 Median : 8.00 Median : Mean : 7.83 Mean : rd Qu.: rd Qu.: Ma. :15.00 Ma. : > plot(d$, d$y, pch = c(21, 19)[d$f]) > legend("topleft", legend = c("c", "T"), pch = c(21, 19)) kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

4 kubostat2017c p.4 :? GLM f (bo-whisker plot) > plot(d$f, d$y) # note that d$f is! 3. GLM log link kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 GLM GLM how to specify linear regression model, a GLM GLM Generalized Linear Model (GLM) probability distribution?? link function? probability distribution : Gaussian distribution : e.g., β 1 + β 2 i link function : : ( ) + ( ) i identity link function kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 GLM (?) GLM how to specify model, a GLM GLM : (response variable) : () (): ( ) = (, intercept) + ( 1) ( 1) + ( 2) ( 2) + ( 3) ( 3) probability distribution Poisson distribution : : e.g., β 1 + β 2 i link function log link function : + kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

5 kubostat2017c p.5 GLM how to specify logistic regression model, a GLM GLM logistic GLM R (GLM) probability distribution binomial distribution : : e.g., β 1 + β 2 i link function : logit yi i probability distribution random number generation GLM fitting GLM ( ) rbinom() glm(family = binomial) rbinom() glm(family = binomial) rpois() glm(family = poisson) rnbinom() glm.nb() in library(mass) ( ) rgamma() glm(family = gamma) rnorm() glm(family = gaussian) glm() GLM kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 GLM GLM eponential function? seed number y i follows the Poisson distribution y i λ i p(y i λ i ) = λyi i ep( λ i ) y i! mean i λ i? λ i = ep(β 1 + β 2 i ) parameter coefficient β 1 β 2 ( ) body size no f i, for simplicity i i f i i λi λ i = ep(β 1 + β 2 i ) {β 1, β 2} = { 2, 0.8} {β 1, β 2} = { 1, 0.4} i i kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 GLM GLM ( ) GLM a statistical model for this eample mean i λ i λ i = ep(β 1 + β 2 i ) log link function log(λ i ) log link function log( ) = = β 1 + β 2 i probability distribution Poisson distribution : : β 1 + β 2 i link function log link function : log kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

6 kubostat2017c p.6 R GLM R GLM glm() function 4. R GLM > d y f C C C T T Is that all?! > fit <- glm(y ~, data = d, family = poisson) kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 R GLM R GLM glm() output glm() > fit <- glm(y ~, data = d, family = poisson) all: glm(formula = y ~, family = poisson, data = d) Coefficients: (Intercept) ( z):? link : z (y)? family:? Degrees of Freedom: 99 Total (i.e. Null); Null Deviance: 89.5 Residual Deviance: 85 AIC: Residual kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 R GLM R GLM glm() > summary(fit) Call: glm(formula = y ~, family = poisson, data = d) Deviance Residuals: Min 1Q Median 3Q Ma Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) ( ) kubostat2017c ( (c) / 47 ( ) β 2 (Estimate , SE ) (Estimate 1.29, SE 0.364) β p p ˆβ p 0.5 ˆβ ( : ) kubostat2017c ( (c) / 47

7 kubostat2017c p.7 R GLM (?) β 2 (Estimate , SE ) (Estimate 1.29, SE 0.364) β %? kubostat2017c ( (c) / 47 model prediction R GLM > fit <- glm(y ~, data = d, family = poisson)... Coefficients: (Intercept) > plot(d$, d$y, pch = c(21, 19)[d$f]) # data > p <- seq(min(d$), ma(d$), length = 100) > lines(p, ep( * p)) the figure shows the relationship between model prediction and data kubostat2017c ( (c) / 47 GLM incorporate the fertilization effects in GLM f i GLM 5. GLM + seed number y i follows the Poisson distribution y i λ i mean i λ i fertilization effects β 3 dummy variable f i p(y i λ i ) = λyi i ep( λ i ) y i! λ i = ep(β 1 + β 2 i + β 3 d i ) d i = coefficient { 0 (f i = C ) 1 (f i = T ) kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 output glm(y + f,...) GLM + f model prediction GLM > summary(glm(y ~ + f, data = d, family = poisson))...( )... Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) ft ( ) > plot(d$, d$y, pch = c(21, 19)[d$f]) # data > p <- seq(min(d$), ma(d$), length = 100) > lines(p, ep( * p), col = "blue", lwd = 3) # C > lines(p, ep( * p ), col = "red", lwd = 3) # T kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47

8 kubostat2017c p.8 GLM multiple s GLM model interpretation depends on link function λi f i = C: λ i = ep( i ) f i = T: λ i = ep( i 0.032) control = ep( i ) ep( 0.032) fertilization i ep( 0.032)! kubostat2017c ( (c) / 47 λi (A) log link function i (B) identity link function λ = ep(β 1 + β 2 + ) λ = β 1 + β 2 + multiplicative additive i kubostat2017c ( (c) / 47 probability distribution GLM: GLM link function GLM statistaical models appeared in the class y log y 階層ベイズモデル もっと自由な統計モデリングを! 線形モデルの発展 (HBM) 一般化線形混合モデル 個体差 場所差といった変量効果をあつかいたい 一般化線形モデル 正規分布以外の確率分布をあつかいたい (GLMM) 推定計算方法 MCMC 最尤推定法 (GLM) 最小二乗法 線形モデル kubostat2017c ( (c) / 47 kubostat2017c ( (c) / 47 GLM statistaical models appeared in the class The development of linear models Hierarchical Bayesian Model Be more fleible Generalized Linear Mied Model (GLMM) Incoporating random effects such as individuality parameter estimation MCMC MLE Generalized Linear Model (GLM) Always normal distribution? That's non-sense! MSE Linear model Kubo Doctrine: Learn the evolution of linear-model family, firstly! kubostat2017c ( (c) / 47 y Too simple? GLM The net topic (A) k = 1 (B) k = Too comple? Model selection and statistical test kubostat2017c ( (c) / 47

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

講義のーと : データ解析のための統計モデリング. 第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

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

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

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

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

一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM .. ( ) (2) GLMM kubo@ees.hokudai.ac.jp I http://goo.gl/rrhzey 2013 08 27 : 2013 08 27 08:29 kubostat2013ou2 (http://goo.gl/rrhzey) ( ) (2) 2013 08 27 1 / 74 I.1 N k.2 binomial distribution logit link function.3.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

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

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

講義のーと : データ解析のための統計モデリング. 第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

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/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

講義のーと : データ解析のための統計モデリング. 第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

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

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

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

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

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

/ 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

今回 次回の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ 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

/ 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

(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

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

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

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

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

第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

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

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

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

,, 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

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

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乗法

最小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

第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

/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

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

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

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

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

²¾ÁÛ¾õ¶·É¾²ÁË¡¤Î¤¿¤á¤Î¥Ñ¥Ã¥±¡¼¥¸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

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

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

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 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

% 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

こんにちは由美子です

こんにちは由美子です 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

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

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

Isogai, T., Building a dynamic correlation network for fat-tailed financial asset returns, Applied Network Science (7):-24, 206,

Isogai, T., Building a dynamic correlation network for fat-tailed financial asset returns, Applied Network Science (7):-24, 206, H28. (TMU) 206 8 29 / 34 2 3 4 5 6 Isogai, T., Building a dynamic correlation network for fat-tailed financial asset returns, Applied Network Science (7):-24, 206, http://link.springer.com/article/0.007/s409-06-0008-x

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

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

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó 2 2015 4 20 1 (4/13) : ruby 2 / 49 2 ( ) : gnuplot 3 / 49 1 1 2014 6 IIJ / 4 / 49 1 ( ) / 5 / 49 ( ) 6 / 49 (summary statistics) : (mean) (median) (mode) : (range) (variance) (standard deviation) 7 / 49

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

Stata 11 Stata ROC whitepaper mwp anova/oneway 3 mwp-042 kwallis Kruskal Wallis 28 mwp-045 ranksum/median / 31 mwp-047 roctab/roccomp ROC 34 mwp-050 s

Stata 11 Stata ROC whitepaper mwp anova/oneway 3 mwp-042 kwallis Kruskal Wallis 28 mwp-045 ranksum/median / 31 mwp-047 roctab/roccomp ROC 34 mwp-050 s BR003 Stata 11 Stata ROC whitepaper mwp anova/oneway 3 mwp-042 kwallis Kruskal Wallis 28 mwp-045 ranksum/median / 31 mwp-047 roctab/roccomp ROC 34 mwp-050 sampsi 47 mwp-044 sdtest 54 mwp-043 signrank/signtest

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

回帰分析 単回帰

回帰分析 単回帰 回帰分析 単回帰 麻生良文 単回帰モデル simple regression model = α + β + u 従属変数 (dependent variable) 被説明変数 (eplained variable) 独立変数 (independent variable) 説明変数 (eplanator variable) u 誤差項 (error term) 撹乱項 (disturbance term)

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

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

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

DAA12

DAA12 Observed Data (Total variance) Predicted Data (prediction variance) Errors in Prediction (error variance) Shoesize 23 24 25 26 27 male female male mean female mean overall mean Shoesize 23 24 25 26 27

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

: (EQS) /EQUATIONS V1 = 30*V F1 + E1; V2 = 25*V *F1 + E2; V3 = 16*V *F1 + E3; V4 = 10*V F2 + E4; V5 = 19*V99

: (EQS) /EQUATIONS V1 = 30*V F1 + E1; V2 = 25*V *F1 + E2; V3 = 16*V *F1 + E3; V4 = 10*V F2 + E4; V5 = 19*V99 218 6 219 6.11: (EQS) /EQUATIONS V1 = 30*V999 + 1F1 + E1; V2 = 25*V999 +.54*F1 + E2; V3 = 16*V999 + 1.46*F1 + E3; V4 = 10*V999 + 1F2 + E4; V5 = 19*V999 + 1.29*F2 + E5; V6 = 17*V999 + 2.22*F2 + E6; CALIS.

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

Studies of Foot Form for Footwear Design (Part 9) : Characteristics of the Foot Form of Young and Elder Women Based on their Sizes of Ball Joint Girth

Studies of Foot Form for Footwear Design (Part 9) : Characteristics of the Foot Form of Young and Elder Women Based on their Sizes of Ball Joint Girth Studies of Foot Form for Footwear Design (Part 9) : Characteristics of the Foot Form of Young and Elder Women Based on their Sizes of Ball Joint Girth and Foot Breadth Akiko Yamamoto Fukuoka Women's University,

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

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

X X X Y R Y R Y R MCAR MAR MNAR Figure 1: MCAR, MAR, MNAR Y R X 1.2 Missing At Random (MAR) MAR MCAR MCAR Y X X Y MCAR 2 1 R X Y Table 1 3 IQ MCAR Y I

X X X Y R Y R Y R MCAR MAR MNAR Figure 1: MCAR, MAR, MNAR Y R X 1.2 Missing At Random (MAR) MAR MCAR MCAR Y X X Y MCAR 2 1 R X Y Table 1 3 IQ MCAR Y I (missing data analysis) - - 1/16/2011 (missing data, missing value) (list-wise deletion) (pair-wise deletion) (full information maximum likelihood method, FIML) (multiple imputation method) 1 missing completely

More information

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

今日の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ (危 1) 時系列データの GLM あてはめ (危 2) 時系列Yt 時系列 Xt 各時刻の個体数 気温 とか 時系列データ解析でよく見る あぶない モデリング 久保拓弥 (北海道大 環境科学) 1/56 今日の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ (危 1) 時系列データの GLM あてはめ (危 2) 時系列Yt 時系列 Xt 各時刻の個体数 気温 とか (危 1) 時系列データを GLM で (危 2) 時系列Yt 時系列 Xt 相関は因果関係ではない 問題の一部

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

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

みっちりGLM

みっちりGLM 2015/3/27 12:00-13:00 日本草地学会若手 R 統計企画 ( 信州大学農学部 ) R と一般化線形モデル入門 山梨県富士山科学研究所 安田泰輔 謝辞 : 日本草地学会若手の会の皆様 発表の機会を頂き たいへんありがとうございます! 茨城大学 学生時代 自己紹介 ベータ二項分布を用いた種の空間分布の解析 所属 : 山梨県富士山科学研究所 最近の研究テーマ 近接リモートセンシングによる半自然草地のモニタリング手法開発

More information

A Nutritional Study of Anemia in Pregnancy Hematologic Characteristics in Pregnancy (Part 1) Keizo Shiraki, Fumiko Hisaoka Department of Nutrition, Sc

A Nutritional Study of Anemia in Pregnancy Hematologic Characteristics in Pregnancy (Part 1) Keizo Shiraki, Fumiko Hisaoka Department of Nutrition, Sc A Nutritional Study of Anemia in Pregnancy Hematologic Characteristics in Pregnancy (Part 1) Keizo Shiraki, Fumiko Hisaoka Department of Nutrition, School of Medicine, Tokushima University, Tokushima Fetal

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

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

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

インターネットを活用した経済分析 - フリーソフト 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

自由集会時系列part2web.key

自由集会時系列part2web.key spurious correlation spurious regression xt=xt-1+n(0,σ^2) yt=yt-1+n(0,σ^2) n=20 type1error(5%)=0.4703 no trend 0 1000 2000 3000 4000 p for r xt=xt-1+n(0,σ^2) random walk random walk variable -5 0 5 variable

More information

浜松医科大学紀要

浜松医科大学紀要 On the Statistical Bias Found in the Horse Racing Data (1) Akio NODA Mathematics Abstract: The purpose of the present paper is to report what type of statistical bias the author has found in the horse

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

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0) E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2

More information

BR001

BR001 BR001 Stata 11 Stata Stata11 whitepaper mwp 3 mwp-027 22 mwp-028 / 40 mwp-001 logistic/logit 50 mwp-039 logistic/logit postestimation 60 mwp-040 margins 74 mwp-029 regress 90 mwp-037 regress postestimation

More information

RとExcelを用いた分布推定の実践例

RとExcelを用いた分布推定の実践例 R Excel 1 2 1 2 2011/11/09 ( IMI) R Excel 2011/11/09 1 / 12 (1) R Excel (2) ( IMI) R Excel 2011/11/09 2 / 12 R Excel R R > library(fitdistrplus) > x fitdist(x,"norm","mle")

More information

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó 2 212 4 13 1 (4/6) : ruby 2 / 35 ( ) : gnuplot 3 / 35 ( ) 4 / 35 (summary statistics) : (mean) (median) (mode) : (range) (variance) (standard deviation) 5 / 35 (mean): x = 1 n (median): { xr+1 m, m = 2r

More information

こんにちは由美子です

こんにちは由美子です Sample size power calculation Sample Size Estimation AZTPIAIDS AIDSAZT AIDSPI AIDSRNA AZTPr (S A ) = π A, PIPr (S B ) = π B AIDS (sampling)(inference) π A, π B π A - π B = 0.20 PI 20 20AZT, PI 10 6 8 HIV-RNA

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

スライド 1

スライド 1 欠測のあるデータにおける population-averaged 及び subject-specific アプローチの性能評価 多田圭佑サノフィ株式会社 研究開発部門医薬開発本部 統計解析 プログラミング部統計解析室 土居正明駒嵜弘 Performance evaluation of population-averaged and subject-specific approach with missing

More information

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble 25 II 25 2 6 13:30 16:00 (1),. Do not open this problem boolet until the start of the examination is announced. (2) 3.. Answer the following 3 problems. Use the designated answer sheet for each problem.

More information

(pdf) (cdf) Matlab χ ( ) F t

(pdf) (cdf) Matlab χ ( ) F t (, ) (univariate) (bivariate) (multi-variate) Matlab Octave Matlab Matlab/Octave --...............3. (pdf) (cdf)...3.4....4.5....4.6....7.7. Matlab...8.7.....9.7.. χ ( )...0.7.3.....7.4. F....7.5. t-...3.8....4.8.....4.8.....5.8.3....6.8.4....8.8.5....8.8.6....8.9....9.9.....9.9.....0.9.3....0.9.4.....9.5.....0....3

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

σ t σ t σt nikkei HP nikkei4csv H R nikkei4<-readcsv("h:=y=ynikkei4csv",header=t) (1) nikkei header=t nikkei4csv 4 4 nikkei nikkei4<-dataframe(n

σ t σ t σt nikkei HP nikkei4csv H R nikkei4<-readcsv(h:=y=ynikkei4csv,header=t) (1) nikkei header=t nikkei4csv 4 4 nikkei nikkei4<-dataframe(n R 1 R R R tseries fseries 1 tseries fseries R Japan(Tokyo) R library(tseries) library(fseries) 2 t r t t 1 Ω t 1 E[r t Ω t 1 ] ɛ t r t = E[r t Ω t 1 ] + ɛ t ɛ t 2 iid (independently, identically distributed)

More information

1 R Windows R 1.1 R The R project web R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 9

1 R Windows R 1.1 R The R project web   R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 9 1 R 2007 8 19 1 Windows R 1.1 R The R project web http://www.r-project.org/ R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 95 and later ] [base] 2.5.1 R - 2.5.1 for Windows R

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

Microsoft PowerPoint - Rを利用した回帰分析.pptx

Microsoft PowerPoint - Rを利用した回帰分析.pptx R を利 した回帰分析 中央水産研究所 岡村 寛 水産資源学における統計解析 漁業 調査データ解析 CPUE 標準化 資源のトレンド 体 組成のモード分解 成 式などの生物パラメータの推定 資源評価モデルによる個体群評価 ほとんどがパラメータの推定問題 今日の概要 前半 ( 岡村 ) 単回帰 重回帰モデル一般化線形 ( 混合 加法 ) モデルプロダクションモデル,VPA など 最小二乗法 最尤法 ベイズ推定

More information

4 OLS 4 OLS 4.1 nurseries dual c dual i = c + βnurseries i + ε i (1) 1. OLS Workfile Quick - Estimate Equation OK Equation specification dual c nurser

4 OLS 4 OLS 4.1 nurseries dual c dual i = c + βnurseries i + ε i (1) 1. OLS Workfile Quick - Estimate Equation OK Equation specification dual c nurser 1 EViews 2 2007/5/17 2007/5/21 4 OLS 2 4.1.............................................. 2 4.2................................................ 9 4.3.............................................. 11 4.4

More information

Dirichlet process mixture Dirichlet process mixture 2 /40 MIRU2008 :

Dirichlet process mixture Dirichlet process mixture 2 /40 MIRU2008 : Dirichlet Process : joint work with: Max Welling (UC Irvine), Yee Whye Teh (UCL, Gatsby) http://kenichi.kurihara.googlepages.com/miru_workshop.pdf 1 /40 MIRU2008 : Dirichlet process mixture Dirichlet process

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

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