class: center, middle, inverse, title-slide # Normal Distribution ### Dr. Dogucu --- layout: true <div class="my-header"></div> <div class="my-footer"> Copyright © <a href="https://mdogucu.ics.uci.edu">Dr. Mine Dogucu</a>. <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></div> --- ## pdf `\(X \sim \mathcal{N}(\mu, \sigma^2)\)` -- `\(f(x) = \frac{1}{\sigma \sqrt{2\pi}}{e^{-(x-\mu)^2/2\sigma^2}}\)` -- `\(E(X) = \mu\)` -- `\(Var(X) = \sigma^2\)` --- class:middle ## Characteristics .pull-left[ <img src="slide-3-normal_files/figure-html/unnamed-chunk-2-1.png" style="display: block; margin: auto;" /> ] .pull-right[ Mean = Median = Mode `\(P(X<\mu) = 0.5\)` ] --- ## Parameters <img src="slide-3-normal_files/figure-html/unnamed-chunk-3-1.png" style="display: block; margin: auto;" /> --- 68.26895% of the data are within 1 standard deviation of the mean. <img src="slide-3-normal_files/figure-html/unnamed-chunk-4-1.png" style="display: block; margin: auto;" /> --- 95.44997% of the data are within 2 standard deviations of the mean. <img src="slide-3-normal_files/figure-html/unnamed-chunk-5-1.png" style="display: block; margin: auto;" /> --- 99.73002% of the data are within 3 standard deviations of the mean. <img src="slide-3-normal_files/figure-html/unnamed-chunk-6-1.png" style="display: block; margin: auto;" /> --- ### Example Midterm exam scores are normally distributed with a mean of 80 and standard deviation of 5 points. -- .pull-right[ .center[ `\(X \sim N(80, 5^2)\)` ] <img src="slide-3-normal_files/figure-html/unnamed-chunk-7-1.png" style="display: block; margin: auto;" /> ] -- `\(f(78)\)` = ```r dnorm(x = 78, mean = 80, sd = 5) ``` ``` ## [1] 0.07365403 ``` -- `\(f(92)\)` = ```r dnorm(x = 92, mean = 80, sd = 5) ``` ``` ## [1] 0.004478906 ``` --- ## Calculating Probability What is the probability that a student scores below 73 points? .pull-right[ <!-- --> ] ```r pnorm(q = 73, mean = 80, sd = 5) ``` ``` ## [1] 0.08075666 ``` -- <br> If a student scores 73 points, the student's percentile rank is 8.0756659% --- ## Calculating Probability What is the probability that a student scores above 78 points? .pull-right[ <!-- --> ] -- ```r 1 - pnorm(q = 78, mean = 80, sd = 5) ``` ``` ## [1] 0.6554217 ``` -- ```r pnorm(q = 78, mean = 80, sd = 5, lower.tail = FALSE) ``` ``` ## [1] 0.6554217 ``` --- ## How many standard deviations away from the mean? Krishna scored 85 points on the midterm. How many standard deviations is Krishna's score away from the mean? `\(\frac{85-80}{5} = 1\)` -- Hira scored 77.5 points on the midterm. How many standard deviations is Hira's score away from the mean? `\(\frac{77.5-80}{5} = -0.5\)` --- class:center middle ## Z-score $$Z = \frac{X-\mu}{\sigma} $$ --- class: middle ## Calculating z-scores We can calculate Z-scores regardless of the distribution of the data. In other words, data do not need to be normally distributed. Z-scores only show how many standard deviations a value is away from the mean. --- class: middle ## Interpreting z-scores If we know that the data follow a normal distribution then we can use z-scores for probabilistic interpretations. --- ### Normal Distribution vs. Standard Normal (z) Distribution .pull-left[ <img src="slide-3-normal_files/figure-html/unnamed-chunk-15-1.png" style="display: block; margin: auto;" /> ] .pull-right[ <img src="slide-3-normal_files/figure-html/unnamed-chunk-16-1.png" style="display: block; margin: auto;" /> ] --- class: middle .pull-left[ __Normal Distribution__ ```r pnorm(q = 90, mean = 80, sd = 5) ``` ``` ## [1] 0.9772499 ``` ] .pull-right[ __Standard Normal (z) Distribution__ ```r pnorm(q = 2, mean = 0, sd = 1) ``` ``` ## [1] 0.9772499 ``` ] --- ## SAT scores - z scores Let X represent the SAT scores and `\(X \sim N(1100, 200^2)\)` -- What is the Z-score of a student who scores 1500? `\(z = \frac{1500-1100}{200} = 2\)` --- ## SAT scores - probability What is the percentile rank of a student who scores 1500? <img src="slide-3-normal_files/figure-html/unnamed-chunk-19-1.png" style="display: block; margin: auto;" /> --- ## SAT scores - probability What is the percentile rank of a student who scores 1500? -- .pull-left[ ```r pnorm(q = 1500, mean = 1100, sd = 200) ``` ``` ## [1] 0.9772499 ``` If you know the order of arguments: ```r pnorm(1500, 1100, 200) ``` ``` ## [1] 0.9772499 ``` ] -- .pull-right[ ```r pnorm(2, mean = 0, sd = 1) ``` ``` ## [1] 0.9772499 ``` The default `mean` is 0 and `sd` is 1. ```r pnorm(2) ``` ``` ## [1] 0.9772499 ``` ] --- What percentage of test takers score between 800 and 1400? -- `\(P(800<X<1400) =P(X<1400) - P(X<800)\)` -- <img src="slide-3-normal_files/figure-html/unnamed-chunk-24-1.png" style="display: block; margin: auto;" /> -- ```r pnorm(q = 1400, mean = 1100, sd = 200) - pnorm(q = 800, mean = 1100, sd = 200) ``` ``` ## [1] 0.8663856 ``` --- ## Known probability unknown x If College Board wanted to send a congratulatory email to the top 10% in the SATs, above what SAT score should they consider sending the email to? -- .pull-left[ <img src="slide-3-normal_files/figure-html/unnamed-chunk-26-1.png" style="display: block; margin: auto;" /> ] -- .pull-right[ ```r qnorm(p = 0.90, mean = 1100, sd = 200) ``` ``` ## [1] 1356.31 ``` ]