_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › 豺伎伎螻炎
|
|
[edit]
1 螳 #
[edit]
2 蟆 # 蟆企, 覈讌 蠍磯螳 轟 襯 磯ゴ讌 蟆曙一 蟆.
8譬襯 譯殊 觜 語^ 譟一襯 伎 襯 螳襴螻 128覈 襦 れ 螳 譬 譯朱ゼ 襦 . 譯 襷 碁 谿願 り 螳? tmp <- textConnection( "譯殊襯 蟯豸° 1 12 2 18 3 11 4 21 5 23 6 16 7 7 8 20") x <- read.table(tmp, header=TRUE) close.connection(tmp) head(x) 譯殊 碁 谿願 る 蟆 觜 螳 襷. 蠏碁覩襦 螳 譯殊 蠍磯 蟯豸° 16企.
> sum(x$蟯豸°) / nrow(x) [1] 16 豺伎伎螻 蟆 企慨.
蠍磯 <- replicate(nrow(x), (sum(x$蟯豸°) / nrow(x))) x <- cbind(x,e) chisq.test(x=x$蟯豸°, y=x$蠍磯) 蟆郁骸
> chisq.test(x=x$蟯豸°, y=x$蠍磯) Chi-squared test for given probabilities data: x$蟯豸° X-squared = 13.5, df = 7, p-value = 0.06082 蟆郁骸伎
[edit]
3 襴曙 蟆 #蠍 一危磯ゼ 伎 覲伎.
tmp <- textConnection( "蟲′譴 ′一ろ 譟 螻狩′ 51 螻譟 螻狩′ 22 譴譟 螻狩′ 43 譟 ′ 92 螻譟 ′ 21 譴譟 ′ 28 譟 觜′ 68 螻譟 觜′ 9 譴譟 觜′ 22") x <- read.table(tmp, header=TRUE) close.connection(tmp) head(x) t <- xtabs(~蟲′譴+′一ろ, data=x) t 蟆郁骸
> t ′一ろ 蟲′譴 螻狩′ 觜′ ′ 螻譟 22 9 21 譟 51 68 92 譴譟 43 22 28 蠍磯螳 れ 讌螻襯 伎 觜(ratio)襯 螻壱覃 .
> apply(t, 1, sum) 螻狩′ 觜′ ′ 116 99 141 > apply(t, 2, sum) 螻譟 譟 譴譟 52 211 93 襷, 蟲′譴螻 ′一 蟯 螳企慨. 覓伎襦 れ 30覈 觸 蟲′譴 危エ覲企 豌(螻譟:譟:譴譟 = 52:211:93) 襯 蟆企. 企 覩語 蠍磯螳螻 蟯豸♀ 覩誤 谿願 朱 襴曙煙 る 蟆企. 讌襷, 蠍磯螳螻 蟯豸♀ 覩誤 谿願 る 覲螳 襦 レ 譯朱 蟆企. 讀, 襴曙 .
蠍磯螳 螻壱企慨. 豌:′ = 356:141. 蠏碁覩襦 ′一譴 譴譟語 れ 356:141 = 93:x 讀, x = 141 * 93 / 356 = 36.8347企. 企蟆 殊殊 螻壱蟆 讌讀蟾 糾貂讌襯 伎 蟇磯. R summary(xtabs())覃 襴曙 su蟆 蠏碁 .
> summary(t) Call: xtabs(formula = ~ 蟲′譴 + ′一ろ, data = x) Number of cases in table: 356 Number of factors: 2 Test for independence of all factors: Chisq = 18.51, df = 4, p-value = 0.0009808
fisher.test) 豐蠍壱覿襯 伎 p-value襯 螻壱り . [edit]
4 蟆 #れ A 覈讌 蠍磯願, B 覲語 蟯豸°. 覲語 覈讌螻 螳 覿 襯 螳讌讌 蟆企慨.
tmp <- textConnection( "A B 829 772 217 211 110 111 79 59 61 73 45 41 37 42 23 32 21 21 17 18 ") x <- read.table(tmp, header=TRUE) close.connection(tmp) plot(x$A) lines(1:nrow(x), x$B) v <- x$B e <- x$A/sum(x$A) chisq.test(v, p=e) 蟆郁骸
> chisq.test(v, p=e) Chi-squared test for given probabilities data: v X-squared = 14.2971, df = 9, p-value = 0.1121
覿覈 <- c(x$A[1], x$B[1]) #豌 覯讌 覿覈 蟆曙 # 覿覈 <- c(sum(x$A), sum(x$B)) #豌 sum 覿覈瑚化 for(i in 2:nrow(x)){ 覿 <- c(x$A[i], x$B[i]) #pval <- poisson.test(覿, 覿覈)$p.value * (nrow(x)-1) # nrow(x)-1 bonferroni conrrection pval <- prop.test(覿, 覿覈)$p.value * (nrow(x)-1) # nrow(x)-1 bonferroni conrrection print(paste0(i, "=", pval)) } [edit]
5 讌 蟆 #曙 襦譟一 蟆郁骸.
tmp <- textConnection( "譬蟲 谿煙覿 蠍磯蟲 谿 175 蠍磯蟲 覦 125 豌譯手 谿 100 豌譯手 覦 100 覿蟲 谿 160 覿蟲 覦 140 覓願 谿 250 覓願 覦 150") x <- read.table(tmp, header=TRUE) close.connection(tmp) summary(xtabs(~譬蟲+谿煙覿, data=x)) 蟆郁骸
> summary(xtabs(~譬蟲+谿煙覿, data=x)) Call: xtabs(formula = ~ 譬蟲 + 谿煙覿, data = x) Number of cases in table: 1200 Number of factors: 2 Test for independence of all factors: Chisq = 10.8, df = 3, p-value = 0.01286
鏤
|
覦襯 螳 企Π 豕螻 覓殊企. |