prop.test(48,100,conf.level=0.95) 1-sample proportions test with continuity correction data: 48 out of 100, null probability 0.5 X-squared = 0.09, df = 1, p-value = 0.7642 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.3798722 0.5816817 sample estimates: p 0.48襤郁規螳 (0.3798722, 0.5816817) 企. 讀, 38% ~ 58% 觜
p <- c(100/300, 170/400) n <- c(300, 400) prop.test(n*p, n, alt="two.sided") 2-sample test for equality of proportions with continuity correction data: n * p out of n X-squared = 5.6988, df = 1, p-value = 0.01698 alternative hypothesis: two.sided 95 percent confidence interval: -0.16664176 -0.01669158 sample estimates: prop 1 prop 2 0.3333333 0.4250000
> x <- c(95,92,94,95,96,96,94,95,93,95,96,94) > t.test(x) One Sample t-test data: x t = 264.2069, df = 11, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 93.79540 95.37126 sample estimates: mean of x 94.58333 >