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 10:25] – [t-test] hkimscil | c:ms:2025:schedule:week06_t-test_and_anova_note [2025/04/14 08:35] (current) – [t-test, different approach] hkimscil | ||
---|---|---|---|
Line 73: | 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 458: | 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 533: | 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 644: | 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.1744248324.txt.gz · Last modified: 2025/04/10 10:25 by hkimscil