-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path10_IntroInference_Lab.html
More file actions
3145 lines (3017 loc) · 352 KB
/
Copy path10_IntroInference_Lab.html
File metadata and controls
3145 lines (3017 loc) · 352 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.5.43">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Topic 10: Introduction to Inference Lab</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
<script src="10_IntroInference_Lab_files/libs/clipboard/clipboard.min.js"></script>
<script src="10_IntroInference_Lab_files/libs/quarto-html/quarto.js"></script>
<script src="10_IntroInference_Lab_files/libs/quarto-html/popper.min.js"></script>
<script src="10_IntroInference_Lab_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="10_IntroInference_Lab_files/libs/quarto-html/anchor.min.js"></script>
<link href="10_IntroInference_Lab_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="10_IntroInference_Lab_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="10_IntroInference_Lab_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="10_IntroInference_Lab_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="10_IntroInference_Lab_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script src="10_IntroInference_Lab_files/libs/quarto-contrib/live-runtime/live-runtime.js" type="module"></script>
<link href="10_IntroInference_Lab_files/libs/quarto-contrib/live-runtime/live-runtime.css" rel="stylesheet">
<script type="module" src="10_IntroInference_Lab_files/libs/quarto-ojs/quarto-ojs-runtime.js"></script>
<link href="10_IntroInference_Lab_files/libs/quarto-ojs/quarto-ojs.css" rel="stylesheet">
<style>
.btn-exercise-solution { display: none !important; }
.exercise-editor-body { max-height: 300px; overflow-y: auto; }
</style>
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
<script type="text/javascript">
const typesetMath = (el) => {
if (window.MathJax) {
// MathJax Typeset
window.MathJax.typeset([el]);
} else if (window.katex) {
// KaTeX Render
var mathElements = el.getElementsByClassName("math");
var macros = [];
for (var i = 0; i < mathElements.length; i++) {
var texText = mathElements[i].firstChild;
if (mathElements[i].tagName == "SPAN") {
window.katex.render(texText.data, mathElements[i], {
displayMode: mathElements[i].classList.contains('display'),
throwOnError: false,
macros: macros,
fleqn: false
});
}
}
}
}
window.Quarto = {
typesetMath
};
</script>
</head>
<body class="fullcontent">
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Topic 10: Introduction to Inference Lab</h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<div class="cell" data-edit="false">
<div>
<div id="webr-1" class="exercise-cell">
</div>
<script type="webr-1-contents">
eyJhdHRyIjp7ImVkaXQiOmZhbHNlLCJwZXJzaXN0Ijp0cnVlLCJldmFsIjp0cnVlLCJvdXRwdXQiOmZhbHNlfSwiY29kZSI6IndlYnI6Omluc3RhbGwoXCJncmFkZXRoaXNcIiwgcXVpZXQgPSBUUlVFKVxubGlicmFyeShncmFkZXRoaXMpXG5vcHRpb25zKHdlYnIuZXhlcmNpc2UuY2hlY2tlciA9IGZ1bmN0aW9uKFxuICBsYWJlbCwgdXNlcl9jb2RlLCBzb2x1dGlvbl9jb2RlLCBjaGVja19jb2RlLCBlbnZpcl9yZXN1bHQsIGV2YWx1YXRlX3Jlc3VsdCxcbiAgZW52aXJfcHJlcCwgbGFzdF92YWx1ZSwgZW5naW5lLCBzdGFnZSwgLi4uXG4pIHtcbiAgaWYgKGlzLm51bGwoY2hlY2tfY29kZSkpIHtcbiAgICAjIE5vIGdyYWRpbmcgY29kZSwgc28ganVzdCBza2lwIGdyYWRpbmdcbiAgICBpbnZpc2libGUoTlVMTClcbiAgfSBlbHNlIGlmIChpcy5udWxsKGxhYmVsKSkge1xuICAgIGxpc3QoXG4gICAgICBjb3JyZWN0ID0gRkFMU0UsXG4gICAgICB0eXBlID0gXCJ3YXJuaW5nXCIsXG4gICAgICBtZXNzYWdlID0gXCJBbGwgZXhlcmNpc2VzIG11c3QgaGF2ZSBhIGxhYmVsLlwiXG4gICAgKVxuICB9IGVsc2UgaWYgKGlzLm51bGwoc29sdXRpb25fY29kZSkpIHtcbiAgICBsaXN0KFxuICAgICAgY29ycmVjdCA9IEZBTFNFLFxuICAgICAgdHlwZSA9IFwid2FybmluZ1wiLFxuICAgICAgbWVzc2FnZSA9IGh0bWx0b29sczo6dGFncyRkaXYoXG4gICAgICAgIGh0bWx0b29sczo6dGFncyRwKFwiQSBwcm9ibGVtIG9jY3VycmVkIGdyYWRpbmcgdGhpcyBleGVyY2lzZS5cIiksXG4gICAgICAgIGh0bWx0b29sczo6dGFncyRwKFxuICAgICAgICAgIFwiTm8gc29sdXRpb24gY29kZSB3YXMgZm91bmQuIE5vdGUgdGhhdCBncmFkaW5nIGV4ZXJjaXNlcyB1c2luZyB0aGUgXCIsXG4gICAgICAgICAgaHRtbHRvb2xzOjp0YWdzJGNvZGUoXCJncmFkZXRoaXNcIiksXG4gICAgICAgICAgXCJwYWNrYWdlIHJlcXVpcmVzIGEgbW9kZWwgc29sdXRpb24gdG8gYmUgaW5jbHVkZWQgaW4gdGhlIGRvY3VtZW50LlwiXG4gICAgICAgIClcbiAgICAgIClcbiAgICApXG4gIH0gZWxzZSB7XG4gICAgZ3JhZGV0aGlzOjpncmFkZXRoaXNfZXhlcmNpc2VfY2hlY2tlcihcbiAgICAgIGxhYmVsID0gbGFiZWwsIHNvbHV0aW9uX2NvZGUgPSBzb2x1dGlvbl9jb2RlLCB1c2VyX2NvZGUgPSB1c2VyX2NvZGUsXG4gICAgICBjaGVja19jb2RlID0gY2hlY2tfY29kZSwgZW52aXJfcmVzdWx0ID0gZW52aXJfcmVzdWx0LFxuICAgICAgZXZhbHVhdGVfcmVzdWx0ID0gZXZhbHVhdGVfcmVzdWx0LCBlbnZpcl9wcmVwID0gZW52aXJfcHJlcCxcbiAgICAgIGxhc3RfdmFsdWUgPSBsYXN0X3ZhbHVlLCBzdGFnZSA9IHN0YWdlLCBlbmdpbmUgPSBlbmdpbmUpXG4gIH1cbn0pIn0=
</script>
</div>
</div>
<div class="cell" data-edit="false" data-define="ok_response">
<div>
<div id="webr-2" class="exercise-cell">
</div>
<script type="webr-2-contents">
eyJhdHRyIjp7ImRlZmluZSI6WyJva19yZXNwb25zZSJdLCJlZGl0IjpmYWxzZSwib3V0cHV0IjpmYWxzZSwicGVyc2lzdCI6dHJ1ZSwiZXZhbCI6dHJ1ZX0sImNvZGUiOiJcbmxpYnJhcnkoaHRtbHRvb2xzKVxub2tfcmVzcG9uc2UgPC0gZnVuY3Rpb24ocmVzcG9uc2UsIG4pIHtcbiAgaWYgKGlzLm5hKHJlc3BvbnNlKSkgZGl2KEhUTUwoXCJZb3UgaGF2ZW4ndCBhbnN3ZXJlZCB5ZXQuXCIpLCBzdHlsZSA9IFwiY29sb3I6IHB1cnBsZVwiKVxuICBlbHNlIGlmIChyZXNwb25zZSA9PSBuKSBkaXYoSFRNTChcIkNvcnJlY3Qg4pyTXCIpLCBzdHlsZSA9IFwiY29sb3I6IGdyZWVuXCIpXG4gIGVsc2UgZGl2KEhUTUwoXCJJbmNvcnJlY3Qg4pyXXCIpLCBzdHlsZSA9IFwiY29sb3I6IHJlZFwiKVxufSJ9
</script>
</div>
</div>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb1" data-startfrom="44" data-source-offset="0"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 43;"><span id="cb1-44"><a href="#cb1-44" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">ok_checkbox</span>(response<span class="op">,</span> n) {</span>
<span id="cb1-45"><a href="#cb1-45" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> (<span class="op">!</span>response <span class="op">||</span> response<span class="op">.</span><span class="at">length</span> <span class="op">===</span> <span class="dv">0</span>) </span>
<span id="cb1-46"><a href="#cb1-46" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="fu">html</span><span class="vs">`<span style="color:purple">You haven't answered yet.</span>`</span><span class="op">;</span></span>
<span id="cb1-47"><a href="#cb1-47" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> (response<span class="op">.</span><span class="fu">toString</span>() <span class="op">===</span> n) </span>
<span id="cb1-48"><a href="#cb1-48" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="fu">html</span><span class="vs">`<span style="color:green">Correct ✓</span>`</span><span class="op">;</span></span>
<span id="cb1-49"><a href="#cb1-49" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="fu">html</span><span class="vs">`<span style="color:red">Not Yet! ✗</span>`</span><span class="op">;</span></span>
<span id="cb1-50"><a href="#cb1-50" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell" data-context="setup">
<div>
<div id="webr-3" class="exercise-cell">
</div>
<script type="webr-3-contents">
eyJhdHRyIjp7ImVjaG8iOmZhbHNlLCJvdXRwdXQiOmZhbHNlLCJlZGl0IjpmYWxzZSwicGVyc2lzdCI6dHJ1ZSwiZXZhbCI6dHJ1ZSwiY29udGV4dCI6InNldHVwIn0sImNvZGUiOiJcbmxpYnJhcnkoZHBseXIpXG5saWJyYXJ5KGdncGxvdDIpXG5saWJyYXJ5KG9wZW5pbnRybylcbmxpYnJhcnkocGF0Y2h3b3JrKVxubGlicmFyeShqc29ubGl0ZSlcbmxpYnJhcnkoYmFzZTY0ZW5jKVxubGlicmFyeShza2ltcilcblxuZGF0YShhbWVzKVxuXG5hcmVhICA8LSBhbWVzJGFyZWFcbnByaWNlIDwtIGFtZXMkcHJpY2VcblxudGhlbWVfc2V0KHRoZW1lX2J3KGJhc2Vfc2l6ZSA9IDEyKSlcblxucGxvdF9jaSA8LSBmdW5jdGlvbihsbywgaGksIG0pIHtcbiAgcGFyKG1hciA9IGMoMiwgMSwgMSwgMSksIG1ncCA9IGMoMi43LCAwLjcsIDApKVxuICBrIDwtIGxlbmd0aChsbylcbiAgY2kubWF4IDwtIG1heChyb3dTdW1zKG1hdHJpeChjKC0xICogbG8sIGhpKSwgbmNvbCA9IDIpKSlcblxuICB4UiA8LSBtICsgY2kubWF4ICogYygtMSwgMSlcbiAgeVIgPC0gYygwLCA0MSAqIGsgLyA0MClcblxuICBwbG90KHhSLCB5UiwgdHlwZSA9IFwiblwiLCB4bGFiID0gXCJcIiwgeWxhYiA9IFwiXCIsIGF4ZXMgPSBGQUxTRSlcbiAgYWJsaW5lKHYgPSBtLCBsdHkgPSAyLCBjb2wgPSBcIiMwMDAwMDA4OFwiKVxuICBheGlzKDEsIGF0ID0gbSwgcGFzdGUoXCJtdSA9XCIsIHJvdW5kKG0sIDQpKSwgY2V4LmF4aXMgPSAxLjE1KVxuXG4gIGZvciAoaSBpbiAxOmspIHtcbiAgICB4ICA8LSBtZWFuKGMoaGlbaV0sIGxvW2ldKSlcbiAgICBjaSA8LSBjKGxvW2ldLCBoaVtpXSlcbiAgICBpZiAoKG0gPCBoaVtpXSAmIG0gPiBsb1tpXSkgPT0gRkFMU0UpIHtcbiAgICAgIGNvbCA8LSBcIiNGMDUxMzNcIlxuICAgICAgcG9pbnRzKHgsIGksIGNleCA9IDEuNCwgY29sID0gY29sKVxuICAgICAgbGluZXMoY2ksIHJlcChpLCAyKSwgY29sID0gY29sLCBsd2QgPSA1KVxuICAgIH0gZWxzZSB7XG4gICAgICBjb2wgPC0gMVxuICAgICAgcG9pbnRzKHgsIGksIHBjaCA9IDIwLCBjZXggPSAxLjIsIGNvbCA9IGNvbClcbiAgICAgIGxpbmVzKGNpLCByZXAoaSwgMiksIGNvbCA9IGNvbClcbiAgICB9XG4gIH1cbn1cblxuZXhlcmNpc2VfcmVzdWx0cyA8LSBsaXN0KFxuICBub3RlYm9vayAgICAgICA9IFwiVG9waWMgMTA6IEludHJvZHVjdGlvbiB0byBJbmZlcmVuY2UgTGFiXCIsXG4gIGFzc2lnbiAgICAgICAgID0gXCJ1bmF0dGVtcHRlZFwiLFxuICBzbWFsbF9sb29wICAgICA9IFwidW5hdHRlbXB0ZWRcIixcbiAgc2FtcDEwX3NhbXAxMDAgPSBcInVuYXR0ZW1wdGVkXCIsXG4gIHNhbXA2MCAgICAgICAgID0gXCJ1bmF0dGVtcHRlZFwiXG4pIn0=
</script>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
About
</div>
</div>
<div class="callout-body-container callout-body">
<p>In this lab, we investigate the ways in which statistics from a random sample can serve as point estimates for population parameters. We dig deeper into the Central Limit Theorem, explore connections between sample size and uncertainty, and introduce the notion of the confidence interval.</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb2" data-startfrom="131" data-source-offset="0"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 130;"><span id="cb2-131"><a href="#cb2-131" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb2-132"><a href="#cb2-132" aria-hidden="true" tabindex="-1"></a> <span class="kw">const</span> btn <span class="op">=</span> <span class="fu">html</span><span class="vs">`<button style="</span></span>
<span id="cb2-133"><a href="#cb2-133" aria-hidden="true" tabindex="-1"></a><span class="vs"> background: #436b95;</span></span>
<span id="cb2-134"><a href="#cb2-134" aria-hidden="true" tabindex="-1"></a><span class="vs"> color: white;</span></span>
<span id="cb2-135"><a href="#cb2-135" aria-hidden="true" tabindex="-1"></a><span class="vs"> border: none;</span></span>
<span id="cb2-136"><a href="#cb2-136" aria-hidden="true" tabindex="-1"></a><span class="vs"> padding: 8px 16px;</span></span>
<span id="cb2-137"><a href="#cb2-137" aria-hidden="true" tabindex="-1"></a><span class="vs"> border-radius: 4px;</span></span>
<span id="cb2-138"><a href="#cb2-138" aria-hidden="true" tabindex="-1"></a><span class="vs"> cursor: pointer;</span></span>
<span id="cb2-139"><a href="#cb2-139" aria-hidden="true" tabindex="-1"></a><span class="vs"> font-size: 0.9em;</span></span>
<span id="cb2-140"><a href="#cb2-140" aria-hidden="true" tabindex="-1"></a><span class="vs"> ">🔄 Reset My Responses</button>`</span><span class="op">;</span></span>
<span id="cb2-141"><a href="#cb2-141" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-142"><a href="#cb2-142" aria-hidden="true" tabindex="-1"></a> btn<span class="op">.</span><span class="at">onclick</span> <span class="op">=</span> () <span class="kw">=></span> {</span>
<span id="cb2-143"><a href="#cb2-143" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> (<span class="fu">confirm</span>(<span class="st">'Reset all responses for this activity? This cannot be undone.'</span>)) {</span>
<span id="cb2-144"><a href="#cb2-144" aria-hidden="true" tabindex="-1"></a> <span class="bu">Object</span><span class="op">.</span><span class="fu">keys</span>(localStorage)</span>
<span id="cb2-145"><a href="#cb2-145" aria-hidden="true" tabindex="-1"></a> <span class="op">.</span><span class="fu">filter</span>(k <span class="kw">=></span> k<span class="op">.</span><span class="fu">endsWith</span>(<span class="st">'_selected_t10'</span>) <span class="op">||</span> k<span class="op">.</span><span class="fu">endsWith</span>(<span class="st">'_correct_t10'</span>) <span class="op">||</span> k<span class="op">.</span><span class="fu">endsWith</span>(<span class="st">'_result_t10'</span>))</span>
<span id="cb2-146"><a href="#cb2-146" aria-hidden="true" tabindex="-1"></a> <span class="op">.</span><span class="fu">forEach</span>(k <span class="kw">=></span> localStorage<span class="op">.</span><span class="fu">removeItem</span>(k))<span class="op">;</span></span>
<span id="cb2-147"><a href="#cb2-147" aria-hidden="true" tabindex="-1"></a> location<span class="op">.</span><span class="fu">reload</span>()<span class="op">;</span></span>
<span id="cb2-148"><a href="#cb2-148" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb2-149"><a href="#cb2-149" aria-hidden="true" tabindex="-1"></a> }<span class="op">;</span></span>
<span id="cb2-150"><a href="#cb2-150" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-151"><a href="#cb2-151" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> btn<span class="op">;</span></span>
<span id="cb2-152"><a href="#cb2-152" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="expression">
</div>
</div>
</div>
<p><em>Note.</em> The button above resets multiple choice and checkbox questions. Currently, resetting code cells must be done manually via hitting the <em>Start Over</em> button on each individual interactive cell.</p>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
License
</div>
</div>
<div class="callout-body-container callout-body">
<p>This is a derivative of a product of OpenIntro that is released under a <a href="http://creativecommons.org/licenses/by-sa/3.0">Creative Commons Attribution-ShareAlike 3.0 Unported</a> license. This lab was adapted for OpenIntro by Andrew Bray and Mine Çetinkaya-Rundel from a lab written by Mark Hansen of UCLA Statistics.</p>
</div>
</div>
<section id="intro-to-inference-lab" class="level2">
<h2 class="anchored" data-anchor-id="intro-to-inference-lab">Intro to Inference Lab</h2>
<p>In this activity, we investigate the ways in which statistics from a random sample of data can serve as point estimates for population parameters. This activity builds off of the content from Topic 9, where we were exposed to the <em>sampling distribution</em> and the <em>Central Limit Theorem</em>. Here we will work to become more familiar with these two ideas and how we can use the sampling distribution to make claims about population-level data.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The Data</h2>
<p>We consider real estate data from the city of Ames, Iowa. The details of every real estate transaction in Ames is recorded by the City Assessor’s office. Our particular focus for this lab will be a dataset containing all residential home sales in Ames between 2006 and 2010. This collection represents our <em>population</em> of interest. While we typically don’t have access to population-level data, this will allow us to see the Central Limit Theorem in action and to measure how close our estimates come to the corresponding true population mean.</p>
<p>In this lab we investigate what we can learn about the full population of these home sales through random sampling. We’ll see how well our small samples can be used to estimate a population parameter. The data has been loaded for you and is stored in a variable called <code>ames</code>.</p>
<p>Use the code block below to answer some basic questions about the <code>ames</code> dataset.</p>
<div class="cell" data-exercise="explore-ames" data-caption="Ungraded, Exploratory Only">
<div>
<div id="webr-4" class="exercise-cell">
</div>
<script type="webr-4-contents">
eyJhdHRyIjp7ImNhcHRpb24iOiJVbmdyYWRlZCwgRXhwbG9yYXRvcnkgT25seSIsImV4ZXJjaXNlIjoiZXhwbG9yZS1hbWVzIiwicGVyc2lzdCI6dHJ1ZSwiZXZhbCI6dHJ1ZSwiZWRpdCI6dHJ1ZX0sImNvZGUiOiIjIEV4cGxvcmUgdGhlIGFtZXMgZGF0YXNldCJ9
</script>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="explore-ames">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-3-contents" aria-controls="callout-3" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 1
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-3" class="callout-3-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>You can call a data frame by name to print it out. You can also use functions like <code>head()</code>, <code>dim()</code>, and <code>glimpse()</code> to gain information as well.</p>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: The <code>ames</code> Dataset I
</div>
</div>
<div class="callout-body-container callout-body">
<p>What does each observation in the <code>ames</code> dataset represent?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb3" data-startfrom="204" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 203;"><span id="cb3-204"><a href="#cb3-204" aria-hidden="true" tabindex="-1"></a>mutable ok_response <span class="op">=</span> (response<span class="op">,</span> n) <span class="kw">=></span> { <span class="cf">return</span> <span class="fu">html</span><span class="vs">`Loading...`</span> }<span class="op">;</span></span>
<span id="cb3-205"><a href="#cb3-205" aria-hidden="true" tabindex="-1"></a>viewof q1 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb3-206"><a href="#cb3-206" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb3-207"><a href="#cb3-207" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The sale of a home in Ames, Iowa during the time period 2006 to 2010."</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb3-208"><a href="#cb3-208" aria-hidden="true" tabindex="-1"></a> [<span class="st">"A house in Ames, Iowa."</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb3-209"><a href="#cb3-209" aria-hidden="true" tabindex="-1"></a> [<span class="st">"A person."</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb3-210"><a href="#cb3-210" aria-hidden="true" tabindex="-1"></a> [<span class="st">"A house listed for sale in Ames, Iowa."</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb3-211"><a href="#cb3-211" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb3-212"><a href="#cb3-212" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q1_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb3-213"><a href="#cb3-213" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb3-214"><a href="#cb3-214" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-215"><a href="#cb3-215" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb3-216"><a href="#cb3-216" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q1_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q1))<span class="op">;</span></span>
<span id="cb3-217"><a href="#cb3-217" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q1_correct_t10"</span><span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span>
<span id="cb3-218"><a href="#cb3-218" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q1_result_t10"</span><span class="op">,</span> q1 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q1 <span class="op">==</span> <span class="dv">1</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb3-219"><a href="#cb3-219" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-2" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-3" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb4" data-startfrom="220" data-source-offset="-601"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 219;"><span id="cb4-220"><a href="#cb4-220" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q1<span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-4" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: The <code>ames</code> Dataset II
</div>
</div>
<div class="callout-body-container callout-body">
<p>How many observations are there in the <code>ames</code> dataset?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb5" data-startfrom="233" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 232;"><span id="cb5-233"><a href="#cb5-233" aria-hidden="true" tabindex="-1"></a>viewof q2 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb5-234"><a href="#cb5-234" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb5-235"><a href="#cb5-235" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb5-236"><a href="#cb5-236" aria-hidden="true" tabindex="-1"></a> [<span class="st">"82"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb5-237"><a href="#cb5-237" aria-hidden="true" tabindex="-1"></a> [<span class="st">"2,006"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb5-238"><a href="#cb5-238" aria-hidden="true" tabindex="-1"></a> [<span class="st">"2,930"</span><span class="op">,</span> <span class="dv">4</span>]<span class="op">,</span></span>
<span id="cb5-239"><a href="#cb5-239" aria-hidden="true" tabindex="-1"></a> [<span class="st">"It is impossible to tell."</span><span class="op">,</span> <span class="dv">5</span>]</span>
<span id="cb5-240"><a href="#cb5-240" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb5-241"><a href="#cb5-241" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q2_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb5-242"><a href="#cb5-242" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb5-243"><a href="#cb5-243" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-244"><a href="#cb5-244" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb5-245"><a href="#cb5-245" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q2_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q2))<span class="op">;</span></span>
<span id="cb5-246"><a href="#cb5-246" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q2_correct_t10"</span><span class="op">,</span> <span class="st">"4"</span>)<span class="op">;</span></span>
<span id="cb5-247"><a href="#cb5-247" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q2_result_t10"</span><span class="op">,</span> q2 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q2 <span class="op">==</span> <span class="dv">4</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb5-248"><a href="#cb5-248" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb6" data-startfrom="249" data-source-offset="-446"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 248;"><span id="cb6-249"><a href="#cb6-249" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q2<span class="op">,</span> <span class="st">"4"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: The <code>ames</code> Dataset III
</div>
</div>
<div class="callout-body-container callout-body">
<p>How many variables are there in the <code>ames</code> dataset?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb7" data-startfrom="262" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 261;"><span id="cb7-262"><a href="#cb7-262" aria-hidden="true" tabindex="-1"></a>viewof q3 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb7-263"><a href="#cb7-263" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb7-264"><a href="#cb7-264" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb7-265"><a href="#cb7-265" aria-hidden="true" tabindex="-1"></a> [<span class="st">"82"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb7-266"><a href="#cb7-266" aria-hidden="true" tabindex="-1"></a> [<span class="st">"2,006"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb7-267"><a href="#cb7-267" aria-hidden="true" tabindex="-1"></a> [<span class="st">"2,930"</span><span class="op">,</span> <span class="dv">4</span>]<span class="op">,</span></span>
<span id="cb7-268"><a href="#cb7-268" aria-hidden="true" tabindex="-1"></a> [<span class="st">"It is impossible to tell."</span><span class="op">,</span> <span class="dv">5</span>]</span>
<span id="cb7-269"><a href="#cb7-269" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb7-270"><a href="#cb7-270" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q3_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb7-271"><a href="#cb7-271" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb7-272"><a href="#cb7-272" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-273"><a href="#cb7-273" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb7-274"><a href="#cb7-274" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q3_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q3))<span class="op">;</span></span>
<span id="cb7-275"><a href="#cb7-275" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q3_correct_t10"</span><span class="op">,</span> <span class="st">"2"</span>)<span class="op">;</span></span>
<span id="cb7-276"><a href="#cb7-276" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q3_result_t10"</span><span class="op">,</span> q3 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q3 <span class="op">==</span> <span class="dv">2</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb7-277"><a href="#cb7-277" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-5-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-5-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb8" data-startfrom="278" data-source-offset="-446"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 277;"><span id="cb8-278"><a href="#cb8-278" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q3<span class="op">,</span> <span class="st">"2"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-5-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<p>We see that there are quite a few variables in the data set — enough to do a very in-depth analysis. For this lab, we’ll restrict our attention to just two of the variables: the above ground living <code>area</code> of the house in square feet and the sale <code>price</code>. To save some effort throughout the lab, we’ll create two variables with short names that represent these two variables. The code block below is pre-set to define the <code>area</code> vector — add a second line which creates the <code>price</code> vector.</p>
<div class="cell" data-exercise="assign">
<div>
<div id="webr-5" class="exercise-cell">
</div>
<script type="webr-5-contents">
eyJhdHRyIjp7ImVkaXQiOnRydWUsInBlcnNpc3QiOnRydWUsImV2YWwiOnRydWUsImV4ZXJjaXNlIjoiYXNzaWduIn0sImNvZGUiOiJhcmVhIDwtIGFtZXMgfD5cbiAgcHVsbChhcmVhKSJ9
</script>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="assign">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-7-contents" aria-controls="callout-7" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 1
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-7" class="callout-7-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Start by copying the existing code and making changes to it. What needs to change?</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="assign">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-8-contents" aria-controls="callout-8" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 2
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-8" class="callout-8-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>We want to use a different variable name because (i) we don’t want to overwrite the existing <code>area</code> variable, and (ii) we want the name to be meaningful.</p>
<p>We also don’t want to extract the <code>area</code> column again.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a>___ <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(___)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="assign">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-9-contents" aria-controls="callout-9" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 3
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-9" class="callout-9-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Store the results into a new variable called <code>price</code>, as requested in the prompt. What column from the <code>ames</code> data frame do you want to extract?</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a>price <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(___)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="assign">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-10-contents" aria-controls="callout-10" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 4 (Solved)
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-10" class="callout-10-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Store the results into a new variable called <code>price</code>, as requested in the prompt. You want to extract the <code>price</code> column.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a>price <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(price)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="cell" data-exercise="assign" data-solution="true">
<div class="webr-ojs-exercise exercise-solution d-none" data-exercise="assign">
<code id="interpolate-7" class="solution-code d-none">
area <- ames |>
pull(area)
price <- ames |>
pull(price)</code>
<div class="sourceCode cell-code" id="interpolate-8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="interpolate-8-1"><a href="#interpolate-8-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="interpolate-8-2"><a href="#interpolate-8-2" aria-hidden="true" tabindex="-1"></a>area <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="interpolate-8-3"><a href="#interpolate-8-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(area)</span>
<span id="interpolate-8-4"><a href="#interpolate-8-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="interpolate-8-5"><a href="#interpolate-8-5" aria-hidden="true" tabindex="-1"></a>price <span class="ot"><-</span> ames <span class="sc">|></span></span>
<span id="interpolate-8-6"><a href="#interpolate-8-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">pull</span>(price)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
<div class="cell" data-exercise="assign" data-check="true">
<script type="exercise-check-assign-contents">
eyJhdHRyIjp7ImNoZWNrIjp0cnVlLCJlZGl0Ijp0cnVlLCJleGVyY2lzZSI6ImFzc2lnbiIsInBlcnNpc3QiOnRydWUsImV2YWwiOnRydWV9LCJjb2RlIjoiXG5leGVyY2lzZV9yZXN1bHRzJGFzc2lnbiA8PC0gXCJmYWlsXCJcbmdyYWRldGhpczo6Z3JhZGVfdGhpcyh7XG4gIGZlZWRiYWNrIDwtIGdyYWRldGhpczo6Y29kZV9mZWVkYmFjaygpXG4gIGlmIChpcy5udWxsKGZlZWRiYWNrKSkge1xuICAgIGV4ZXJjaXNlX3Jlc3VsdHMkYXNzaWduIDw8LSBcInBhc3NcIlxuICAgIHBhc3MocmFuZG9tX3ByYWlzZSgpKVxuICB9XG4gIGZhaWwocmFuZG9tX2VuY291cmFnZW1lbnQoKSlcbn0pIn0=
</script>
</div>
</section>
<section id="initial-exploration" class="level2">
<h2 class="anchored" data-anchor-id="initial-exploration">Initial Exploration</h2>
<p>Let’s look at the distributions of <code>price</code> and <code>area</code> in our population of home sales by calculating a few summary statistics. Use the code block below to find the mean and median for both <code>price</code> and <code>area</code>. Use your results to answer the questions that follow.</p>
<div class="cell" data-exercise="eda-sandbox" data-caption="Ungraded, Exploratory Only">
<div>
<div id="webr-10" class="exercise-cell">
</div>
<script type="webr-10-contents">
eyJhdHRyIjp7ImNhcHRpb24iOiJVbmdyYWRlZCwgRXhwbG9yYXRvcnkgT25seSIsImV4ZXJjaXNlIjoiZWRhLXNhbmRib3giLCJwZXJzaXN0Ijp0cnVlLCJldmFsIjp0cnVlLCJlZGl0Ijp0cnVlfSwiY29kZSI6IiMgQ29tcHV0ZSBzdW1tYXJ5IHN0YXRpc3RpY3MgZm9yIGFyZWEgYW5kIHByaWNlIn0=
</script>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="eda-sandbox">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-11-contents" aria-controls="callout-11" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 1
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-11" class="callout-11-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>The <code>area</code> and <code>price</code> objects are vectors of values. Pass them, one at a time, to the <code>mean()</code> and <code>median()</code> functions.</p>
</div>
</div>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="eda-sandbox">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-12-contents" aria-controls="callout-12" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 2
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-12" class="callout-12-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Fill in the blanks:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(___)</span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(___)</span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(___)</span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(___)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics I
</div>
</div>
<div class="callout-body-container callout-body">
<p>Which of the following is the mean of the <code>price</code> variable?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb14" data-startfrom="446" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 445;"><span id="cb14-446"><a href="#cb14-446" aria-hidden="true" tabindex="-1"></a>viewof q4 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb14-447"><a href="#cb14-447" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb14-448"><a href="#cb14-448" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$160,000"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb14-449"><a href="#cb14-449" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$167,842.47"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb14-450"><a href="#cb14-450" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$180,796.10"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb14-451"><a href="#cb14-451" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$200,000"</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb14-452"><a href="#cb14-452" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb14-453"><a href="#cb14-453" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q4_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb14-454"><a href="#cb14-454" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb14-455"><a href="#cb14-455" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-456"><a href="#cb14-456" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb14-457"><a href="#cb14-457" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q4_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q4))<span class="op">;</span></span>
<span id="cb14-458"><a href="#cb14-458" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q4_correct_t10"</span><span class="op">,</span> <span class="st">"3"</span>)<span class="op">;</span></span>
<span id="cb14-459"><a href="#cb14-459" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q4_result_t10"</span><span class="op">,</span> q4 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q4 <span class="op">==</span> <span class="dv">3</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb14-460"><a href="#cb14-460" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-6-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-6-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb15" data-startfrom="461" data-source-offset="-433"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 460;"><span id="cb15-461"><a href="#cb15-461" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q4<span class="op">,</span> <span class="st">"3"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-6-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics II
</div>
</div>
<div class="callout-body-container callout-body">
<p>Which of the following is the median of the <code>price</code> variable?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb16" data-startfrom="474" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 473;"><span id="cb16-474"><a href="#cb16-474" aria-hidden="true" tabindex="-1"></a>viewof q5 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb16-475"><a href="#cb16-475" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb16-476"><a href="#cb16-476" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$160,000"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb16-477"><a href="#cb16-477" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$167,842.47"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb16-478"><a href="#cb16-478" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$180,796.10"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb16-479"><a href="#cb16-479" aria-hidden="true" tabindex="-1"></a> [<span class="st">"$200,000"</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb16-480"><a href="#cb16-480" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb16-481"><a href="#cb16-481" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q5_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb16-482"><a href="#cb16-482" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb16-483"><a href="#cb16-483" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb16-484"><a href="#cb16-484" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb16-485"><a href="#cb16-485" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q5_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q5))<span class="op">;</span></span>
<span id="cb16-486"><a href="#cb16-486" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q5_correct_t10"</span><span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span>
<span id="cb16-487"><a href="#cb16-487" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q5_result_t10"</span><span class="op">,</span> q5 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q5 <span class="op">==</span> <span class="dv">1</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb16-488"><a href="#cb16-488" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-7-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-7-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb17" data-startfrom="489" data-source-offset="-433"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 488;"><span id="cb17-489"><a href="#cb17-489" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q5<span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-7-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics III
</div>
</div>
<div class="callout-body-container callout-body">
<p>What does the relationship between the mean and median tell you about the distribution of <code>price</code>?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb18" data-startfrom="502" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 501;"><span id="cb18-502"><a href="#cb18-502" aria-hidden="true" tabindex="-1"></a>viewof q6 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb18-503"><a href="#cb18-503" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb18-504"><a href="#cb18-504" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `price` variable is skewed right."</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb18-505"><a href="#cb18-505" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `price` variable is skewed left."</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb18-506"><a href="#cb18-506" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `price` variable is bimodal."</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb18-507"><a href="#cb18-507" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `price` variable is symmetric."</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb18-508"><a href="#cb18-508" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb18-509"><a href="#cb18-509" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q6_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb18-510"><a href="#cb18-510" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb18-511"><a href="#cb18-511" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-512"><a href="#cb18-512" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb18-513"><a href="#cb18-513" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q6_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q6))<span class="op">;</span></span>
<span id="cb18-514"><a href="#cb18-514" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q6_correct_t10"</span><span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span>
<span id="cb18-515"><a href="#cb18-515" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q6_result_t10"</span><span class="op">,</span> q6 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q6 <span class="op">==</span> <span class="dv">1</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb18-516"><a href="#cb18-516" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-8-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-8-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb19" data-startfrom="517" data-source-offset="-534"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 516;"><span id="cb19-517"><a href="#cb19-517" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q6<span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-8-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics IV
</div>
</div>
<div class="callout-body-container callout-body">
<p>Which of the following is the mean of the <code>area</code> variable?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb20" data-startfrom="530" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 529;"><span id="cb20-530"><a href="#cb20-530" aria-hidden="true" tabindex="-1"></a>viewof q7 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb20-531"><a href="#cb20-531" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb20-532"><a href="#cb20-532" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,442 sqft"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb20-533"><a href="#cb20-533" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,458.42 sqft"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb20-534"><a href="#cb20-534" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,462.5 sqft"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb20-535"><a href="#cb20-535" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,499.69 sqft"</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb20-536"><a href="#cb20-536" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb20-537"><a href="#cb20-537" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q7_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb20-538"><a href="#cb20-538" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb20-539"><a href="#cb20-539" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb20-540"><a href="#cb20-540" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb20-541"><a href="#cb20-541" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q7_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q7))<span class="op">;</span></span>
<span id="cb20-542"><a href="#cb20-542" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q7_correct_t10"</span><span class="op">,</span> <span class="st">"4"</span>)<span class="op">;</span></span>
<span id="cb20-543"><a href="#cb20-543" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q7_result_t10"</span><span class="op">,</span> q7 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q7 <span class="op">==</span> <span class="dv">4</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb20-544"><a href="#cb20-544" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-9-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-9-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb21" data-startfrom="545" data-source-offset="-443"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 544;"><span id="cb21-545"><a href="#cb21-545" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q7<span class="op">,</span> <span class="st">"4"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-9-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics V
</div>
</div>
<div class="callout-body-container callout-body">
<p>Which of the following is the median of the <code>area</code> variable?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb22" data-startfrom="558" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 557;"><span id="cb22-558"><a href="#cb22-558" aria-hidden="true" tabindex="-1"></a>viewof q8 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb22-559"><a href="#cb22-559" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb22-560"><a href="#cb22-560" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,442 sqft"</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb22-561"><a href="#cb22-561" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,458.42 sqft"</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb22-562"><a href="#cb22-562" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,462.5 sqft"</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb22-563"><a href="#cb22-563" aria-hidden="true" tabindex="-1"></a> [<span class="st">"1,499.69 sqft"</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb22-564"><a href="#cb22-564" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb22-565"><a href="#cb22-565" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q8_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb22-566"><a href="#cb22-566" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb22-567"><a href="#cb22-567" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb22-568"><a href="#cb22-568" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb22-569"><a href="#cb22-569" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q8_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q8))<span class="op">;</span></span>
<span id="cb22-570"><a href="#cb22-570" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q8_correct_t10"</span><span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span>
<span id="cb22-571"><a href="#cb22-571" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q8_result_t10"</span><span class="op">,</span> q8 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q8 <span class="op">==</span> <span class="dv">1</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb22-572"><a href="#cb22-572" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb23" data-startfrom="573" data-source-offset="-443"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 572;"><span id="cb23-573"><a href="#cb23-573" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q8<span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Check Your Understanding: Summary Statistics VI
</div>
</div>
<div class="callout-body-container callout-body">
<p>What does the relationship between the mean and median tell you about the distribution of <code>area</code>?</p>
<div class="cell">
<div class="sourceCode cell-code hidden" id="cb24" data-startfrom="586" data-source-offset="-1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 585;"><span id="cb24-586"><a href="#cb24-586" aria-hidden="true" tabindex="-1"></a>viewof q9 <span class="op">=</span> Inputs<span class="op">.</span><span class="fu">radio</span>(</span>
<span id="cb24-587"><a href="#cb24-587" aria-hidden="true" tabindex="-1"></a> <span class="kw">new</span> <span class="bu">Map</span>([</span>
<span id="cb24-588"><a href="#cb24-588" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `area` variable is skewed right."</span><span class="op">,</span> <span class="dv">1</span>]<span class="op">,</span></span>
<span id="cb24-589"><a href="#cb24-589" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `area` variable is skewed left."</span><span class="op">,</span> <span class="dv">2</span>]<span class="op">,</span></span>
<span id="cb24-590"><a href="#cb24-590" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `area` variable is bimodal."</span><span class="op">,</span> <span class="dv">3</span>]<span class="op">,</span></span>
<span id="cb24-591"><a href="#cb24-591" aria-hidden="true" tabindex="-1"></a> [<span class="st">"The `area` variable is symmetric."</span><span class="op">,</span> <span class="dv">4</span>]</span>
<span id="cb24-592"><a href="#cb24-592" aria-hidden="true" tabindex="-1"></a> ])<span class="op">,</span></span>
<span id="cb24-593"><a href="#cb24-593" aria-hidden="true" tabindex="-1"></a> {<span class="dt">value</span><span class="op">:</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">parse</span>(localStorage<span class="op">.</span><span class="fu">getItem</span>(<span class="st">"q9_selected_t10"</span>) <span class="op">??</span> <span class="st">"null"</span>)}</span>
<span id="cb24-594"><a href="#cb24-594" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
<span id="cb24-595"><a href="#cb24-595" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb24-596"><a href="#cb24-596" aria-hidden="true" tabindex="-1"></a>{</span>
<span id="cb24-597"><a href="#cb24-597" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q9_selected_t10"</span><span class="op">,</span> <span class="bu">JSON</span><span class="op">.</span><span class="fu">stringify</span>(q9))<span class="op">;</span></span>
<span id="cb24-598"><a href="#cb24-598" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q9_correct_t10"</span><span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span>
<span id="cb24-599"><a href="#cb24-599" aria-hidden="true" tabindex="-1"></a> localStorage<span class="op">.</span><span class="fu">setItem</span>(<span class="st">"q9_result_t10"</span><span class="op">,</span> q9 <span class="op">===</span> <span class="kw">null</span> <span class="op">?</span> <span class="st">"unattempted"</span> <span class="op">:</span> (q9 <span class="op">==</span> <span class="dv">1</span> <span class="op">?</span> <span class="st">"correct"</span> <span class="op">:</span> <span class="st">"incorrect"</span>))<span class="op">;</span></span>
<span id="cb24-600"><a href="#cb24-600" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-11-1" data-nodetype="declaration">
</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-11-2" data-nodetype="expression">
</div>
</div>
</div>
<div class="sourceCode cell-code hidden" id="cb25" data-startfrom="601" data-source-offset="-530"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 600;"><span id="cb25-601"><a href="#cb25-601" aria-hidden="true" tabindex="-1"></a><span class="fu">ok_response</span>(q9<span class="op">,</span> <span class="st">"1"</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-11-3" data-nodetype="expression">
</div>
</div>
</div>
</div>
</div>
</div>
<p>Use the code block below to verify your answers about the shapes of the distributions. The code to produce the histogram and boxplot for <code>area</code> is already present. Add the code necessary to produce a histogram and boxplot for <code>price</code>. Are you able to see the skew in the distributions?</p>
<div class="cell" data-exercise="plot-area-price-dists" data-caption="Ungraded, Exploratory Only">
<div>
<div id="webr-11" class="exercise-cell">
</div>
<script type="webr-11-contents">
eyJhdHRyIjp7ImNhcHRpb24iOiJVbmdyYWRlZCwgRXhwbG9yYXRvcnkgT25seSIsImVkaXQiOnRydWUsImV4ZXJjaXNlIjoicGxvdC1hcmVhLXByaWNlLWRpc3RzIiwibWVzc2FnZSI6ZmFsc2UsInBlcnNpc3QiOnRydWUsImV2YWwiOnRydWUsIndhcm5pbmciOmZhbHNlfSwiY29kZSI6ImdncGxvdCgpICsgXG4gIGdlb21faGlzdG9ncmFtKGFlcyh4ID0gYXJlYSkpICsgXG4gIGxhYnModGl0bGUgPSBcIkhpc3RvZ3JhbSBvZiBIb21lIFNpemVcIixcbiAgICAgICB4ID0gXCJTaXplIChzcSBmdClcIiwgeSA9IFwiQ291bnRcIilcblxuZ2dwbG90KCkgKyBcbiAgZ2VvbV9ib3hwbG90KGFlcyh4ID0gYXJlYSkpICsgXG4gIGxhYnModGl0bGUgPSBcIkJveHBsb3Qgb2YgSG9tZSBTaXplc1wiLFxuICAgICAgIHggPSBcIlNpemUgKHNxIGZ0KVwiKSJ9
</script>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="plot-area-price-dists">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-19-contents" aria-controls="callout-19" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 1
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-19" class="callout-19-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<p>Start by copying and pasting the code for the existing plots. What needs to be changed?</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb26"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>() <span class="sc">+</span> </span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_histogram</span>(<span class="fu">aes</span>(<span class="at">x =</span> area)) <span class="sc">+</span> </span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="st">"Histogram of Home Size"</span>,</span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a> <span class="at">x =</span> <span class="st">"Size (sq ft)"</span>, <span class="at">y =</span> <span class="st">"Count"</span>)</span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>() <span class="sc">+</span> </span>
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_boxplot</span>(<span class="fu">aes</span>(<span class="at">x =</span> area)) <span class="sc">+</span> </span>
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="st">"Boxplot of Home Sizes"</span>,</span>
<span id="cb26-9"><a href="#cb26-9" aria-hidden="true" tabindex="-1"></a> <span class="at">x =</span> <span class="st">"Size (sq ft)"</span>)</span>
<span id="cb26-10"><a href="#cb26-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-11"><a href="#cb26-11" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>() <span class="sc">+</span> </span>
<span id="cb26-12"><a href="#cb26-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_histogram</span>(<span class="fu">aes</span>(<span class="at">x =</span> area)) <span class="sc">+</span> </span>
<span id="cb26-13"><a href="#cb26-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="st">"Histogram of Home Size"</span>,</span>
<span id="cb26-14"><a href="#cb26-14" aria-hidden="true" tabindex="-1"></a> <span class="at">x =</span> <span class="st">"Size (sq ft)"</span>, <span class="at">y =</span> <span class="st">"Count"</span>)</span>
<span id="cb26-15"><a href="#cb26-15" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-16"><a href="#cb26-16" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>() <span class="sc">+</span> </span>
<span id="cb26-17"><a href="#cb26-17" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_boxplot</span>(<span class="fu">aes</span>(<span class="at">x =</span> area)) <span class="sc">+</span> </span>
<span id="cb26-18"><a href="#cb26-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="st">"Boxplot of Home Sizes"</span>,</span>
<span id="cb26-19"><a href="#cb26-19" aria-hidden="true" tabindex="-1"></a> <span class="at">x =</span> <span class="st">"Size (sq ft)"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="hint webr-ojs-exercise exercise-hint d-none" data-exercise="plot-area-price-dists">
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-20-contents" aria-controls="callout-20" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Hint 2
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>