#title 구간추정 [[TableOfContents]] ==== 모비율의 구간추정 ==== 어느 상표에 대한 선호도를 조사한 결과 100명 중 48명이 그 상표에 대해 선호하는 것으로 나타났다. 95%신뢰구간을 구해보자. {{{ 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%의 비율 ==== 이집단 비율에 대한 검정 ==== A도시에서는 300명 중 100명이, B도시에서는 400명 중 170명이 D후보를 지지한다고 조사되었다. A도시와 B도시의 D후부 지지 비율이 같다고 할 수 있는가? {{{ 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 }}} 결과해석 * 두 집단에서 어떤 사건에 대한 비율이 같다고 할 수 있는지에 대한 검정. * 가설 * 귀무가설: 차이가 없다. * 대립가설: 차이가 있다. * p-value = 0.01698 으로 유의수준 0.05보다 작으므로 대립가설을 뻑낼 이유를 찾지 못함. 그러므로 대립가설 채택, 귀무가설 기각. 즉, A와 B도시 간에 D후보에 대한 지지율은 유의한 차이가 있다. ==== 모평균의 구간추정 ==== {{{ > 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 > }}} 구간은...93.79540 ~ 95.37126 ==== 기타 방법 ==== * [평균의 구간추정] -- Excel을 이용한 평균의 구간추정 * [정규분포 - 모분산과 모평균의 추정] --손으로 푸는 방법 ==== 참고사이트 ==== * http://infostat2.knou.ac.kr/Pre/intro/index.htm