b:head_first_statistics:using_the_normal_distribution
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| b:head_first_statistics:using_the_normal_distribution [2025/10/08 03:08] – [Swivel chair again] hkimscil | b:head_first_statistics:using_the_normal_distribution [2025/10/29 02:12] (current) – [All aboard the Love Train] hkimscil | ||
|---|---|---|---|
| Line 146: | Line 146: | ||
| [1] 0.9406201 | [1] 0.9406201 | ||
| > pnorm(-1.56, | > pnorm(-1.56, | ||
| + | [1] 0.9406201 | ||
| + | > pnorm(-1.56, | ||
| [1] 0.9406201 | [1] 0.9406201 | ||
| > pnorm(64, 71, sqrt(20.25), | > pnorm(64, 71, sqrt(20.25), | ||
| Line 151: | Line 153: | ||
| > | > | ||
| </ | </ | ||
| + | |||
| + | Note: 이제는 x축이 discrete 하지 않으므로 dnorm()과 같은 펑션을 써서 더할 수 없다 (할 수 있기는 하지만 간단하지 않다). | ||
| + | |||
| ==== exercise ==== | ==== exercise ==== | ||
| <WRAP box> | <WRAP box> | ||
| - | 1. N(10, 4), value 6 | + | - N(10, 4), value 6 |
| - | 2. N(6.3, 9), value 0.3 | + | |
| - | 3. N(2, 4). If the standard score is 0.5, what’s the value? | + | |
| - | 4. The standard score of value 20 is 2. If the variance is 16, what’s the mean? | + | |
| + | </ | ||
| + | <WRAP box> | ||
| + | < | ||
| + | * 1 | ||
| + | pnorm(6, 10, sqrt(4), lower.tail = F) | ||
| + | * 2 | ||
| + | pnorm(0.3, 6.3, sqrt(9), lower.tail = F) | ||
| + | * 3 | ||
| + | 0.5 = (v - 2)/ | ||
| + | v-2 = 1 | ||
| + | v = 3 | ||
| + | * 4 | ||
| + | z = (v - mean) / sd | ||
| + | 2 = (20 - mean) / sqrt(16) | ||
| + | mean = 12 | ||
| + | </ | ||
| </ | </ | ||
| Line 202: | Line 223: | ||
| \end{eqnarray*} | \end{eqnarray*} | ||
| - | < | + | < |
| + | > 1-pnorm(-0.44) | ||
| [1] 0.6700314 | [1] 0.6700314 | ||
| > | > | ||
| + | > pnorm(69, 71, sqrt(20.25), | ||
| + | [1] 0.6716394 | ||
| + | > | ||
| + | > z <- (69 - 71)/ sqrt(20.25) | ||
| + | > z | ||
| + | [1] -0.4444444 | ||
| + | > pnorm(z, lower.tail = F) | ||
| + | [1] 0.6716394 | ||
| + | > | ||
| + | |||
| </ | </ | ||
| Line 513: | Line 545: | ||
| rnorm(n, mean = 0, sd = 1) | rnorm(n, mean = 0, sd = 1) | ||
| </ | </ | ||
| - | </ | ||
| - | {{ : | ||
| - | |||
| - | |||
| + | {{: | ||
| 따라서 | 따라서 | ||
| $$P(X + Y < 380) = 0.9082409 $$ | $$P(X + Y < 380) = 0.9082409 $$ | ||
| + | </ | ||
| ===== exercise ===== | ===== exercise ===== | ||
| - | < | + | < |
| Julie’s matchmaker is at it again. What's the **probability that a man will be at least 5 inches taller than a woman**? In Statsville, the height of men in inches is distributed as N(71, 20.25), and the height of women in inches is distributed as N(64, 16). | Julie’s matchmaker is at it again. What's the **probability that a man will be at least 5 inches taller than a woman**? In Statsville, the height of men in inches is distributed as N(71, 20.25), and the height of women in inches is distributed as N(64, 16). | ||
| </ | </ | ||
| Line 532: | Line 562: | ||
| **probability that a man will be at least 5 inches taller than a woman**? = " | **probability that a man will be at least 5 inches taller than a woman**? = " | ||
| + | |||
| \begin{align*} | \begin{align*} | ||
| P(X > F + 5) & = P(X - F > 5) | P(X > F + 5) & = P(X - F > 5) | ||
| Line 581: | Line 612: | ||
| {{: | {{: | ||
| + | 기억: | ||
| + | E(ax + b) = a E(x) + b | ||
| + | V(ax + b) = a^2 V(x) + 0 | ||
| + | |||
| + | |||
| ===== Independent Observation | ===== Independent Observation | ||
| Rather than transforming the weight of each adult, what we really need to figure out is <fc # | Rather than transforming the weight of each adult, what we really need to figure out is <fc # | ||
| Line 656: | Line 692: | ||
| > pbinom(29, | > pbinom(29, | ||
| [1] 4.630881e-11 | [1] 4.630881e-11 | ||
| + | > dbinom(30: | ||
| + | [1] 4.140329e-11 4.451967e-12 4.173719e-13 3.372702e-14 2.314599e-15 | ||
| + | [6] 1.322628e-16 6.123279e-18 2.206587e-19 5.806808e-21 9.926167e-23 | ||
| + | [11] 8.271806e-25 | ||
| + | > 1 - dbinom(0: | ||
| + | [1] 0.9999899 0.9998659 0.9991284 0.9963200 0.9886534 0.9727683 | ||
| + | [7] 0.9470494 0.9142704 0.8821219 0.8602926 0.8556357 0.8687597 | ||
| + | [13] 0.8942786 0.9240975 0.9512055 0.9718076 0.9853165 0.9930901 | ||
| + | [19] 0.9970569 0.9988641 0.9996024 0.9998738 0.9999637 0.9999905 | ||
| + | [25] 0.9999978 0.9999995 0.9999999 1.0000000 1.0000000 1.0000000 | ||
| + | > sum(dbinom(30: | ||
| + | [1] 4.630881e-11 | ||
| + | > 1 - sum(dbinom(0: | ||
| + | [1] 4.630896e-11 | ||
| + | > | ||
| + | |||
| </ | </ | ||
| Line 777: | Line 829: | ||
| {{: | {{: | ||
| - | < | + | < |
| - | 이를 R을 이용하여 구하면, | + | 위를 R에서 해보면 |
| < | < | ||
| - | pbinom(5, 12, 1/2) | + | > dbinom(0, 12, 1/2) + dbinom(1, 12, 1/2) + dbinom(2, 12, 1/2) |
| + | > + dbinom(3, 12, 1/2) + dbinom(4, 12, 1/2) + dbinom(5, 12, 1/2) | ||
| + | [1] 0.387207 | ||
| </ | </ | ||
| + | 그러나, R에서는 더 간단한 방법으로 | ||
| < | < | ||
| > pbinom(5, 12, 1/2) | > pbinom(5, 12, 1/2) | ||
| Line 788: | Line 842: | ||
| </ | </ | ||
| - | 위는 아래와 같음을 이해해야 한다 | + | 그리고, |
| < | < | ||
| > sum(dbinom(c(0: | > sum(dbinom(c(0: | ||
| Line 844: | Line 898: | ||
| 이 값은 위의 0.387에 근사하다. | 이 값은 위의 0.387에 근사하다. | ||
| - | < | + | < |
| * In particular circumstances you can **use the normal distribution to approximate the binomial**. If X ~ B(n, p) and np > 5 and nq > 5 then you can approximate X using X ~ N(np, npq) | * In particular circumstances you can **use the normal distribution to approximate the binomial**. If X ~ B(n, p) and np > 5 and nq > 5 then you can approximate X using X ~ N(np, npq) | ||
| * If you’re approximating the binomial distribution with the normal distribution, | * If you’re approximating the binomial distribution with the normal distribution, | ||
| Line 851: | Line 905: | ||
| {{: | {{: | ||
| - | < | + | < |
| Q:Does it really save time to approximate the binomial distribution with the normal? | Q:Does it really save time to approximate the binomial distribution with the normal? | ||
| Line 874: | Line 928: | ||
| ===== Pool Puzzle ===== | ===== Pool Puzzle ===== | ||
| <wrap # | <wrap # | ||
| - | < | + | < |
| - | X < 3 | + | X < 3 |
| - | X > 3 | + | X > 3 |
| - | X <_ 3 | + | X <_ 3 |
| - | X >_ 3 | + | X >_ 3 |
| - | 3 <_ X < 10 ---- | + | 3 <_ X < 10 <wrap spoiler> 2.5 < X < 9.5 </ |
| - | X = 0 | + | X = 0 |
| - | 3 <_ X <_ 10 | + | 3 <_ X <_ 10 |
| - | 3 < X <_ 10 | + | 3 < X <_ 10 |
| - | X > 0 | + | X > 0 |
| - | 3 < X < 10 | + | 3 < X < 10 |
| </ | </ | ||
| Line 921: | Line 975: | ||
| {{: | {{: | ||
| - | $\lambda > 15$ 일 때, Poisson distribution, | + | <fc #ff0000>$\lambda > 15$ 일 때,</ |
| 예) | 예) | ||
| Line 970: | Line 1024: | ||
| $0.9654916 \sim 0.9656205$ | $0.9654916 \sim 0.9656205$ | ||
| + | |||
| + | R에서 ppois을 이용하면 | ||
| + | < | ||
| + | > ppois(51, 40) | ||
| + | [1] 0.9612598 | ||
| + | > | ||
| + | |||
| + | </ | ||
| ===== Check up ===== | ===== Check up ===== | ||
b/head_first_statistics/using_the_normal_distribution.1759892937.txt.gz · Last modified: by hkimscil
