class: center middle main-title section-title-4 # z-scores .class-info[ **Topic 4 · Thursday, January 14** .light[EDUC 15: Statistics for Education Research<br> UCI School of Education ] ] --- class: title title-8 # Where are we? .pull-left-3[ .box-1.medium[Description] .box-inv-1.small[Summarize data] .box-inv-1.small[Visualize data] .center[**We are here**] .anteater[] ] .pull-middle-3[ .box-6.medium[Prediction] ] .pull-right-3[ .box-3.medium[Explanation] ] .source[Peter the Anteater at a UC Irvine basketball game.] ??? Still description. On Tuesday we summarized a whole distribution in two numbers. Today we use those two numbers to say where one score sits. --- name: outline class: title title-8 # Plan for today .box-1.medium.sp-after-half[z-scores and locations] .box-6.medium.sp-after-half[Transforming distributions] .box-3.medium.sp-after-half[Standardized distributions] ??? Three blocks of about 20 minutes. Each ends with students doing something: try, predict, play. --- layout: false class: center middle section-title section-title-1 animated fadeIn # z-scores and locations --- layout: true class: title title-1 --- # Andy scored 19. Is that good? <img src="04-z-scores_files/figure-html/andy-plot-1.png" alt="Bar chart of baseline math scores for 619 Mindspark students, from 0 to 26 out of 35. The bars peak near 12. A dashed vertical line marks Andy's score of 19, far out on the right side, where the bars are short." width="84%" style="display: block; margin: auto;" /> .source[Data: Muralidharan, Singh, and Ganimian (2019). 619 students in Delhi.] ??? Andy isn't a real student in the data, but real students did score 19. Ask: how would you say how typical or unusual this score is? It's only 19 out of 35, so is that bad? A raw score means little until we know where the other scores are. --- # Measure the distance in SDs <img src="04-z-scores_files/figure-html/ruler-plot-1.png" alt="The same bar chart with a solid line at the mean of 11.12 and a dashed line at Andy's score of 19. An arrow between them is labeled as a deviation of 7.88 points. Above it, a ruler of two segments, each one standard deviation of 3.90 points long, reaches almost exactly from the mean to Andy." width="82%" style="display: block; margin: auto;" /> .box-inv-1.small[Each SD is 3.90 points. Andy's 7.88 points are 7.88 / 3.90 = 2.02 SDs] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? Four questions. What's typical? The mean. How far is Andy from it? The deviation. How much do scores vary overall? The SD. So how many SDs away is he? --- # A z-score counts SDs from the mean $$ z = \frac{X - \mu}{\sigma} = \frac{19 - 11.12}{3.90} = 2.02 $$ .pull-left[ .box-inv-1.small[X − μ] How far the score is from the mean, in points. This is the deviation from Tuesday ] .pull-right[ .box-inv-1.small[σ] The ruler. It says how big a step is in this distribution ] .box-1.small[Treat the 619 students as a population: μ = 11.12 and σ = 3.90] ??? The z has no units. Points divided by points. That's why it will work across different tests later today. --- # Sign: which side. Size: how far <table class="deck-table"> <thead> <tr> <th style="text-align:center;"> Score X </th> <th style="text-align:center;"> Deviation X − μ </th> <th style="text-align:center;"> z </th> <th style="text-align:center;"> In words </th> </tr> </thead> <tbody> <tr> <td style="text-align:center;"> 19 </td> <td style="text-align:center;"> +7.88 </td> <td style="text-align:center;"> +2.02 </td> <td style="text-align:center;"> About two SDs above the mean </td> </tr> <tr> <td style="text-align:center;"> 15 </td> <td style="text-align:center;"> +3.88 </td> <td style="text-align:center;"> +0.99 </td> <td style="text-align:center;"> About one SD above the mean </td> </tr> <tr> <td style="text-align:center;"> 11 </td> <td style="text-align:center;"> −0.12 </td> <td style="text-align:center;"> −0.03 </td> <td style="text-align:center;"> Almost exactly at the mean </td> </tr> <tr> <td style="text-align:center;"> 5 </td> <td style="text-align:center;"> −6.12 </td> <td style="text-align:center;"> −1.57 </td> <td style="text-align:center;"> About one and a half SDs below the mean </td> </tr> </tbody> </table> .box-inv-1.small[z = 0 is the mean. Most of these students sit between z = −2 and z = +2: 94% of them] .source[Data: Muralidharan, Singh, and Ganimian (2019).] --- # From a z-score back to a score $$ X = \mu + z\sigma = 11.12 + 2.02 \times 3.90 = 19.00 $$ .pull-left-3[ .box-inv-1.small[First, read the z] .center[z = 2.02, so Andy is above the mean] ] .pull-middle-3[ .box-inv-1.small[Then go back to points] .center[2.02 × 3.90 = 7.88 points away] ] .pull-right-3[ .box-inv-1.small[Last, add the mean] .center[11.12 + 7.88 = 19.00] ] ??? If you round z to 2, you get 18.92, not 19. Keep two decimals along the way. The lab and the homework will say how much to round. --- # A sample works the same way <table class="deck-table"> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:center;"> Score to z </th> <th style="text-align:center;"> z to score </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Population </td> <td style="text-align:center;"> \(z = \dfrac{X - \mu}{\sigma}\) </td> <td style="text-align:center;"> \(X = \mu + z\sigma\) </td> </tr> <tr> <td style="text-align:left;"> Sample </td> <td style="text-align:center;"> \(z = \dfrac{X - M}{\hat{\sigma}}\) </td> <td style="text-align:center;"> \(X = M + z\hat{\sigma}\) </td> </tr> </tbody> </table> .box-inv-1.small[ Tuesday's five: M = 12.2 and σ̂ = 2.86. In this sample, the 16 has z = 1.33 ] .book-tag[ In the book: σ̂ is written s ] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? Same idea, different symbols. Greek means population, and a Latin letter or a hat means an estimate. A z-score in a sample uses the estimates. --- layout: false class: title title-8 # Try it: Go there and back .box-8.small.sp-after-half[For the math test: μ = 11.12 and σ = 3.90] .box-inv-8.small[**1.** A student scored 9. What's the z-score?] .box-inv-8.small[**2.** A student has z = +1.50. What's the score?] .box-inv-8.small.sp-after-half[**3.** In Tuesday's sample, M = 12.2 and σ̂ = 2.86. Find the z of the 8.] .box-8.small[Work alone for two minutes. Compare with a neighbor. Then we vote] ??? About 6 minutes, with calculators. For the vote, ask for hands on the sign of each answer first, then call out the value. --- class: title title-8 # Try it: Answer .pull-left-3[ .box-inv-8.medium[Question 1] .center[(9 − 11.12) / 3.90 = **−0.54**] ] .pull-middle-3[ .box-inv-8.medium[Question 2] .center[11.12 + 1.50 × 3.90 = **16.97**] ] .pull-right-3[ .box-inv-8.medium[Question 3] .center[(8 − 12.2) / 2.86 = **−1.47**] ] .box-8.small[A negative z-score means below the mean. It doesn't mean a bad score] --- layout: false class: center middle section-title section-title-6 animated fadeIn # Transforming distributions --- layout: true class: title title-6 --- # A 19 means nothing by itself <img src="04-z-scores_files/figure-html/twelve-plot-1.png" alt="Bar chart of baseline math scores with the mean and Andy's score of 19 marked by vertical lines." width="84%" style="display: block; margin: auto;" /> .box-inv-6.small[It's only a label. We could relabel every score, and everyone would keep their place] .source[Data: Muralidharan, Singh, and Ganimian (2019).] --- # Subtract 10: the labels slide <img src="04-z-scores_files/figure-html/minus-plot-1.png" alt="The same bars with a new axis, running from −10 to 14. The mean is now 1.12 and Andy's score is now 9. The picture is the same." width="84%" style="display: block; margin: auto;" /> .box-inv-6.small[Mean: 11.12 → 1.12. The SD stays at 3.90. Andy is still 2.02 SDs above the mean] .source[Data: Muralidharan, Singh, and Ganimian (2019).] --- # Multiply by 10: the labels stretch <img src="04-z-scores_files/figure-html/times-plot-1.png" alt="The same bars with a new axis, running from 0 to 240. The mean is now 111.2 and Andy's score is now 190. The picture is the same." width="84%" style="display: block; margin: auto;" /> .box-inv-6.small[Mean: 11.12 → 111.2. SD: 3.90 → 39.0. Andy is still 2.02 SDs above the mean] .source[Data: Muralidharan, Singh, and Ganimian (2019).] --- # Do both: subtract, then multiply <img src="04-z-scores_files/figure-html/both-plot-1.png" alt="The same bars with a new axis, running from −100 to 140. The mean is now 11.2 and Andy's score is now 90. The picture is the same." width="84%" style="display: block; margin: auto;" /> .box-inv-6.small[Mean: 11.12 → 11.2. SD: 3.90 → 39.0. Andy is still 2.02 SDs above the mean] .source[Data: Muralidharan, Singh, and Ganimian (2019).] --- # These only change the labels <table class="deck-table"> <thead> <tr> <th style="text-align:left;"> Do this to every score </th> <th style="text-align:center;"> Mean </th> <th style="text-align:center;"> SD </th> <th style="text-align:center;"> Shape </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Add or subtract a constant </td> <td style="text-align:center;"> Moves by the constant </td> <td style="text-align:center;"> Stays the same </td> <td style="text-align:center;"> Stays the same </td> </tr> <tr> <td style="text-align:left;"> Multiply or divide by a positive constant </td> <td style="text-align:center;"> Multiplied or divided </td> <td style="text-align:center;"> Multiplied or divided </td> <td style="text-align:center;"> Stays the same </td> </tr> </tbody> </table> .box-6.small.sp-after-half[We call these "scale-invariant" transformations] .box-inv-6.small[They keep the shape and the relative distances between students] ??? The SD ignores a shift because it's built from distances between scores and the mean. Both move together, so the distances don't change. --- # Squaring changes the shape <img src="04-z-scores_files/figure-html/square-plot-1.png" alt="Two bar charts. The left one shows math scores, close to symmetric. The right one shows the same scores squared, with a peak near 140 and a long tail to the right." width="88%" style="display: block; margin: auto;" /> .box-inv-6.small[Now 4 and 6 are 20 apart, but 18 and 20 are 76 apart] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? Not every transformation is a relabeling. Both pairs of students were 2 points apart. After squaring, 4 and 6 become 16 and 36, while 18 and 20 become 324 and 400. So this isn't a relabeling. It changed who is close to whom. --- layout: false class: title title-8 poll-slide # Predict it: Two steps at once .poll-respond[Respond at **PollEv.com/adb**] .box-inv-8.small[ Take every math score. Subtract 11.12, the mean. Then divide by 3.90, the SD. What are the new mean and SD? ] .options[ .option[ **A** Mean 11.12, SD 3.90 ] .option[ **B** Mean 0, SD 3.90 ] .option[ **C** Mean 0, SD 1 ] .option[ **D** Mean 1, SD 0 ] ] ??? About 6 minutes. Vote, turn to a neighbor, vote again, then show the answer. Point back to the table: what does subtracting do, then what does dividing do? Andy: create this poll in Poll Everywhere, then add the `.poll-bar` button from EDUC 265's 06-01 with its presenter id. --- class: title title-8 poll-answer # Predict it: Answer .options[ .option.wrong[ **A** Mean 11.12, SD 3.90 ] .option.wrong[ **B** Mean 0, SD 3.90 ] .option.correct[ **C** Mean 0, SD 1 ] .option.wrong[ **D** Mean 1, SD 0 ] ] .box-inv-8.small.sp-after-half[ Subtracting moves the mean from 11.12 to 0. The SD doesn't change ] .box-8.small[ Dividing takes the SD from 3.90 to 1. The mean stays at 0 ] --- layout: false class: center middle section-title section-title-3 animated fadeIn # Standardized distributions --- layout: true class: title title-3 --- # A z-score is the same kind of relabeling $$ z = \frac{X - \mu}{\sigma} $$ .pull-left[ .box-inv-3.small[Subtract one constant] That constant is the mean ] .pull-right[ .box-inv-3.small[Divide by another constant] That constant is the standard deviation ] .box-3.small[Do it to every score and you get a *standardized* distribution] --- # Same picture, new axis: mean 0, SD 1 <img src="04-z-scores_files/figure-html/z-axis-plot-1.png" alt="The same bars of math scores with two axes. The bottom axis shows raw scores. The top axis shows z-scores from −3 to 4, with 0 at the mean of 11.12. Andy's score of 19 lines up with a z-score of 2.02." width="84%" style="display: block; margin: auto;" /> .box-inv-3.small[The z-scores have mean 0.00 and SD 1.00. Every student keeps their place] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? The book draws this with a normal curve. Here it's the real data. Nothing moved: we printed a second ruler on the plot. --- # z-scores don't make a shape normal <img src="04-z-scores_files/figure-html/shape-plot-1.png" alt="Two bar charts with the same right-skewed shape. The left one shows the squared math scores on their own axis. The right one shows the same values after standardizing, with mean 0 and SD 1. The shape is identical." width="88%" style="display: block; margin: auto;" /> .box-inv-3.small[A skewed distribution stays skewed. Only the axis changes] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? This is a common mistake. Standardizing moves the center and sets the spread. It can't touch the shape. Math scores look bell-shaped because they already were. --- # We can add labels we like better $$ \text{New score} = \text{new mean} + z \times \text{new SD} $$ .pull-left[ .box-inv-3.small[Mean 500, SD 100] .center[Andy: 500 + 2.02 × 100 = **702**] ] .pull-right[ .box-inv-3.small[Mean 100, SD 15] .center[Andy: 100 + 2.02 × 15 = **130**] ] .box-3.small[Same student, same place. Nobody needs to see a negative score or a decimal] ??? Why not stop at z? People don't like being told their score is −0.54. So test makers go one step further. It's one more scale-invariant transformation. --- # Score reports are tables like this one <table class="deck-table tight"> <thead> <tr> <th style="text-align:center;"> Math score </th> <th style="text-align:center;"> z </th> <th style="text-align:center;"> Mean 500, SD 100 </th> <th style="text-align:center;"> Mean 100, SD 15 </th> <th style="text-align:center;"> % who scored lower </th> </tr> </thead> <tbody> <tr> <td style="text-align:center;"> 3 </td> <td style="text-align:center;"> −2.08 </td> <td style="text-align:center;"> 292 </td> <td style="text-align:center;"> 69 </td> <td style="text-align:center;"> 1 </td> </tr> <tr> <td style="text-align:center;"> 7 </td> <td style="text-align:center;"> −1.06 </td> <td style="text-align:center;"> 394 </td> <td style="text-align:center;"> 84 </td> <td style="text-align:center;"> 11 </td> </tr> <tr> <td style="text-align:center;"> 11 </td> <td style="text-align:center;"> −0.03 </td> <td style="text-align:center;"> 497 </td> <td style="text-align:center;"> 100 </td> <td style="text-align:center;"> 43 </td> </tr> <tr> <td style="text-align:center;"> 15 </td> <td style="text-align:center;"> +0.99 </td> <td style="text-align:center;"> 599 </td> <td style="text-align:center;"> 115 </td> <td style="text-align:center;"> 83 </td> </tr> <tr> <td style="text-align:center;"> 19 </td> <td style="text-align:center;"> +2.02 </td> <td style="text-align:center;"> 702 </td> <td style="text-align:center;"> 130 </td> <td style="text-align:center;"> 97 </td> </tr> </tbody> </table> .box-inv-3.small[The study's scaled math scores do this too: mean 0.00, SD 1.00 at baseline] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? Tests like the SAT and GRE report a scaled score and a percentile. Each testing program picks its own scale, and the percentile comes from the people who took it. The study's scaled scores come from a measurement model, not from this simple formula. The idea of reporting in SDs is the same. Don't go further than that unless someone asks. --- # A 19 in math beats a 19 in Hindi <img src="04-z-scores_files/figure-html/compare-plot-1.png" alt="Two bar charts of baseline scores, on the same axis. Math has mean 11.12 and SD 3.90, and a score of 19 has a z-score of 2.02, far in the right tail. Hindi has mean 12.84 and SD 4.94, and a score of 19 has a z-score of 1.25, closer to the middle." width="86%" style="display: block; margin: auto;" /> .box-inv-3.small[Percent correct says Hindi: 63% against 54%. z-scores say math: 2.02 against 1.25] .source[Data: Muralidharan, Singh, and Ganimian (2019).] ??? Ask first: which test did Andy do better on? The tests differ in length, average and spread, so raw scores can't be compared. z-scores have no units, so they can. 2 real students scored 19 on both tests. Andy beat 97% of students in math and 86% in Hindi. --- # The blueprint starts here <div class="sim-slide" style="height: 490px;"> <iframe class="sim-live" src="../simulator/index.html?ui=slide&step=1&mu=11.12&sd=3.90&view=stat&draws=300" title="Simulator at step 1. It draws one score at a time from a normal population, converts each to a z-score, and stacks the z-scores into a bell shape centered at 0" loading="lazy"></iframe> <img class="sim-static" src="img/sim/e6daecfa149e.png" alt="Simulator at step 1. It draws one score at a time from a normal population, converts each to a z-score, and stacks the z-scores into a bell shape centered at 0"> </div> .source[Simulator after Kristoffer Magnusson, rpsychologist.com.] ??? Click to draw a few times. Panel 1 is the population, a smooth curve with our test's mean and SD. Panel 2 is one score and its z. Panel 3 stacks the z-scores. This is step 1 of the blueprint, and every test later in the course has these three panels. Ignore the cutoffs and the p for now. They arrive with hypothesis testing. --- layout: false class: title title-8 # Play it: z-scores .pull-left-3[ .box-inv-8.medium[100] .center[The mean of any full set of z-scores] ] .pull-middle-3[ .box-inv-8.medium[200] .center[On a test with μ = 40 and σ = 8, the score with z = −1.5] ] .pull-right-3[ .box-inv-8.medium[300] .center[What 5 bonus points for everyone do to a z-score] ] .box-8.small.sp-after-half[Answer with a neighbor, as a question. Nothing is scored] ??? About 6 minutes. Read one clue at a time, in order. No calculators. Take answers by hands or by calling out. --- class: title title-8 # Play it: Answers .pull-left-3[ .box-inv-8.medium[100] .center[**What is 0?**] .center[The deviations add up to zero] ] .pull-middle-3[ .box-inv-8.medium[200] .center[**What is 28?**] .center[40 − 1.5 × 8 = 28] ] .pull-right-3[ .box-inv-8.medium[300] .center[**What is nothing?**] .center[X and μ both rise by 5, and σ stays] ] --- class: title title-8 # What you can do now .box-inv-8.small[Turn a score into a z-score, and a z-score back into a score] .box-inv-8.small[Say what the sign and the size of a z-score mean] .box-inv-8.small[Say what adding, multiplying and standardizing do to a distribution] .box-inv-8.small[Compare scores from two different tests] ??? Topic 5 on Tuesday is probability. It connects a z-score to how likely a score is. --- class: title title-8 # Next steps .pull-left[ .box-1.small[Before Tuesday] Read Chapter 6 ] .pull-right[ .box-6.small[Tomorrow: Lab 2] Bring a calculator and a laptop. It includes a 15-minute individual check ] .box-3.small[Mastery and Problem Set for Chapter 5 are due Sunday at 6 PM] <style type="text/css"> /* Images sit under the title. These heights leave room for a source line */ .picture img { display: block; margin: 0 auto; max-width: 100%; max-height: 440px; } .picture-small img { display: block; margin: 0 auto; max-width: 100%; max-height: 230px; } .anteater img { display: block; margin: 0.15em auto 0; max-height: 105px; } /* This chunk sits at the end because any output before the first slide's "class:" line stops remark from reading that slide's properties */ /* Long titles get two smaller lines inside the 110 px title bar */ .remark-slide-content.long-title h1 { font-size: 1.05em; line-height: 1.05; margin-top: -100px; margin-bottom: 55px; } .source { position: absolute; bottom: 18px; left: 60px; font-size: 0.55em; color: #47505a; } .book-tag { margin-top: 0.7em; font-size: 0.65em; color: #47505a; text-align: right; } table.deck-table { width: 92%; margin: 0.4em auto; border-collapse: collapse; font-size: 0.72em; } table.deck-table.tight td, table.deck-table.tight th { padding: 0.12em 0.6em; } table.deck-table th { border-bottom: 2px solid #244a70; padding: 0.3em 0.6em; } table.deck-table td { border-bottom: 1px solid #c9d1d9; padding: 0.3em 0.6em; } .options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35em 1em; margin-top: 0.6em; margin-bottom: 0.8em; font-size: 0.65em; } .option { background-color: #f3f3f3; border: 2px solid #cccccc; padding: 0.35em 0.6em; } .option.correct { background-color: #b18323; border-color: #b18323; color: white; } .option.wrong { opacity: 0.6; } .poll-respond { display: block; font-size: 0.5em; text-align: center; margin-top: 0.1em; } /* The printed PDF keeps the question and drops the answer slide */ @media print { .remark-slide-container:has(.poll-answer) { display: none !important; } } </style>