Size: px
Start display at page:

Download ""

Transcription

1 R EZR *1 1 R R [ ] R Rgui EZR (cross-over design) F Welch t Wilcoxon Wilcoxon (Kruskal-Wallis) Fligner-Killeen Dunnett *1 1

2 minato-nakazawa@umin.net 1 R R MS Windows Mac OS Linux OS *2 Windows Mac OS Linux tar ubuntu R R CRAN (The Comprehensive R Archive Network) CRAN *3 *4 *5 1.1 R [ ] Windows CRAN R *6 *7 SDI (separate windows) Macintosh Mac OS X CRAN R pkg Tcl/Tk tools *8 *2 R *3 *4 *5 *6 R win.exe *7 R 1 MDI Rcmdr/EZR *8 2

3 Linux Debian RedHat ubuntu CRAN CRAN R tar.gz./configure make make install 1.2 R Windows Linux Mac OS X \ Windows R Rgui R *9.Rprofile.RData > > R + Windows ESC Source source(" ") Windows / \\ * 10 R bin Windows 7/8 R R R 1.3 Rgui q() < X X <- c(1, 4, 6) function() meansd() *9 (S) R_USER.Renviron R_USER="c:/work" proxy Windows proxy --internet2 R LANGUAGE="en" R MDI SDI --sdi *10 \ 3

4 meansd <- function(x) { list(mean(x), sd(x)) } install.packages() CRAN Rcmdr install.packages("rcmdr", dep=true) dep=true dependency Rcmdr Rcmdr TRUE T T TRUE? t t.test?t.test <<- 1.4 EZR R John Fox Rcmdr R Commander R Rcmdr EZR * 11 EZR Rcmdr install.packages("rcmdrplugin.ezr", dep=true) Rcmdr library(rcmdr) R Commander GUI R Commander library(rcmdr) Rcmdr Commander() detach(package:rcmdr) Rcmdr library(rcmdr) R Commander GUI EZR Rcmdr RcmdrPlugin.EZR OK R (Y) EZR Rcmdr * 12 *11 * Rcmdr RcmdrPlugin.EZR EZR R Windows R EZR 4

5 : 3 3 triplicate duplicate triplicate triplicate % 5% R.A. Fisher t 2 t t (RA) 5

6 2.2 (randomization) Fleiss JL (1986) The design and analysis of clinical experiments (random number table) (random permutation table) 2 Welch t 3 (One-way ANOVA) 2.3 (cross-over design) 2 Hilman BC et al. Intracutaneous immune serum globulin therapy in allergic children., JAMA. 1969; 207(5): A 34 2 B A B * 13 PID Ord.LD LD DL LD L D T0.Alb T1.Alb *13 web 6

7 PID Ord.LD LD T0.Alb T1.Alb 1 LD L LD L LD L LD L LD L DL D DL D DL D DL D DL D LD D LD D LD D LD D LD D DL L DL L DL L DL L DL L ) T0.Alb T1.Alb (0 ) LD Ord.LD OK Univariate Type III Repeated-Measures ANOVA Assuming Sphericity SS num Df Error SS den Df F Pr(>F) (Intercept) e-15 *** Factor1.LD ** Factor2.Ord.LD Factor1.LD:Factor2.Ord.LD Time e-08 *** Factor1.LD:Time e-05 *** Factor2.Ord.LD:Time Factor1.LD:Factor2.Ord.LD:Time Signif. codes: 0 *** ** 0.01 * Pr(>F) Factor1.LD 5% Time 5% Factor1.LD:Time 5% Factor2.Ord.LD Pr(>F) 2 7

8 3 60 kg, 66 kg, 75 kg R mean(c(60,66,75)) ( )/3 Microsoft Excel 10 ID (cm) (kg) Microsoft Excel R Excel *.xls OpenOffice.org calc *.ods Microsoft Excel (F) (T) (*.txt) xls txt (S) OK Excel desample.txt R Dataset 1 8

9 Dataset <- read.delim("desample.txt") Rcmdr a Dataset OK Excel OK Windows R Rcmdr1.4-9 RODBC Excel from Excel, Access, or dbase dataset b Excel a EZR URL b EZR Excel Access dbase 4 survey EZR MASS MASS survey OK survey 237 Sex Wr.Hnd cm NW.Hnd cm W.Hnd Fold 3 Pulse Clap 3 Exer 3 Smoke 4 Height cm M.I cm m Age 9

10 4.1 X R barplot(table(x)) EZR Smoke R fx <- table(x) barplot(matrix(fx,nrow(fx)),beside=f) Rcmdr EZR 100% R px <- table(x)/nrow(x) barplot(matrix(pc,nrow(pc)),horiz=t,beside=f) Rcmdr EZR 4.2 R hist() Sturges right=false R (Age) hist(survey$age) hist(survey$age, breaks=1:8*10, right=false) Rcmdr EZR survey Age Rcmdr EZR R qqnorm() survey (Pulse) qqnorm(survey$pulse) EZR QQ (Kolmogorov-Smirnov ) (stem and leaf plot) 5 10 R stem() stem(survey$pulse) 10

