R t검정

Jmnote (토론 | 기여)님의 2019년 8월 25일 (일) 16:02 판 (→‎2표본 t검정)

1 개요

R t.test()

2 1표본 t검정

(x <- c(1:10))
##  [1]  1  2  3  4  5  6  7  8  9 10
t.test(x)
## 
## 	One Sample t-test
## 
## data:  x
## t = 5.7446, df = 9, p-value = 0.0002782
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  3.334149 7.665851
## sample estimates:
## mean of x 
##       5.5

3 2표본 t검정

A1 <- c(30.02, 29.99, 30.11, 29.97, 30.01, 29.99)
A2 <- c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)
t.test(A1, A2)
## 
##  Welch Two Sample t-test
## 
## data:  A1 and A2
## t = 1.959, df = 7.0306, p-value = 0.09077
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.01956909  0.20956909
## sample estimates:
## mean of x mean of y 
##    30.015    29.920
a <- c(1,2,3,4,5,6,7,8,9,10)
b <- c(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
t.test(x=a, y=b)
## 
## 	Welch Two Sample t-test
## 
## data:  a and b
## t = -4.5826, df = 23.967, p-value = 0.0001204
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -10.152884  -3.847116
## sample estimates:
## mean of x mean of y 
##       5.5      12.5

4 같이 보기

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}