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

 
(같은 사용자의 중간 판 8개는 보이지 않습니다)
3번째 줄: 3번째 줄:


==1표본 t검정==
==1표본 t검정==
<source lang='r'>
{{참고|R 1표본 t검정}}
(x <- c(1:10))
<syntaxhighlight lang='r' run>
##  [1]  1  2  3  4  5  6  7  8  9 10
x = c(1:10)
t.test(x)
t.test(x)
##
</syntaxhighlight>
## 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
</source>


==2표본 t검정==
==2표본 t검정==
<source lang='r'>
{{참고|R 2표본 t검정}}
(a <- c(1:10))
<syntaxhighlight lang='r' run>
##  [1]  1  2 3 4 5 6 7 8 9 10
A1 = c(30.02, 29.99, 30.11, 29.97, 30.01, 29.99)
(b <- c(5:20))
A2 = c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)
##  [1]  5  6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
t.test(A1, A2)
t.test(a, y=b)
</syntaxhighlight>
##
<syntaxhighlight lang='r' run>
## Welch Two Sample t-test
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)
## data:  a and b
t.test(x=a, y=b)
## t = -4.5826, df = 23.967, p-value = 0.0001204
</syntaxhighlight>
## 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
</source>


==같이 보기==
==같이 보기==
48번째 줄: 30번째 줄:
* https://www.rdocumentation.org/packages/stats/versions/3.6.0/topics/t.test
* https://www.rdocumentation.org/packages/stats/versions/3.6.0/topics/t.test


[[분류: R 통계검정]]
[[분류: R stats]]
[[분류: R stats]]
[[분류: t검정]]

2020년 12월 5일 (토) 22:57 기준 최신판

1 개요[ | ]

R t.test()

2 1표본 t검정[ | ]

x = c(1:10)
t.test(x)

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)
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)

4 같이 보기[ | ]

5 참고[ | ]

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