11 EZR Pulse OK Output (box and whisker plot) 1.5 R boxplot() survey (Smoke) (Pulse) boxplot(survey$pulse ~ survey$smoke) EZR survey 0 1 Smoke 1-1.5x x OK survey Smoke Pulse (scatter plot) R plot() plot() pch points() symbols() matplot() matpoints() pairs() text() identify() survey R (Age) (Height) plot(height ~ Age, data=survey) EZR pairs() 5 (1) (2) mean µ X µ = N 11

12 X N X = X 1 + X 2 + X X N X X X = n n * 14 median X = n 1( X 1 ) + n 2 ( X 2 ) n n ( X n ) n 1 + n n n (sorting) central tendency R median() Mode R table(x)[which.max(table(x))] (1) (2) (3) (1) (2) * 15 3 (geometric mean) (harmonic mean) Variability 4 (Inter-Quartile Range; IQR) 1/4, 2/4, 3/4 (quartile) 1/4 3/4 25% 75% 2/4 R fivenum() *14 X X X X X C X *15 12

13 Q1, Q2, Q3 50% (Semi Inter-Quartile Range; SIQR) IQR SIQR (variance) V (X µ) 2 V = N * 16 n n 1 (unbiased variance) V ub (X X) 2 V ub = n 1 R var() (standard deviation) R sd() * 17 Mean±2SD * 18 95% EZR EZR wbc OK 2 t EZR wbc OK NA No outliers were identified. 6 *16 *17 *18 2SD

14 Rothman Greenland p * 19 p p a * 20 Welch R t.test(x,y) * 21 b Wilcoxon R wilcox.test(x,y) 2. R prop.test() 6.1 F X Y n X n Y X Y SX<-var(X) SY<-var(Y) SX>SY F0<-SX/SY 1 DFX<-length(X)-1 2 DFY<-length(Y)-1 F 1-pf(F0,DFX,DFY) F0 var.test(x,y) X C C X var.test(x~c) EZR 2 F X 1 C EZR, OK survey Height Sex OK Output *19 fmsb pvalueplot() *20 shapiro.test() Shapiro-Wilk *21 F F 2 t Welch F Welch 14

15 6.2 Welch t t 0 = E(X) E(Y) / S X /n X + S Y /n Y ϕ t ϕ ϕ = (S X /n X + S Y /n Y ) 2 {(S X /n X ) 2 /(n X 1) + (S Y /n Y ) 2 /(n Y 1)} R t.test(x,y,var.equal=f) var.equal Welch t.test(x,y) X C t.test(x~c) survey t.test(height ~ Sex, data=survey) EZR 2 t Height Sex No (Welch test) OK Output p * 22 stripchart() V <- rnorm(100,10,2) W <- rnorm(60,12,3) X <- c(v, W) C <- as.factor(c(rep("v", length(v)), rep("w", length(w)))) x <- data.frame(x, C) x <- stack(list(v=v, W=W)) names(x) <- c("x", "C") * 23 * 24 stripchart(x~c, data=x, method="jitter", vert=true) Mx <- tapply(x$x, x$c, mean) Sx <- tapply(x$x, x$c, sd) Ix <- c(1.1, 2.1) points(ix, Mx, pch=18, cex=2) arrows(ix, Mx-Sx, Ix, Mx+Sx, angle=90, code=3) *22 R barplot() arrows() *23 EZR *24 EZR X C jitter EZR 15

16 6.3 paired-t 0 R X Y paired-t t.test(x,y,paired=t) t.test(x-y,mu=0) survey R t.test(survey$wr.hnd, survey$nw.hnd, paired=true) 1 cm 1 cm 1 cm Diff.Hnd <- survey$wr.hnd - survey$nw.hnd C.Hnd <- ifelse(abs(diff.hnd)<1, 1, ifelse(diff.hnd>0, 2, 3)) matplot(rbind(survey$wr.hnd, survey$nw.hnd), type="l", lty=1, col=c.hnd, xaxt="n") axis(1, 1:2, c("wr.hnd", "NW.Hnd")) EZR 2 paired t Wr.Hnd NW.Hnd [OK] Output 5% 6.4 Wilcoxon Wilcoxon t Mann-Whitney U Kendall S survey (Height) R wilcox.test(height ~ Sex, data=survey) EZR 2 Mann-Whitney U Height Sex OK Output 6.5 Wilcoxon Wilcoxon t survey Wr.Hnd NW.Hnd 5% R 16

