c:ms:2025:schedule:week06_t-test_and_anova_note
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| c:ms:2025:schedule:week06_t-test_and_anova_note [2025/04/10 01:22] – [t-test] hkimscil | c:ms:2025:schedule:week06_t-test_and_anova_note [2025/04/13 23:35] (current) – [t-test, different approach] hkimscil | ||
|---|---|---|---|
| Line 42: | Line 42: | ||
| * 보정값은 샘플의 숫자마다 다르게 됨 | * 보정값은 샘플의 숫자마다 다르게 됨 | ||
| * < | * < | ||
| + | > # 아래는 샘플사지즈가 16일 경우 | ||
| > qt(0.025, df=15) | > qt(0.025, df=15) | ||
| [1] -2.13145 | [1] -2.13145 | ||
| Line 53: | Line 54: | ||
| > | > | ||
| </ | </ | ||
| - | * 혹은 | + | * 혹은 |
| * < | * < | ||
| > pt(2.8, df=15, lower.tail = F) | > pt(2.8, df=15, lower.tail = F) | ||
| Line 59: | Line 60: | ||
| > pt(-2.8, df=15) | > pt(-2.8, df=15) | ||
| [1] 0.006729863 | [1] 0.006729863 | ||
| + | > | ||
| + | > # 이 둘을 더한 값이 양쪽 날개 바깥쪽의 probability | ||
| + | > 2 * pt(2.8, df=15, lower.tail = F) | ||
| + | [1] 0.01345973 | ||
| > | > | ||
| </ | </ | ||
| Line 68: | Line 73: | ||
| [1] -2.13145 | [1] -2.13145 | ||
| > qt(0.025, df=150000000000000) | > qt(0.025, df=150000000000000) | ||
| + | [1] -1.959964 | ||
| + | > # 샘플사이즈가 충분히 크면 qt값과 qnorm값이 동일한 | ||
| + | > # 1.96임을 주의 | ||
| + | > qnorm(0.025) | ||
| [1] -1.959964 | [1] -1.959964 | ||
| > | > | ||
| Line 453: | Line 462: | ||
| abline(v = mean.a, lty=2, lwd=3, col=" | abline(v = mean.a, lty=2, lwd=3, col=" | ||
| abline(v = mean.b, lty=2, lwd=3, col=" | abline(v = mean.b, lty=2, lwd=3, col=" | ||
| + | |||
| + | # or | ||
| + | hist(A, xlim=c(0, | ||
| + | hist(B, add=T, col=rgb(0, 1, 0, 0.5)) | ||
| + | abline(v=mean(dat), | ||
| + | abline(v=mean(A), | ||
| + | abline(v=mean(B), | ||
| </ | </ | ||
| Line 528: | Line 544: | ||
| f.calculated.pvalue <- 1-pf(f.calculated, | f.calculated.pvalue <- 1-pf(f.calculated, | ||
| f.calculated.pvalue | f.calculated.pvalue | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | x <- rf(500000, df1 = df.between, df2 = df.within) | ||
| + | hist(x, | ||
| + | | ||
| + | freq = FALSE, | ||
| + | xlim = c(0, 7), | ||
| + | ylim = c(0, 3), | ||
| + | xlab = "", | ||
| + | main = " | ||
| + | with df1 = 1 and df2 = 30", | ||
| + | | ||
| + | ) | ||
| + | curve(df(x, df1 = df.between, df2 = df.within), | ||
| + | from = 0, to = 8, n = 5000, | ||
| + | col = " | ||
| + | add = T) | ||
| + | abline(v=f.calculated, | ||
| + | |||
| + | f.calculated.pvalue | ||
| + | 1 - f.calculated.pvalue | ||
| + | </ | ||
| + | |||
| + | < | ||
| # 한편, | # 한편, | ||
| # samples t-test를) 아웃 풋은 | # samples t-test를) 아웃 풋은 | ||
| Line 639: | Line 680: | ||
| > abline(v = mean.b, lty=2, lwd=3, col=" | > abline(v = mean.b, lty=2, lwd=3, col=" | ||
| > | > | ||
| + | > # or | ||
| + | > hist(A, xlim=c(0, | ||
| + | > hist(B, add=T, col=rgb(0, 1, 0, 0.5)) | ||
| + | > abline(v=mean(dat), | ||
| + | > abline(v=mean(A), | ||
| + | > abline(v=mean(B), | ||
| </ | </ | ||
| + | |||
| {{c: | {{c: | ||
| + | {{: | ||
| < | < | ||
| > # mean.total 에서 그룹a의 평균까지의 차이를 구한 후 | > # mean.total 에서 그룹a의 평균까지의 차이를 구한 후 | ||
c/ms/2025/schedule/week06_t-test_and_anova_note.1744248140.txt.gz · Last modified: by hkimscil
