summary_of_hypothesis_testing
Differences
This shows you the differences between two versions of the page.
summary_of_hypothesis_testing [2024/12/02 08:42] – created hkimscil | summary_of_hypothesis_testing [2024/12/02 08:56] (current) – hkimscil | ||
---|---|---|---|
Line 109: | Line 109: | ||
data.frame(cbind(sss, | data.frame(cbind(sss, | ||
- | n <- 200 | + | # 12/2 lecture |
+ | # note that we draw the statistical calculation | ||
+ | # by " | ||
+ | n <- 80 | ||
mean.sample <- 103 | mean.sample <- 103 | ||
- | diff <- mean.sample - mean.ajstu | + | |
- | se <- sd.ajstu / sqrt(n) | + | sample <- rnorm2(n, mean.sample, |
- | diff/se | + | mean(sample) |
+ | sd(sample) | ||
+ | |||
+ | diff <- mean.sample - mean.ajstu | ||
+ | se <- sd.ajstu / sqrt(n) | ||
+ | t.cal <- diff/se | ||
+ | t.cal | ||
qnorm(0.025, | qnorm(0.025, | ||
qnorm(0.01/ | qnorm(0.01/ | ||
+ | qt(0.05/2, n-1, lower.tail=F) | ||
+ | |||
+ | t.test(sample, | ||
+ | # or we obtain the exact p value | ||
+ | p.value <- pt(t.cal, n-1, lower.tail = F) | ||
+ | p.value*2 | ||
</ | </ |
summary_of_hypothesis_testing.1733096556.txt.gz · Last modified: 2024/12/02 08:42 by hkimscil