17 wilcox.test(survey$wr.hnd, survey$nw.hnd, paired=true) EZR 2 Wilcoxon 1 Wr.Hnd 2 NW.Hnd [OK] n 2 n C % % (Kruskal-Wallis) 5% % 7.1 X, Y, Z * 25 ID (VG) (cm)(height) 1 X X Z Y HEIGHT VG R > sp <- read.delim(" > summary(aov(height ~ VG, data=sp)) *25 R read.delim() 17

18 Df Sum Sq Mean Sq F value Pr(>F) VG ** Residuals Signif. codes: 0 *** ** 0.01 * * Sum Sq VG Sum Sq VG Residuals Sum Sq Mean Sq (Df) VG Mean Sq Residuals Mean Sq F value F Pr(>F) VG 5% EZR sample2.dat sp [ ] [ ] [ URL ] [ :] sp [ URL] [ ] [OK] [OK] ANOVA [ ] [ ] [ one-way ANOVA)] HEIGHT VG [OK] p VG (Bartlett) R Y C bartlett.test(y~c) * 26 p % EZR (Bartlett ) HEIGHT VG [OK] 2 2 Welch R oneway.test() oneway.test(height ~ VG, data=sp) Welch *26 dat bartlett.test(y~c, data=dat) 18

19 > oneway.test(height ~ VG, data=sp) One-way analysis of means (not assuming equal variances) data: HEIGHT and VG F = , num df = 2.00, denom df = 18.77, p-value = EZR aov oneway.test 7.2 (Kruskal-Wallis) Fligner-Killeen (Kruskal-Wallis) R Y C kruskal.test(y~c) Kruskal-Wallis R i (i = 1, 2,..., k; k ) n i N B i B i = n i {R i /n i (N + 1)/2} 2 B = k i=1 B H = 12 B/{N(N + 1)} H A H H H = B i H 1 A N(N 2 1) H H k 4 4 k = 3 5 H H k 1 R kruskal.test(height ~ VG, data=sp) EZR 3 (Kruskal-Wallis ) VG HEIGHT [OK] Fligner-Killeen Bartlett R fligner.test(height ~ VG, data=sp) EZR 19

20 7.3 (Bonferroni) (Holm) (Scheffé) (Tukey) HSD (Dunnett) (Williams) FDR(False Discovery Rate) HSD * 27 HSD FDR R pairwise.t.test() pairwise.wilcox.test() pairwise.prop.test() FDR fmsb pairwise.fisher.test() Fisher Bonferroni p p.adjust.method="fdr" p p p p Benjamini Y, Hochberg Y: Controlling the false discovery rate: A practical and powerful approach to multiple testing. J. Royal Stat. Soc. B, 57: , Bonferroni Holm FDR k p p(1)<p(2)<...<p(k) Bonferroni p(1) /k p(i) /k Holm p(i) /i fdr p(k) p(k-1) (k-1)/k p p(i)< i/k i R pairwise.*.test() Bonferroni p k Holm i p i fdr i p k/i p FDR Rcmdr EZR R pairwise.t.test(sp$height, sp$vg, p.adjust.method="bonferroni") 2 p * 28 pairwise.wilcox.test(sp$height,sp$vg,p.adjust.method="bonferroni") p.adjust.method p.adjust.method="holm" FDR p.adjust.method="fdr" R R accept *27 t *28 "bonferroni" "bon" pairwise.* data= attach() 20

21 TukeyHSD(aov(HEIGHT ~ VG, data=sp)) HSD EZR 3 one-way ANOVA) HEIGHT VG 2 (post-hoc ) OK TukeyHSD 2 95% Tukey p 5% Z Y > TukeyHSD(AnovaModel.3, "factor(vg)") Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = HEIGHT ~ factor(vg), data = sp, na.action = na.omit) $ factor(vg) diff lwr upr p adj Y-X Z-X Z-Y Dunnett Dunnett (mmhg ) 5, 8, 3, 10, , 12, 30, 16, , 25, 17, 40, 23 Dunnett R bpdown Dunnett bpdown <- data.frame( medicine=factor(c(rep(1,5),rep(2,5),rep(3,5)), labels=c(" "," "," ")), sbpchange=c(5, 8, 3, 10, 15, 20, 12, 30, 16, 24, 31, 25, 17, 40, 23)) summary(res1 <- aov(sbpchange ~ medicine, data=bpdown)) library(multcomp) res2 <- glht(res1, linfct = mcp(medicine = "Dunnett")) confint(res2, level=0.95) summary(res2) multcomp glht() linfct Dunnett multcomp simtest()

22 EZR URL bpdown URL OK URL OK 3 one-way ANOVA) sbpchange medicine 2 (Dunnett ) OK medicine o.placebo 1.usual 2.newdrug Dunnett 3 (Kruskal- Wallis ) sbpchange medicine 2 (post-hoc Steel ) OK Steel 8 MASS survey R require(mass) MASS plot(wr.hnd ~ Height, data=survey) pch=as.integer(sex) EZR MASS survey OK x Height y Wr.Hnd 2 [OK] Sex [OK] [OK] (correlation) (positive correlation) (negative correlation) 22

