"R t검정"의 두 판 사이의 차이

4번째 줄: 4번째 줄:
==1표본 t검정==
==1표본 t검정==
<source lang='r'>
<source lang='r'>
(x <- rnorm(12))
(x <- c(1:10))
##  [1] -0.80677919 -0.53470426 0.98430798 0.70428020 0.25909529 0.05287603
##  [1]  1 2 3 4 5 6 7 8 9 10
## [7] 0.39817250 0.15529129 -1.14096331  0.04737570 0.01691522 0.74616298
t.test(x)
t.test(x)
##  
##  
12번째 줄: 11번째 줄:
##  
##  
## data:  x
## data:  x
## t = 0.4003, df = 11, p-value = 0.6966
## t = 5.7446, df = 9, p-value = 0.0002782
## alternative hypothesis: true mean is not equal to 0
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 95 percent confidence interval:
##  -0.3306406  0.4776456
##  3.334149 7.665851
## sample estimates:
## sample estimates:
## mean of x  
## mean of x  
## 0.07350254
##       5.5
</source>
</source>



2019년 5월 19일 (일) 17:51 판

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검정

(a <- c(1:10))
##  [1]  1  2  3  4  5  6  7  8  9 10
(b <- c(5:20))
##  [1]  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
t.test(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 }}