sample_proportions_is_not_a_binomial_distribution:code01
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| sample_proportions_is_not_a_binomial_distribution:code01 [2025/11/12 07:40] – removed - external edit (Unknown date) 127.0.0.1 | sample_proportions_is_not_a_binomial_distribution:code01 [2025/11/12 07:40] (current) – ↷ Page moved from sampling_proportion_is_not_binomial_distribution:code01 to sample_proportions_is_not_a_binomial_distribution:code01 hkimscil | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | 1 - pbinom(30, 100, 1/4) | ||
| + | pbinom(30, 100, 1/4, lower.tail = F) | ||
| + | # 위의 문제를 normal distriubtion으로 계산한다면 | ||
| + | # exp(k) = np, var(k) = npq 이므로 | ||
| + | n <- 100 | ||
| + | p <- 1/4 | ||
| + | q <- 1-p | ||
| + | e.k <- n*p | ||
| + | v.k <- n*p*q | ||
| + | e.k | ||
| + | v.k | ||
| + | sd.k <- sqrt(v.k) | ||
| + | |||
| + | x <- 0:50 | ||
| + | plot(dbinom(x, | ||
| + | # 위에서 P(x > 30) 을 묻는 문제 | ||
| + | pnorm(30, e.k, sd.k, lower.tail = F) | ||
| + | # cc를 적용하면 | ||
| + | pnorm(30.5, e.k, sd.k, lower.tail = F) | ||
| + | |||
| + | # P(x< | ||
| + | pbinom(25, n, p) | ||
| + | pnorm(25, e.k, sd.k) | ||
| + | pnorm(25.5, e.k, sd.k) | ||
| + | </ | ||