23 (apparent correlation) * 29 (spurious correlation) * 30 (Pearson s Product Moment Correlation Coefficient) r X Y X Y [ 1, 1] r = 1 r = 1 2 r = 0 X X Y Ȳ r = ni=1 (X i X)(Y i Ȳ) n i=1 (X i X) 2 n i=1 (Y i Ȳ) 2 p p 5% p = % p t 0 = r n 2 1 r 2 n 2 t survey R methos=spearman cor.test(survey$height, survey$wr.hnd) EZR Pearson Height Wr.Hnd Ctrl OK Rcmdr Pearson s product-moment correlation data: survey$height and survey$wr.hnd t = , df = 206, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: sample estimates: cor *29 *

24 r = % [0.50, 0.69] * 31 p-value < 2.2e ρ a X i R i Y i Q i ρ = 1 6 n(n 2 1) n (R i Q i ) 2 10 i=1 T = ρ n 2 1 ρ 2 n 2 t τ τ = (A B) n(n 1)/2 A B R cor.test() method="spearman" method="kendall" EZR Spearman Spearman Kendall OK a ρ r s % (A) (B) (0, 1, 2, 5, 10 µg/l) (0.24, 0.33, 0.54, 0.83, 1.32) y x y = bx + a a b a b f (a, b) = 5 (y i bx i a) 2 i=1 f (a, b) a b *31 95% 24

25 b = x i y i /5 x i /5 y i /5 i=1 i=1 i= x 2 i /5 x i /5 i=1 i=1 a = 5 5 y i /5 b x i /5 i=1 i=1 a b 0.67 * 32 R lm() linear model y <- c(0.24, 0.33, 0.54, 0.83, 1.32) x <- c(0, 1, 2, 5, 10) # res <- lm(y ~ x) # summary(res) # plot(y ~ x) abline(res) # 0.67 ( res$coef[1])/res$coef[2] Call: lm(formula = y ~ x) Residuals: Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) ** x *** --- Signif. codes: 0 *** ** 0.01 * Residual standard error: on 3 degrees of freedom Multiple R-squared: , Adjusted R-squared: F-statistic: 316 on 1 and 3 DF, p-value: a = b = % *32 25

26 (0.9875) Adjusted R-squared p-value µg/l EZR workingcurve [OK] [var1] y numeric Enter [var2] [x] x x y y [OK] y x [OK] VIF survey * 33 R res <- lm(wr.hnd ~ Height, data=survey) summary(res) EZR : survey survey Wr.Hnd Height [OK] *33 survey MASS 26

27 8.4 b a t Y X Y = a 0 + b 0 X + e e 0 σ 2 a a 0 (σ 2 /n)(1 + M 2 /V) M V x Q σ 2 Q/σ 2 (n 2) t 0 (a 0 ) = n(n 2)(a a0 ) (1 + M2 /V)Q (n 2) t a 0 a 0 0 a 0 = 0 t 0 (0) t t 0 (a 0 ) (n 2) t 95% t 97.5% 2 t 0 t 0 t 0 (b) = n(n 2)Vb Q (n 2) t 0 R EZR Pr(> t ) 9 y (saturate) airquality Ozone ppb Solar.R 8:00 12: Langley Wind LaGuardia 7:00 10:00 Temp Month Day R plot(ozone ~ Solar.R, data=airquality) res <- lm(ozone ~ Solar.R, data=airquality) abline(res) 27

