DAA04

Similar documents
DAA03

DAA02

DAA12

DAA09

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

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

「統 計 数 学 3」

plot type type= n text plot type= n text(x,y) iris 5 iris iris.label >iris.label<-rep(c(,, ),rep(50,3)) 2 13 >plot(iris[,1],iris

DAA01


スライド 1

再下版島_ (特集1).indd

INTERVIEW

.{...iNo.25.j

Interview 2 3

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

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

0-Ł\04†E01.pdf


2 Part A B C A > B > C (0) 90, 69, 61, 68, 6, 77, 75, 20, 41, 34 (1) 8, 56, 16, 50, 43, 66, 44, 77, 55, 48 (2) 92, 74, 56, 81, 84, 86, 1, 27,


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


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

u u u 1 1

バイオインフォマティクス特論12

特別支援1~8ページ.PDF


2 3 2

300 10


untitled

(1) (2) (3) (4) (5) (6) (7) (8)


14 12 ( ) 2004

第1 予算編成の基本的な考え方

0

untitled


2

0.表紙


,

-2-

総務委員会会議録



5 LATEX 2ε 2010

宿題の解答

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

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

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


<4D F736F F F696E74202D BD95CF97CA89F090CD F6489F18B4195AA90CD816A>

( )/2 hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1

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

Microsoft PowerPoint - R-intro-02.ppt

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

31 gh gw

統計研修R分散分析(追加).indd

バイオインフォマティクス特論4

R pdf

第122号.indd

スライド 1


Microsoft PowerPoint - 統計科学研究所_R_重回帰分析_変数選択_2.ppt

PowerPoint Presentation

ZNR ( ) 8/20 µs 8/20 µs (A) (V) ACrms (V) C (V) max.(v) Ip (A) /0 µs 2 ms ERZV ERZV


A4“û”q

HA TO MARK

Q Q Q Q 2

untitled

¸×ÌÞÆ�°½-No.94-’ÓŠ¹

スライド 1

5 Armitage x 1,, x n y i = 10x i + 3 y i = log x i {x i } {y i } 1.2 n i i x ij i j y ij, z ij i j 2 1 y = a x + b ( cm) x ij (i j )

メディシノバ・インク

_FH28_J.qxd

homes10_P _shimizu_intN_sai.indd

.....Z...^.[ \..

untitled

yamadaiR(cEFA).pdf

R int num factor character 1 2 (dichotomous variable) (trichotomous variable) 3 (nominal scale) M F 1 2 coding as.numeric() as.integer() 2

知能科学:ニューラルネットワーク

知能科学:ニューラルネットワーク


統計学のポイント整理


1 R ID 1. ID Before After 1 X 1 Y 1 2 X 2 Y n 1 X n 1 Y n 1 n X n Y n. ID Group Measure. 1 1 Y 1... n 1 1 Y n1 n Y n n 0 Y n 1 E

R による統計解析入門

1 15 R Part : website:

R-introduction.R

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

h1-h4

NewsLetter-No2

学会誌カラー(目次)/目次13‐1月

3 M=8.4 M=3 M=.8 M=4.7 M=5.6 M=3 M=5. M=4.6 M=7 M=3 M= (interaction) 4 - A - B (main effect) - A B (interaction)

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

最小2乗法

HIv9_P02P03

Transcription:

# plot(x,y, ) plot(dat$shoesize, dat$h, main="relationship b/w shoesize and height, xlab = 'shoesize, ylab='height, pch=19, col='red ) Relationship b/w shoesize and height height 150 160 170 180 21 22 23 24 25 26 27 28 shoesize

txt = paste("r =", round(cor(dat$shoesize,dat$h), 4)) text(22, 175, txt, cex = 1.5) Relationship b/w shoesize and height height 150 160 170 180 r = 0.874 21 22 23 24 25 26 27 28 shoesize

abline: abline(h = mean(dat$h), col='blue'); abline(v = mean(dat$shoesize), col='green'); H V height 150 160 170 180 r = 0.874 mean height Relationship b/w shoesize and height mean shoesize 21 22 23 24 25 26 27 28 shoesize

abline(lm(dat$h~dat$shoesize), lty=2, lwd=2) Relationship b/w shoesize and height height 150 160 170 180 r = 0.874 21 22 23 24 25 26 27 28 shoesize

plot(dat[dat$gender=='f',]$shoesize, dat[dat$gender=='f',]$h, main="relationship b/w shoesize and height", xlab='shoesize', ylab='height', cex.lab=1.5, pch=19, col='blue', xlim=c(20,29), ylim=c(140,190)) Relationship b/w shoesize and height height 140 150 160 170 180 190 Female Male 20 22 24 26 28 shoesize

plot(dat[dat$gender=='m',]$shoesize, dat[dat$gender=='m',]$h, main="relationship b/w shoesize and height", xlab='shoesize', ylab='height', cex.lab=1.5, pch=15, col='green', xlim=c(20,29), ylim=c(140,190)) Relationship b/w shoesize and height height 140 150 160 170 180 190 Female Male 20 22 24 26 28 shoesize

Relationship b/w shoesize and height height 140 150 160 170 180 190 Female Male 20 22 24 26 28 shoesize

plot(dat[dat$gender=='f',]$shoesize, dat[dat$gender=='f',]$h, main="relationship b/w shoesize and height", xlab='shoesize', ylab='height', cex.lab=1.5, pch=19, col='blue', xlim=c(20,29), ylim=c(140,190)) points(dat[dat$gender=='m',]$shoesize,dat[dat$gender=='m',]$h, pch = 15, col = 'green') legend("topleft", c('female','male'), pch =c(19,15), col = c('blue','green'), cex = 1.5) points: lines height 140 150 160 170 180 190 Female Male Relationship b/w shoesize and height 20 22 24 26 28 shoesize

dat<-read.csv("http://www.matsuka.info/data_folder/tdkreg01.csv") plot(dat, pch=20, col='blue') 100 140 180 50 100 150 200 material 2 4 6 8 10 100 140 180 price design 10 30 50 70 50 100 150 200 sales 2 4 6 8 10 10 20 30 40 50 60 70

plot(dat.pca, pch = rownames(dat.pca), cex = 1.7, col = 'blue ) 40 50 60 70 80 90 > dat.pca writing thesis interview a 88 70 65 b 52 78 88 c 77 87 89 d 35 40 43 e 60 43 40 f 97 95 91 g 48 62 83 h 66 66 65 i 78 50 48 40 50 60 70 80 90 d d writing c b g h i e b c g h i e a a f f e d d e i i a h g b thesis b g ha c c f f e d e d i i a h a h interview c g b g b f f c 40 50 60 70 80 90 40 50 60 70 80 90 40 50 60 70 80 90 40 50 60 70 80 90

( "% " = $ %&' )

! = # $ = $ % & % + $ ( & ( + + $ * & * = + $, &, *,-%! = # $ = $ % & % + $ ( & ( + + $ * & * =. 0 /0 $1 $ 2$

! " # = %&' ( = ) ( + # = ) ( ) ( # %&' ( = (, + # -, + ( # + # - # + + ( 0 + # - 0 = 1 = 1 2 = 1 2 ( 2 # 2( 2 + + + # - 2 = 1 2 ( 2 # - 2 2+ 1 = ) ( # 2+ 5 + + + # 5 1 = ) ( # ) ( # 2 ( 2-2 + 1 2 + # - 2 0 23, ( 2 # - 2 2( 2 +- 2 + + # - 2 ( 2 + # - 2

! " = $%&&'( = ()*

! $ "# = &'( ), + =, ), ), +, + =, )+, ) +, + ) +, ), + =, )+, ), +, ), + +, ), + =, )+, ), +! $ "" = &'( ), ) =, )), ), ) =, ) $, ) $ =! $ " = (/0 )

: cov(x,y) = cov(y,x) cov(x,x) = var(x) cov(ax, by) = ab*cov(x,y) cov(a+x, b+y) = cov(x,y) cov(x, Y+Z) = cov(x,y)+cov(x,z) cov(σx, ΣY)=ΣΣcov(X,Y)

" #$ = &'(( ), + = &',(), +),/( ),/((+) = &',(), +) 0 # 1 0 $ 1 = &',(), +) 0 # 0 $

( "% " = $ %&' ( * +, = $ %&' ) ( /01 = $ %&' " % ", ) 1 /01(", 2) 4 = * + * 8 " % " 2 % 32 ) 1 9 = : " ; +, = : " 9, = : " : ", ; +8 = : " : " : 2 : 2 /01(", 2) < = ;, + ;, 8 )

! " # = % ) *&,- # &'(. 1 ). 1! " # = % &'( ) = % &'( ) = % &'( ) = % &'( ) * &,- # = % &'( ) * & 1 # + % &'( ) * & + 1 1,- # = % &'( ),- 1 # 2,- 1 % &'( * & 1 # +.,- 1 # 2,- 1.,- 1 * & 1 #.,- 1 # ). 1 3! # " = % 3 * & 1 #.3,- 1 # 3! " # = 4 " # &'( # =.4 # ".45, =.4 # ". 4 " #. # =. 1 4 " * & + 1,- 1 # * & 1

( ) = E ( X 1 ) + E ( X 2 ) +!+ E ( X n ) = µ + µ +!+ µ = nµ ( ) = var( X 1 ) + var( X 2 ) +!+ var( X n ) = σ 2 +σ 2 +!+σ 2 = nσ 2 E X 1 + X 2 +!+ X n var X 1 + X 2 +!+ X n ( ) = E X 1 + X 2 +!+ X # n E X var X! " ( ) = var! # " n X 1 + X 2 +!+ X n n $! & = E X $! 1 # &+!+ E X $ n # & = nµ % " n % " n % n = µ $ & = 1 % n var X 2 1 ( ) +!+ 1 n var ( X 2 n) = nσ 2 = σ 2 n 2 n

dat<-read.table("http://www.matsuka.info/data_folder/aov01.txt",header=t) > head(dat) shoesize h gender affil club 1 27.0 181.4 M psy tetsudo 2 26.5 170.8 M cs tennis 3 27.5 182.3 M psy karate 4 26.5 166.8 M psy tennis 5 23.5 153.2 F cs tetsudo 6 23.0 151.6 F psy tennis > summary(dat) shoesize h gender affil club Min. :21.00 Min. :145.0 F:36 cs :35 karate :24 1st Qu.:23.50 1st Qu.:157.2 M:34 psy:35 tennis :23 Median :24.50 Median :164.0 tetsudo:23 Mean :24.82 Mean :164.1 3rd Qu.:26.38 3rd Qu.:170.9 Max. :28.00 Max. :182.3

> mean(dat$shoesize) [1] 24.82143 > mean(dat$h) [1] 164.1443 > var(dat$shoesize) [1] 2.652433 > var(dat$h) [1] 83.97352 > cov(dat[,1:2]) shoesize h shoesize 2.652433 13.05802 h 13.058023 83.97352 > cor(dat[,1:2]) shoesize h shoesize 1.0000000 0.8749517 h 0.8749517 1.0000000

)! "# = % &'( ) "* & + & = "* ( + ( + "* - + - + + "* ) + ) = " % * & + & = "! "# &'( > dat.meter = dat[,1:2]*0.01 > mean(dat.meter$h) [1] 1.641443 > mean(dat$h)*0.01 [1] 1.641443 > mean(dat$h) [1] 164.1443

*! " + $ = & '() * + ', ' + $ &, ' = & + ', ' + $ - 1 =! " + $ '() * '() > dat.h.ext5 = dat$h+5 [1] 160 153 155 181 170 167 153 163 157 169 > mean(dat.h.ext5) [1] 169.1443 > mean(dat$h) [1] 164.1443 > mean(dat$h)+5 [1] 169.1443

*! " + $ = & + ', " = + ' + & - ', $ = - ' =! " +! $ '() * '() > handshoe = dat$h+dat$shoesize > mean(handshoe) [1] 188.9657 > mean(dat$h)+mean(dat$shoesize) [1] 188.9657

! "# + % =! "# +! % = "! # + % > dat.h.meter.ext5 = dat$h*0.01+0.05 > mean(dat.h.meter.ext5) [1] 1.691443 > 0.01*mean(dat$h)+0.05 [1] 1.691443

!"# $% = ' $% ' $% ) > var(dat.meter$h) [1] 0.008397352 = ' $% $* ) = ' $ ) % * ) = $ ) ' % * ) = $ )!"# % > var(dat$h)*(0.01^2) [1] 0.008397352

!"# $ + & = ( $ + & ( $ + & = ( $ + & + + & * = ( $ + * =!"# $ * > var(dat.h.ext5) [1] 83.97352 > var(dat$h) [1] 83.97352

!"# $% + ' = ) $% + ' ) $% + ' + > var(dat.h.meter.ext5) [1] 0.008397352 > var(dat$h)*(0.01^2) [1] 0.008397352 = ) $% + ' $, + ' + = ) $ % +, + = $ + ) %, + = $ +!"# %

!"# $ + & = ( $ + & * + + *, - > var(handshoe) [1] 112.742 = ( $ + & - 2 $ + & * + + *, + * + + *, - = ( $ - + 2$& + & - + 2$* + 2$*, 2&* + 2&*, + * + - + 2* + *, + *, - = ( $ - 2$* + + * + - + & - 2&*, + *, - + 2$& 2$*, 2&* + + 2* + *, = ( $ * + - + ( & *, - + 2/01 $, & > var(dat$h)+var(dat$shoesize)+2*cov(dat$h,dat$shoesize) [1] 112.742

!"# $, $ = ' $$ ' $ ' $ = ' $ ) ' $ ) = *+, $ > cov(dat$h,dat$h) [1] 83.97352 > var(dat$h) [1] 83.97352

!"# $%, '( = * $% * $% '( * '( = * $'%( * $% '( * '( $% + * $% * '( = $'* %( $'* % * ( $'* % * ( + $'* % * ( = $' * %( * % * ( = $' -!"# %, ( > cov(dat.meter$h,dat.meter$shoesize) [1] 0.001305802 > (0.01*0.01)*cov(dat$h,dat$shoesize) [1] 0.001305802

!"# $ + &, ( + ) = + $ + & + $ + & ( + ) + ( + ) = + $ + & ( + ) + $ + & ( + ) + ( + ) $ + & + + $ + & + ( + ). = + $ + & ( + ) + $ + & + ( + ) + $ + & + ( + ) + + $ + & + ( + ) = + $( + (& + $) + &) $ + + & ( + + ) = $( + (+ & + $+ ) + + &) $( (+ & $+ ) + & + ) = + &) + & + ) =!"# &, ) > cov(dat.h.ext5,dat.ss.ext1) [1] 13.05802 > cov(dat$h,dat$shoesize) [1] 13.05802

!"# $, & + ( = * $ * $ & + ( * & + ( = * $ & + ( * $ & + ( * & + ( $ + * $ * & + (. = * $ & + ( * $ * & + ( * $ * & + ( + * $ * & + ( = * $ & + ( * $ * & + ( = * $& + $( * $ * & + * $ * ( = * $& * $ * & + * $( * $ * ( =!"# $, & +!"# $, ( > cov(dat$h,handshoe) [1] 97.03154 > cov(dat$h,dat$shoesize)+cov(dat$h,dat$h) [1] 97.03154

!"# $1 + $2, )1 + )2 = + $1 + $2 + $1 + $2 )1 + )2 + )1 + )2 = + $1 + $2 )1 + )2 + $1 + $2 + )1 + )2 = + $1)2 + $1)2 + $2)1 + $2)2 + $1 + )1 + + $1 + )2 + + $2 + -1 + + $2 + )2 = + $1)1 + $1 + )1 + + $1)2 + $1 + )2 + + $2)1 + $2 + )1 + + $2)2 + $2 + )2 =!"# $1, )1 +!"# $1, )2 +!"# $2, )1 +!"# $2, )2 =..!"# $ / + ) 0 / 0 123. $ / =..!"# $ / + ) 0 =. 123 $ / +..!"# $ / + $ 0 / / 0 / / 04/ =. 123 $ / +..!"# $ / + $ 0 / / 05/