1.母分散の推定
事例:大きさ15の標本を抽出、不偏分散が1.9、このとき母分散が1.0か、5%の危険確率で検定
(赤間[2009],p123ff)
|
nbvr=1.9 |
参考:グラフの作成 (参考:同)
| x <- seq(0,30,by=0.01) y <- dchisq(x,14) plot(x,y,type="l",main="chi^2分布,自由度14") |
2.分散同士の比較
・2つの高校バスケチームより体重(が判明している人のみ)を抜粋。
両チームの体重の分散は等しいか、10%の危険率で検定。
|
|
2-1-0. 有意水準90%のとき
F2=3.676675
v=0.8416644
v<F2より有意水準90%でh0を棄却できない。
2-1 var.testでの実施
|
var.test(w_s,w_r,alternative="two.sided",conf.level=0.9) x = seq(0,10,by=0.0001) |
結果
F test to compare two variances data: w_s and w_r F = 0.8417, num df = 8, denom df = 6, p-value = 0.7983 alternative hypothesis: true ratio of variances is not equal to 1 90 percent confidence interval: 0.202967 3.013647 sample estimates: ratio of variances 0.8416644 |
h0:分散が等しい h1:分散が異なる(割って1にならない) 90%の信頼区間: 0.202967 から3.013647 分散の比率=0.8416644 |
3.相関係数
| ryn <- read.table("ryohnan.csv",sep=",",skip=1) shk <- read.table("shohoku2.csv",sep=",",skip=1) h_s <- shk[,2]#身長 h_r <- ryn[,2]# w_s <- shk[,3]#体重 w_r <- ryn[,3]# h_s;w_s;cor.test(h_s,w_s) h_r;w_r;cor.test(h_r,w_r) |
3-1-0 h_s;w_s;cor.test(h_s,w_s)の結果
| [1] 197 168 188 184 189 178 164 170 170 [1] 93 59 75 70 83 62 57 62 65 Pearson's product-moment correlation data: h_s and w_s t = 7.0199, df = 7, p-value = 0.0002078 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.7175379 0.9866900 sample estimates: cor 0.9357461 |
t値=7.0199、自由度7 h1: true correlation is not equal to 0 h0:true correlation is equal to 0 p値= 0.0002078 両者が無関係=0.02%くらいで偶然生じる (cf.サイコロを5回振って同じ目が出るとき・・・0.08%) 信頼区間 0.71-0.98 相関係数=0.94 |