28 summary(res) EZR datasets airquality OK airquality x Solar.R y Ozone [OK] Ozone Solar.R OK R EZR Call: lm(formula = Ozone ~ Solar.R, data = airquality) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) ** Solar.R *** --- Signif. codes: 0 *** ** 0.01 * Residual standard error: on 109 degrees of freedom (42 observations deleted due to missingness) Multiple R-Squared: ,Adjusted R-squared: F-statistic: on 1 and 109 DF, p-value: Ozone = Solar.R F p Adjusted R-squared % 10 (2011) Lesson ( (2009) R. [ ] [ ] (1983).. (2003) R.. (2007) R.. (2012) EZR EBM * 34. *

R EZR 2016 10 3 *1 1 R 2 1.1 R [2016 10 3 ]................................ 2 1.2 R................................................ 3 1.3 Rgui......................................... 3 1.4 EZR...................................................

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

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

R Console >R ˆ 2 ˆ 2 ˆ Graphics Device 1 Rcmdr R Console R R Rcmdr Rcmdr Fox, 2007 Fox and Carvalho, 2012 R R 2

R Console >R ˆ 2 ˆ 2 ˆ Graphics Device 1 Rcmdr R Console R R Rcmdr Rcmdr Fox, 2007 Fox and Carvalho, 2012 R R 2 R John Fox Version 1.9-1 2012 9 4 2012 10 9 1 R R Windows R Rcmdr Mac OS X Linux R OS R R , R R Console library(rcmdr)

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

R分散分析06.indd

R分散分析06.indd http://cse.niaes.affrc.go.jp/minaka/r/r-top.html > mm mm TRT DATA 1 DM1 2537 2 DM1 2069 3 DM1 2104 4 DM1 1797 5 DM2 3366 6 DM2 2591 7 DM2 2211 8 DM2

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

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

1 2 Windows 7 *3 Windows * 4 R R Console R R Console ˆ R GUI R R R *5 R 2 R R R 6.1 ˆ 2 ˆ 2 ˆ Graphics Device 1 Rcmdr R Console R Rconsole R --sdi R M

1 2 Windows 7 *3 Windows * 4 R R Console R R Console ˆ R GUI R R R *5 R 2 R R R 6.1 ˆ 2 ˆ 2 ˆ Graphics Device 1 Rcmdr R Console R Rconsole R --sdi R M R John Fox and Milan Bouchet-Valat Version 2.0-1 2013 11 8 2013 11 11 1 R Fox 2005 R R Core Team, 2013 GUI R R R R R R R R R the Comprehensive R Archive Network (CRAN) R CRAN 6.4 R Windows R Rcmdr Mac

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

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

統計研修R分散分析(追加).indd http://cse.niaes.affrc.go.jp/minaka/r/r-top.html > mm mm TRT DATA 1 DM1 2537 2 DM1 2069 3 DM1 2104 4 DM1 1797 5 DM2 3366 6 DM2 2591 7 DM2 2211 8

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

こんにちは由美子です

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

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

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

1.2 R R Windows, Macintosh, Linux(Unix) Windows Mac R Linux redhat, debian, vinelinux ( ) RjpWiki ( RjpWiki Wiki

1.2 R R Windows, Macintosh, Linux(Unix) Windows Mac R Linux redhat, debian, vinelinux ( ) RjpWiki (  RjpWiki Wiki R 2005 9 12 ( ) 1 R 1.1 R R R S-PLUS( ) S version 4( ) S (AT&T Richard A. Becker, John M. Chambers, and Allan R. Wilks ) S S R R S ( ) S GUI( ) ( ) R R R R http://stat.sm.u-tokai.ac.jp/ yama/r/ R yamamoto@sm.u-tokai.ac.jp

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

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

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

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

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

R Commanderを用いたデータ解析

R Commanderを用いたデータ解析 1 / 82 R Commander Kengo NAGASHIMA Laboratory of Biostatistics, Department of Parmaceutical Technochemistry, Josai University 2010 1 5 R R Commander 2 / 82 R, "The Comprehensive R Archive Network (CRAN)",

More information

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

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 2010 R 0 C626 R 2 t Welch t Wilcoxon 3 Fisher McNemar Box-Muller p- Excel R 1 B USB tomo-statim i.softbank.jp R WWW D3 C626 E-Mail d082905 hiroshima-u.ac.jp url http://home.hiroshima-u.ac.jp/d082905/r.html

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

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/17 ` http://www.biwako.shiga-u.ac.jp/sensei/kumazawa/ 6............................................ 5 1............................... 1 1.1 I II III 1 1.2 2 1.3 2 2......................................

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

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

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

I L01( Wed) : Time-stamp: Wed 07:38 JST hig e, ( ) L01 I(2017) 1 / 19

I L01( Wed) : Time-stamp: Wed 07:38 JST hig e,   ( ) L01 I(2017) 1 / 19 I L01(2017-09-20 Wed) : Time-stamp: 2017-09-20 Wed 07:38 JST hig e, http://hig3.net ( ) L01 I(2017) 1 / 19 ? 1? 2? ( ) L01 I(2017) 2 / 19 ?,,.,., 1..,. 1,2,.,.,. ( ) L01 I(2017) 3 / 19 ? I. M (3 ) II,

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

% 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

こんにちは由美子です

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

151021slide.dvi

151021slide.dvi : Mac I 1 ( 5 Windows (Mac Excel : Excel 2007 9 10 1 4 http://asakura.co.jp/ books/isbn/978-4-254-12172-8/ (1 1 9 1/29 (,,... (,,,... (,,, (3 3/29 (, (F7, Ctrl + i, (Shift +, Shift + Ctrl (, a i (, Enter,

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

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

untitled

untitled R 8 2 6 24 M1 M2 1 8 Takahashi, Y., Roberts, B.W., Yamagata, S., & Kijima, N. (in press). Personality traits show differential relations with anxiety and depression in a non-clinical sample. Psychologia:

More information

Debian での数学ことはじめ。 - gnuplot, Octave, R 入門

Debian での数学ことはじめ。 - gnuplot, Octave, R 入門 .... Debian gnuplot, Octave, R mkouhei@debian.or.jp IRC nick: mkouhei 2009 11 14 OOo OS diff git diff --binary gnuplot GNU Octave GNU R gnuplot LaTeX GNU Octave gnuplot MATLAB 1 GNU R 1 MATLAB (clone)

More information

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1 1 1.1 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.2 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1.2.1 t :

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

Vol. 29, No. 2, (2008) FDR Introduction of FDR and Comparisons of Multiple Testing Procedures that Control It Shin-ichi Matsuda Department of

Vol. 29, No. 2, (2008) FDR Introduction of FDR and Comparisons of Multiple Testing Procedures that Control It Shin-ichi Matsuda Department of Vol. 29, No. 2, 125 139 (2008) FDR Introduction of FDR and Comparisons of Multiple Testing Procedures that Control It Shin-ichi Matsuda Department of Information Systems and Mathematical Sciences, Faculty

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

第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

untitled

untitled R (1) R & R 1. R Ver. 2.15.3 Windows R Mac OS X R Linux R 2. R R 2 Windows R CRAN http://cran.md.tsukuba.ac.jp/bin/windows/base/ R-2.15.3-win.exe http://cran.md.tsukuba.ac.jp/bin/windows/base/old/ 3 R-2.15.3-win.exe

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

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

untitled

untitled 005 n X i i 1 5 i 1 5 i 1 X i 3 X i 40 n i1 i i n X i 40 1 005 95 005 testing statistical hypothesis - A B A B 5 ()()() ()()() 3 005 ( ) null hypothesis 5 pp0.01p1 4 005 (1) 1 4 6 () N i 1 ( X i X ) N

More information

Microsoft Word - 研究デザインと統計学.doc

Microsoft Word - 研究デザインと統計学.doc Study design and the statistical basics Originality Accuracy Objectivity Verifiability Readability perfect Interdisciplinary Sciences Health Science 2014.12.25 2 1. 7 2. 7 3. Bias8 4. random sampling8

More information

paper2005b14.dvi

paper2005b14.dvi R BH 1 (2004) 1 (Familywise error rate) Tukey step-down Tukey-Welsch R (False Discovery Rate) () Benjamini and Hochberg(1995) BH adaptivebh BY R 2 (False Discovery Rate) m m 0 m 1 m = m 0 + m 1 R Benjamini

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

A B C A B C X Y Z

A B C A B C X Y Z Argonauta 8: 27-37 (2003) 1 ANOVA, analysis of variance t 1980 90 ANOVA ANOVA Underwood, 1997 ANOVA ANOVA ANOVA 1975 Sokal & Rohlf 1981 1990 Underwood 1997 1997 Zar 1999 1-way ANOVA 2-way, 3-way, ANOVA,

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション 40 6 Fischer 2 McNemar 2 No Yes No Yes Mann Whitney s U Wilcoxon 1 Kruskal Wallis 2 Friedman No Yes 2 Yes No Yes Bonferroni ANOVA No Scheffe Yes Student s T No Paired T Welch s T 40 6 Fischer 2 McNemar

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

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

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回

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

> 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

総合薬学講座 生物統計の基礎

総合薬学講座 生物統計の基礎 2013 10 22 ( ) 2013 10 22 1 / 40 p.682 1. 2. 3 2 t Mann Whitney U ). 4 χ 2. 5. 6 Dunnett Tukey. 7. 8 Kaplan Meier.. U. ( ) 2013 10 22 2 / 40 1 93 ( 20 ) 230. a t b c χ 2 d 1.0 +1.0 e, b ( ) e ( ) ( ) 2013

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

<4D F736F F F696E74202D2088E38A77939D8C7695D78BAD89EF313591E63189F18AEE967B939D8C7697CA2E >

<4D F736F F F696E74202D2088E38A77939D8C7695D78BAD89EF313591E63189F18AEE967B939D8C7697CA2E > 2015/10/1 第 1 回 医学統計勉強会 東北大学病院循環器内科 東北大学臨床研究推進センター 共催 東北大学大学院医学系研究科 EBM 開発学寄附講座 宮田 敏 医学統計勉強会 10 月 2 日 ~11 月 26 日 (11 月 12 日を除く ) 木曜日 19:00~20:30 臨床大講堂 第 1 回 基本統計量 第 5 回 比率と分割表 第 2 回 回帰分析 第 6 回 継時的繰り返し測定データの解析

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

分布

分布 (normal distribution) 30 2 Skewed graph 1 2 (variance) s 2 = 1/(n-1) (xi x) 2 x = mean, s = variance (variance) (standard deviation) SD = SQR (var) or 8 8 0.3 0.2 0.1 0.0 0 1 2 3 4 5 6 7 8 8 0 1 8 (probability

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

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

untitled

untitled 1 Hitomi s English Tests 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 2 0 0 1 1 0 0 0 0 0 1 1 1 1 0 3 1 1 0 0 0 0 1 0 1 0 1 0 1 1 4 1 1 0 1 0 1 1 1 1 0 0 0 1 1 5 1 1 0 1 1 1 1 0 0 1 0

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

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

Microsoft PowerPoint - Econometrics

Microsoft PowerPoint - Econometrics 計量経済学講義 第 25 回 R による計量経済分析 Part-1 2018 年 1 月 5 日 ( 金 )1 限 担当教員 : 唐渡 広志 研究室 : 経済学研究棟 4 階 432 号室 email: kkarato@eco.u-toyama.ac.jp website: http://www3.u-toyama.ac.jp/kkarato/ 1 講義の目的 より高度な計量経済分析を行うために総合

More information

<4D F736F F F696E74202D BD95CF97CA89F090CD F6489F18B4195AA90CD816A>

<4D F736F F F696E74202D BD95CF97CA89F090CD F6489F18B4195AA90CD816A> 主な多変量解析 9. 多変量解析 1 ( 重回帰分析 ) 目的変数 量的 説明変数 質的 あり量的 重回帰分析 数量化 Ⅰ 類 質的 判別分析 数量化 Ⅱ 類 なし 主成分分析因子分析多次元尺度構成法 数量化 Ⅲ 類数量化 Ⅳ 類 その他 クラスタ分析共分散構造分析 説明変数 : 独立変数 予測変数 目的変数 : 従属変数 基準変数 3 1. 単回帰分析各データの構造 y b ax a α: 1,,,

More information

x y 1 x 1 y 1 2 x 2 y 2 3 x 3 y 3... x ( ) 2

x y 1 x 1 y 1 2 x 2 y 2 3 x 3 y 3... x ( ) 2 1 1 1.1 1.1.1 1 168 75 2 170 65 3 156 50... x y 1 x 1 y 1 2 x 2 y 2 3 x 3 y 3... x ( ) 2 1 1 0 1 0 0 2 1 0 0 1 0 3 0 1 0 0 1...... 1.1.2 x = 1 n x (average, mean) x i s 2 x = 1 n (x i x) 2 3 x (variance)

More information

1 1 ( ) ( 1.1 1.1.1 60% mm 100 100 60 60% 1.1.2 A B A B A 1

1 1 ( ) ( 1.1 1.1.1 60% mm 100 100 60 60% 1.1.2 A B A B A 1 1 21 10 5 1 E-mail: qliu@res.otaru-uc.ac.jp 1 1 ( ) ( 1.1 1.1.1 60% mm 100 100 60 60% 1.1.2 A B A B A 1 B 1.1.3 boy W ID 1 2 3 DI DII DIII OL OL 1.1.4 2 1.1.5 1.1.6 1.1.7 1.1.8 1.2 1.2.1 1. 2. 3 1.2.2

More information

( 30 ) 30 4 5 1 4 1.1............................................... 4 1.............................................. 4 1..1.................................. 4 1.......................................

More information

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 )

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 ) 5 Armitage. x,, x n y i = 0x i + 3 y i = log x i x i y i.2 n i i x ij i j y ij, z ij i j 2 y = a x + b 2 2. ( cm) x ij (i j ) (i) x, x 2 σ 2 x,, σ 2 x,2 σ x,, σ x,2 t t x * (ii) (i) m y ij = x ij /00 y

More information

第2回 回帰と分散分析

第2回 回帰と分散分析 1 環境統計学ぷらす 第 2 回 分散分析と回帰 高木俊 shun.takagi@sci.toho-u.ac.jp 2013/10/31 2 予定 第 1 回 : Rの基礎と仮説検定 第 2 回 : 分散分析と回帰 第 3 回 : 一般線形モデル 交互作用 第 4 回 : 一般化線形モデル モデル選択 第 5 回 : 一般化線形混合モデル 第 6 回 : 多変量解析 3 今日やること R 操作編 RエディタからのRの実行

More information

日本統計学会誌, 第44巻, 第2号, 251頁-270頁

日本統計学会誌, 第44巻, 第2号, 251頁-270頁 44, 2, 205 3 25 270 Multiple Comparison Procedures for Checking Differences among Sequence of Normal Means with Ordered Restriction Tsunehisa Imada Lee and Spurrier (995) Lee and Spurrier (995) (204) (2006)

More information

StatLight詳細パンフレット.doc

StatLight詳細パンフレット.doc For Personal Computers Running on The Microsoft Excel Windows 98,2000,NT,XP Statistical method Side Model F-test 0 1,5 Student-t 1,2 1,5 Welch-t 1,2 1,5 Wilcoxon (Mann-Whitney) test 1,2 1,5 Permutation

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

1 2 *3 Windows 7 *4 Windows * 5 R R Console R R Console ˆ R GUI R R R *6 R 2 R R R 6.1 ˆ 2 ˆ 2 ˆ Graphics Device R R Rcmdr Rconsole R --sdi R MDI R *3

1 2 *3 Windows 7 *4 Windows * 5 R R Console R R Console ˆ R GUI R R R *6 R 2 R R R 6.1 ˆ 2 ˆ 2 ˆ Graphics Device R R Rcmdr Rconsole R --sdi R MDI R *3 R John Fox and Milan Bouchet-Valat Version 2.2-0 2015 8 7 2015 8 19 1 R Fox 2005 R R Core Team, 2015 GUIR R R R R R R R R the Comprehensive R Archive Network (CRAN) R CRAN 6.4 R Windows R Rcmdr Mac OS

More information

数理統計学Iノート

数理統計学Iノート I ver. 0/Apr/208 * (inferential statistics) *2 A, B *3 5.9 *4 *5 [6] [],.., 7 2004. [2].., 973. [3]. R (Wonderful R )., 9 206. [4]. ( )., 7 99. [5]. ( )., 8 992. [6],.., 989. [7]. - 30., 0 996. [4] [5]

More information

t sex N y y y Diff (1-2)

t sex N y y y Diff (1-2) Armitage 1 1.1 2 t 1.2 SAS Proc GLM 2 2.1 1 1 2.1.1 50 1 1 t sex N y 50 116.45 119.6 122.75 11.071 1.5657 93.906 154.32 y 50 127.27 130.7 134.13 12.072 1.7073 102.68 163.37 y Diff (1-2) -15.7-11.1-6.504

More information

橡マニュアル1999.PDF

橡マニュアル1999.PDF 11 11 7 28 7 30 9 30 16 30 2-302 1. (hardware) Microsoft Excel Microsoft Word Windows95/98 OS Windows95/98 MS-DOS 2. 3. 1 1 2 4. Enter CTRL ALT ALT SHIFT ESC BS DEL INS TAB CAPS 5. 1 ID ID 2 ID 3-1 - 6.Windows95/98

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

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

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

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

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

現代日本論演習/比較現代日本論研究演習I「統計分析の基礎」

現代日本論演習/比較現代日本論研究演習I「統計分析の基礎」 URL: http://tsigeto.info/statg/ I ( ) 3 2017 2 ( 7F) 1 : (1) ; (2) 1998 (70 20% 6 8 ) (30%) ( 2) ( 2) 2 1. (4/13) 2. SPSS (4/20) 3. (4/27) [ ] 4. (5/11 6/1) [1, 4 ] 5. (6/8) 6. (6/15 6/29) [2, 5 ] 7. (7/6

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

1 Amazon.co.jp *1 5 review *2 web Google web web 5 web web 5 (a) (b) (c) 3 S-PLUS S S-PLUS 1 S-PLUS S R R RMeCab *3 R term matrix S-PLUS S-PLUS *1 Ama

1 Amazon.co.jp *1 5 review *2 web Google web web 5 web web 5 (a) (b) (c) 3 S-PLUS S S-PLUS 1 S-PLUS S R R RMeCab *3 R term matrix S-PLUS S-PLUS *1 Ama 5 1 2 2 3 2.1....................................... 3 2.2............................... 4 2.3....................................... 5 2.4................................ 5 3 6 3.1.........................................

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

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

untitled

untitled WinLD R (16) WinLD https://www.biostat.wisc.edu/content/lan-demets-method-statistical-programs-clinical-trials WinLD.zip 2 2 1 α = 5% Type I error rate 1 5.0 % 2 9.8 % 3 14.3 % 5 22.6 % 10 40.1 % 3 Type

More information

10

10 z c j = N 1 N t= j1 [ ( z t z ) ( )] z t j z q 2 1 2 r j /N j=1 1/ N J Q = N(N 2) 1 N j j=1 r j 2 2 χ J B d z t = z t d (1 B) 2 z t = (z t z t 1 ) (z t 1 z t 2 ) (1 B s )z t = z t z t s _ARIMA CONSUME

More information

パッケージのインストール Rには 複雑な解析を便利に行うためのパッケージが容易されています ( 世界中の研究者達が提供してくれる ) 今回は例として多重比較検定用のmultcomp パッケージをインストールしてみます ( 注意 ) 滋賀県立大学のようにプロキシ経由でインターネットに接続する環境で R

パッケージのインストール Rには 複雑な解析を便利に行うためのパッケージが容易されています ( 世界中の研究者達が提供してくれる ) 今回は例として多重比較検定用のmultcomp パッケージをインストールしてみます ( 注意 ) 滋賀県立大学のようにプロキシ経由でインターネットに接続する環境で R ソフトウェア R を用いた統計解析 清水顕史 R のインストール R の情報 ( 日本語 ) は RjpWikihttp://www.okada.jp.org/RWiki/?RjpWiki にまとめられています 説明に従って最新版の exe ファイルをダウンロード (http://cran.md.tsukuba.ac.jp/bin/windows/base/) し クリックしてインストールします インストール終了後

More information

linguistics

linguistics R @ linguistics 2007/08/24 ( ) R @ linguistics 2007/08/24 1 / 24 1 2 R 3 R 4 5 ( ) R @ linguistics 2007/08/24 2 / 24 R R: ( ) R @ linguistics 2007/08/24 3 / 24 R Life is short. Use the command line. (Crawley

More information