-
Notifications
You must be signed in to change notification settings - Fork 47
/
progress.html
1808 lines (1604 loc) · 126 KB
/
progress.html
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 lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>Changing Hearts and Minds — Probably Overthinking It</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=e353d410970836974a52" rel="stylesheet" />
<link href="_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=e353d410970836974a52" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=14f4ca6b54d191a8c7657f6c759bf11a5fb86285" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
<link rel="stylesheet" type="text/css" href="_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=e353d410970836974a52" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=e353d410970836974a52" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/scripts/sphinx-book-theme.js?digest=5a5c038af52cf7bc1a1ec88eea08e6366ee68824"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="_static/togglebutton.js"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="_static/design-tabs.js"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"
const thebe_selector = ".thebe,.cell"
const thebe_selector_input = "pre"
const thebe_selector_output = ".output, .cell_output"
</script>
<script async="async" src="_static/sphinx-thebe.js"></script>
<script>window.MathJax = {"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]]}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'progress';</script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Chasing the Overton Window" href="overton.html" />
<link rel="prev" title="Penguins, Pessimists, and Paradoxes" href="simpson.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<a class="skip-link" href="#main-content">Skip to main content</a>
<input type="checkbox"
class="sidebar-toggle"
name="__primary"
id="__primary"/>
<label class="overlay overlay-primary" for="__primary"></label>
<input type="checkbox"
class="sidebar-toggle"
name="__secondary"
id="__secondary"/>
<label class="overlay overlay-secondary" for="__secondary"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search this book..."
aria-label="Search this book..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<nav class="bd-header navbar navbar-expand-lg bd-navbar">
</nav>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="intro.html">
<p class="title logo__title">Probably Overthinking It</p>
</a></div>
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="intro.html">
Probably Overthinking It
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Chapters</span></p>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="gaussian.html">Are You Normal? Hint: No.</a></li>
<li class="toctree-l1"><a class="reference internal" href="inspection.html">Relay Races and Revolving Doors</a></li>
<li class="toctree-l1"><a class="reference internal" href="preston.html">Defy Tradition, Save the World</a></li>
<li class="toctree-l1"><a class="reference internal" href="lognormal.html">Extremes, Outliers, and GOATs</a></li>
<li class="toctree-l1"><a class="reference internal" href="nbue.html">Better Than New</a></li>
<li class="toctree-l1"><a class="reference internal" href="berkson.html">Jumping to Conclusions</a></li>
<li class="toctree-l1"><a class="reference internal" href="birthweight.html">Causation, Collision, and Confusion</a></li>
<li class="toctree-l1"><a class="reference internal" href="longtail.html">The Long Tail of Disaster</a></li>
<li class="toctree-l1"><a class="reference internal" href="base_rate.html">Fairness and Fallacy</a></li>
<li class="toctree-l1"><a class="reference internal" href="simpson.html">Penguins, Pessimists, and Paradoxes</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Changing Hearts and Minds</a></li>
<li class="toctree-l1"><a class="reference internal" href="overton.html">Chasing the Overton Window</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Examples</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="ansur_pca.html">The Principal Components of Anthropometry</a></li>
<li class="toctree-l1"><a class="reference internal" href="bertrand.html">Bertrand’s Boxes</a></li>
<li class="toctree-l1"><a class="reference internal" href="ideology_gap.html">Is the Ideology Gap Growing?</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><label class="sidebar-toggle primary-toggle btn btn-sm" for="__primary" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</label></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<a href="https://github.com/AllenDowney/ProbablyOverthinkingIt" target="_blank"
class="btn btn-sm btn-source-repository-button"
title="Source repository"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
</a>
<div class="dropdown dropdown-download-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<ul class="dropdown-menu">
<li><a href="_sources/progress.ipynb" target="_blank"
class="btn btn-sm btn-download-source-button dropdown-item"
title="Download source file"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="btn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="window.print()"
class="btn btn-sm btn-download-pdf-button dropdown-item"
title="Print to PDF"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
<span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
<span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
`);
</script>
<label class="sidebar-toggle secondary-toggle btn btn-sm" for="__secondary"title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</label>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1>Changing Hearts and Minds</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> Contents </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#old-racists">Old Racists?</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#young-feminists">Young Feminists</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#the-remarkable-decline-of-homophobia">The Remarkable Decline of Homophobia</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#what-happened-in-1990">What happened in 1990?</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#cohort-or-period-effect">Cohort or period effect?</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#the-overton-window">The Overton Window</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#sources-and-related-reading">Sources and related reading</a></li>
</ul>
</nav>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article" role="main">
<section id="changing-hearts-and-minds">
<h1>Changing Hearts and Minds<a class="headerlink" href="#changing-hearts-and-minds" title="Permalink to this heading">#</a></h1>
<p><a class="reference external" href="https://colab.research.google.com/github/AllenDowney/ProbablyOverthinkingIt/blob/book/notebooks/progress.ipynb">Click here to run this notebook on Colab</a>.</p>
<div class="cell tag_hide-cell docutils container">
<details class="hide above-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell content</span>
<span class="expanded">Hide code cell content</span>
</summary>
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Install empirical dist if we don't already have it</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">empiricaldist</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="o">!</span>pip<span class="w"> </span>install<span class="w"> </span>empiricaldist
</pre></div>
</div>
</div>
</details>
</div>
<div class="cell tag_hide-cell docutils container">
<details class="hide above-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell content</span>
<span class="expanded">Hide code cell content</span>
</summary>
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># download utils.py</span>
<span class="kn">from</span> <span class="nn">os.path</span> <span class="kn">import</span> <span class="n">basename</span><span class="p">,</span> <span class="n">exists</span>
<span class="k">def</span> <span class="nf">download</span><span class="p">(</span><span class="n">url</span><span class="p">):</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">basename</span><span class="p">(</span><span class="n">url</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">urllib.request</span> <span class="kn">import</span> <span class="n">urlretrieve</span>
<span class="n">local</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">urlretrieve</span><span class="p">(</span><span class="n">url</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">'Downloaded '</span> <span class="o">+</span> <span class="n">local</span><span class="p">)</span>
<span class="n">download</span><span class="p">(</span><span class="s2">"https://github.com/AllenDowney/ProbablyOverthinkingIt/raw/book/notebooks/utils.py"</span><span class="p">)</span>
</pre></div>
</div>
</div>
</details>
</div>
<div class="cell tag_hide-cell docutils container">
<details class="hide above-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell content</span>
<span class="expanded">Hide code cell content</span>
</summary>
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">seaborn</span> <span class="k">as</span> <span class="nn">sns</span>
<span class="kn">from</span> <span class="nn">utils</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">set_pyplot_params</span><span class="p">,</span>
<span class="n">underride</span><span class="p">,</span>
<span class="n">decorate</span><span class="p">,</span>
<span class="n">decorate_table</span><span class="p">,</span>
<span class="n">prepare_yvar</span><span class="p">,</span>
<span class="n">run_subgroups</span><span class="p">,</span>
<span class="n">chunk_series</span><span class="p">,</span>
<span class="n">make_table</span><span class="p">,</span>
<span class="n">visualize_table</span><span class="p">,</span>
<span class="n">label_table</span><span class="p">,</span>
<span class="n">label_table_left</span><span class="p">,</span>
<span class="n">make_lowess</span><span class="p">,</span>
<span class="n">plot_series_lowess</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
</details>
</div>
<div class="cell tag_hide-cell docutils container">
<details class="hide above-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell content</span>
<span class="expanded">Hide code cell content</span>
</summary>
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Set the random seed so we get the same results every time</span>
<span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">seed</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span>
</pre></div>
</div>
</div>
</details>
</div>
<p>In 1950, the physicist Max Planck made a bleak assessment of progress in science.
He wrote, “A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it.”
Scientists often quote a pithier version attributed to economist Paul A. Samuelson: “Science progresses, one funeral at a time.”
According to this view, science progresses by generational replacement alone, not changed minds.</p>
<p>I am not sure that Planck and Samuelson are right about science, but I don’t have the data to check.
However, thanks to the General Social Survey (GSS), we have the data to assess a different kind of progress, the expansion of the “moral circle”.</p>
<p>The idea of the moral circle was introduced by historian William Lecky in <em>A History of European Morals from Augustus to Charlemagne</em>, published in 1867. He wrote:</p>
<blockquote>
<div><p>At one time the benevolent affections embrace merely the family, soon the circle expanding includes first a class, then a nation, then a coalition of nations, then all humanity, and finally, its influence is felt in the dealings of man with the animal world.</p>
</div></blockquote>
<p>In this chapter we’ll use data from the GSS to explore the moral circle, focusing on questions related to race, sex, and sexual orientation.
We’ll find more examples of Simpson’s paradox, which we saw in the previous chapter.
For example, older people are more likely to hold racist views, but that doesn’t mean people become more racist as they get older.
To interpret this result and others like it, I’ll introduce a tool called age-period-cohort analysis and a concept called the Overton window.</p>
<p>Let’s start with race.</p>
<section id="old-racists">
<h2>Old Racists?<a class="headerlink" href="#old-racists" title="Permalink to this heading">#</a></h2>
<p>Stereotypes suggest that older people are more racist than young people.
To see whether that’s true, I’ll use responses to three questions in the General Social Survey related to race and public policy:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Do you think there should be laws against marriages between
(Negroes/Blacks/African-Americans) and whites?</p></li>
<li><p>If your party nominated a (Negro/Black/African-American) for President,
would you vote for him if he were qualified for the job?</p></li>
<li><p>Suppose there is a community-wide vote on the general housing issue. There are two possible laws to vote on. Which law would you vote for?</p>
<ul class="simple">
<li><p>One law says that a homeowner can decide for himself whom to sell his house to, even if he prefers not to sell to [people of a particular race].</p></li>
<li><p>The second law says that a homeowner cannot refuse to sell to someone because of their race or color.</p></li>
</ul>
</li>
</ol>
</div></blockquote>
<p>I chose these questions because they were added to the survey in the early 1970s and they have been asked almost every year since.
The words in parentheses indicate that the wording of these questions has changed over time to use contemporary terms for racial categories.</p>
<p>The following figure shows the responses to these questions as a function of the respondents’ ages.
To make it easy to compare answers to different questions, the <span class="math notranslate nohighlight">\(y\)</span> axis shows the percentage who chose what I characterize as the racist responses: that interracial marriage should be illegal; that the respondent would not vote for a black presidential candidate; and that it should be legal to refuse to sell a house to someone based on their race.</p>
<p>The results vary from year to year, so I’ve plotted a smooth curve to fit the data.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">DATA_PATH</span> <span class="o">=</span> <span class="s2">"https://github.com/AllenDowney/ProbablyOverthinkingIt/raw/book/data/"</span>
<span class="n">filename</span> <span class="o">=</span> <span class="s2">"gss_eds.3.hdf"</span>
<span class="n">download</span><span class="p">(</span><span class="n">DATA_PATH</span> <span class="o">+</span> <span class="n">filename</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">gss</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_hdf</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s2">"gss0"</span><span class="p">)</span>
<span class="n">gss</span><span class="o">.</span><span class="n">shape</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(68846, 205)
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">bins</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1889</span><span class="p">,</span> <span class="mi">2011</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="n">labels</span> <span class="o">=</span> <span class="n">bins</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span>
<span class="n">gss</span><span class="p">[</span><span class="s2">"cohort10"</span><span class="p">]</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">cut</span><span class="p">(</span><span class="n">gss</span><span class="p">[</span><span class="s2">"cohort"</span><span class="p">],</span> <span class="n">bins</span><span class="p">,</span> <span class="n">labels</span><span class="o">=</span><span class="n">labels</span><span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="nb">float</span><span class="p">)</span>
<span class="n">gss</span><span class="p">[</span><span class="s2">"cohort10"</span><span class="p">]</span><span class="o">.</span><span class="n">value_counts</span><span class="p">()</span><span class="o">.</span><span class="n">sort_index</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>cohort10
1890.0 455
1900.0 1717
1910.0 3663
1920.0 5959
1930.0 6992
1940.0 10777
1950.0 13981
1960.0 10724
1970.0 7286
1980.0 4499
1990.0 2022
2000.0 202
Name: count, dtype: int64
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">gss</span><span class="o">.</span><span class="n">dropna</span><span class="p">(</span><span class="n">subset</span><span class="o">=</span><span class="p">[</span><span class="s2">"cohort10"</span><span class="p">],</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">gss</span><span class="p">[</span><span class="s2">"cohort10"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"cohort10"</span><span class="p">]</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="nb">int</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<p>Start with an empty DataFrame and add columns for the 10 questions used in this chapter.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">ten_questions</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">gss</span><span class="p">[</span><span class="s2">"year"</span><span class="p">])</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racmar"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"r1"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_racmar</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racpres"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1"># would not vote</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"r2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_racpres</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racopen"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># would vote for the wrong law</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"r3"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_racopen</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">plot_series_lowess</span><span class="p">(</span><span class="n">series_racopen</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">"-"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C1"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"Housing law"</span><span class="p">)</span>
<span class="n">plot_series_lowess</span><span class="p">(</span><span class="n">series_racmar</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">":"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C0"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"Marriage"</span><span class="p">)</span>
<span class="n">plot_series_lowess</span><span class="p">(</span>
<span class="n">series_racpres</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">"--"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C2"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"Black candidate"</span>
<span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span><span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span> <span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s2">"Racist responses vs age"</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n">loc</span><span class="o">=</span><span class="s1">'upper left'</span><span class="p">,</span> <span class="n">bbox_to_anchor</span><span class="o">=</span><span class="p">(</span><span class="mf">1.02</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">yticks</span><span class="p">([</span><span class="mi">10</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">50</span><span class="p">])</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight_layout</span><span class="p">();</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/6c1b283781f071f21a5cc10e1b5b7bcccc55bfb316906703a7eee3b84cb65a86.png" src="_images/6c1b283781f071f21a5cc10e1b5b7bcccc55bfb316906703a7eee3b84cb65a86.png" />
</div>
</div>
<p>For all three questions, old people are substantially more likely to choose the racist response, so there is some truth to the stereotype.</p>
<p>But that raises a question: do people <em>become</em> more racist as they age, or do they persist in the beliefs they were raised with?
We can answer that with another view of the data.</p>
<p>The following figure shows responses to the first question, about interracial marriage, grouped by decade of birth and plotted by age.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racmar"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">table</span><span class="p">[</span><span class="mi">1980</span><span class="p">]</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>age
19.868421 1.315789
Name: 1980, dtype: float64
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">visualize_table</span><span class="p">(</span><span class="n">series_racmar</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">nudge</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"1970s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s2">"1960s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">2</span><span class="p">}</span>
<span class="n">label_table</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">nudge</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Interracial marriage: racist responses vs age"</span><span class="p">,</span>
<span class="n">legend</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/ff546dd79c8955093f7016b9f1f36e8e9c822c909e19f9ebdd38843823c87217.png" src="_images/ff546dd79c8955093f7016b9f1f36e8e9c822c909e19f9ebdd38843823c87217.png" />
</div>
</div>
<p>The dotted line shows the trend for all respondents; as we saw in the previous figure, older respondents are more likely to favor a law against interracial marriage.
But that doesn’t mean that people are more likely to adopt this view as they age.
In fact, it’s the opposite: in almost every birth cohort, people age out of racism.</p>
<p>So this is another example of Simpson’s paradox: within the groups, the trend is downward as a function of age, but overall, the trend is upward.
The reason is that, because of the design of the GSS, we observe different cohorts at different ages.
At the left side of the figure, the overall average is low because the youngest people surveyed are mostly from the most recent generations; at the right side, the overall average is high because the older people are mostly from the earliest generations.</p>
<p>You might notice that we have only one observation for people born in the 1980s and no data for people born in the 1990s.
That’s because this question was dropped from the GSS after 2002.
At that point, the percentage of people in favor of the law, and willing to say so, had dropped below 10%.
Among people born in the 1980s, it was barely 1%.</p>
<p>At that point, the GSS had several reasons to retire the question.
First, as a matter of public policy, the matter was resolved in 1967 by the U.S. Supreme Court decision in <em>Loving v. Virginia</em>; by the 1990s it was no longer part of mainstream political discussion.
Second, because the responses were so one-sided, there was little to learn by asking.
And finally, estimating small proportions from survey data is unreliable due to a phenomenon known as “lizard people”.</p>
<p>The term comes from a notorious poll conducted in 2013 by Public Policy Polling, which included questions about a variety of conspiracy theories.
One asked:</p>
<blockquote>
<div><p>Do you believe that shape-shifting reptilian people control our world by taking on human form and gaining political power to manipulate our societies, or not?</p>
</div></blockquote>
<p>Of 1247 registered voters who responded, 4% said yes.
If that is an accurate estimate of the prevalence of this belief, it implies that there are more than 12 million people in the U.S. who believe in lizard people.</p>
<p>But it is probably not an accurate estimate, because of a problem well known to survey designers.
In any group of respondents, there will be some percentage who misunderstand a question, accidentally choose a response they did not intend, or maliciously choose a response they do not believe.
And in this example, there were probably a few open-minded people who had never heard of lizard people in positions of power, but once the survey raised the possibility, they were willing to entertain it.</p>
<p>Errors like this are tolerable when the actual prevalence is high.
In that case, the number of errors is small compared to the number of legitimate positive responses.
But when the actual prevalence is low, there might be more false positive responses than true ones.
If 4% of respondents endorsed the lizard-people theory in error, the actual prevalence might be zero.</p>
<p>The point of this diversion is that it is hard to measure small percentages with survey data, which is one reason the GSS stops asking about rare beliefs.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racpres"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series_racpres</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Black presidential candidate: racist responses vs age"</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/a17169127df90450dcf82840a023993faaf0738e287e0c9034d9a2d762b50f1c.png" src="_images/a17169127df90450dcf82840a023993faaf0738e287e0c9034d9a2d762b50f1c.png" />
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racopen"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># would vote for the wrong law</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series_racopen</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Open housing law: racist responses vs age"</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/270c481f944c86091b2036caacc47c59dd454a4b47bca31f3c5b09106f977fb4.png" src="_images/270c481f944c86091b2036caacc47c59dd454a4b47bca31f3c5b09106f977fb4.png" />
</div>
</div>
<p>The responses to the other two questions follow the same pattern.</p>
<ul class="simple">
<li><p>Asked whether they would vote for a qualified Black presidential candidate nominated by their own party, older people were more likely to say no. But within every birth cohort, people were more likely to say yes as they got older.</p></li>
<li><p>Asked whether they would support an open housing law, older people were more likely to say no. But within every birth cohort, people were more likely to say yes as they got older.</p></li>
</ul>
<p>So, even if you observe that older people are more likely to hold racist beliefs, that doesn’t mean people become more racist with age.
In fact, the opposite is true: in every generation, going back to 1900, people grew less racist over time.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racopen"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># would vote for the wrong law</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">gss</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s2">"age >= 70"</span><span class="p">)[</span><span class="s2">"y"</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">(),</span> <span class="n">gss</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s2">"age <= 30"</span><span class="p">)[</span><span class="s2">"y"</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(0.5165211970074813, 0.3089821763602251)
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"racpres"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1"># would not vote for a black candidate</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">gss</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s2">"age >= 70"</span><span class="p">)[</span><span class="s2">"y"</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">(),</span> <span class="n">gss</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="s2">"age <= 30"</span><span class="p">)[</span><span class="s2">"y"</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(0.24651372019793072, 0.10303030303030303)
</pre></div>
</div>
</div>
</div>
</section>
<section id="young-feminists">
<h2>Young Feminists<a class="headerlink" href="#young-feminists" title="Permalink to this heading">#</a></h2>
<p>Similarly, older people are more likely to hold sexist beliefs, but that doesn’t mean people become more sexist as they age.
The GSS includes three questions related to sexism:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Please tell me whether you strongly agree, agree, disagree, or strongly disagree […]: It is much better for everyone involved if the man is the achiever outside the home and the woman takes care of the home and family.</p></li>
<li><p>Tell me if you agree or disagree with this statement: Most men are better suited emotionally for politics than are most women.</p></li>
<li><p>If your party nominated a woman for President, would you vote for her if she were qualified for the job?</p></li>
</ol>
</div></blockquote>
<p>The following figure shows the results as a function of the respondents’ ages.
Again, the <span class="math notranslate nohighlight">\(y\)</span> axis shows the percentage of respondents who chose what I characterize as a sexist response: that it is much better for everyone if women stay home, that men are more suited emotionally for politics, and that the respondent would not vote for a female presidential candidate.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># [1977-2021]</span>
<span class="c1"># [1974-2021]</span>
<span class="c1"># [1972-2010]</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fefam"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span> <span class="c1"># strongly agree or agree</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"f1"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_fefam</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fepol"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1"># agree</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"f2"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_fepol</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fepres"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1"># would not vote</span>
<span class="n">prepare_yvar</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">ten_questions</span><span class="p">[</span><span class="s2">"f3"</span><span class="p">]</span> <span class="o">=</span> <span class="n">gss</span><span class="p">[</span><span class="s2">"y"</span><span class="p">]</span>
<span class="n">series_fepres</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">plot_series_lowess</span><span class="p">(</span><span class="n">series_fefam</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">"-"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C1"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"At work or home"</span><span class="p">)</span>
<span class="n">plot_series_lowess</span><span class="p">(</span><span class="n">series_fepol</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">":"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C0"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"In politics"</span><span class="p">)</span>
<span class="n">plot_series_lowess</span><span class="p">(</span>
<span class="n">series_fepres</span><span class="p">,</span> <span class="n">ls</span><span class="o">=</span><span class="s2">"--"</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s2">"C2"</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s2">"Female candidate"</span>
<span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span><span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span> <span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s2">"Sexist responses vs age"</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n">loc</span><span class="o">=</span><span class="s1">'upper left'</span><span class="p">,</span> <span class="n">bbox_to_anchor</span><span class="o">=</span><span class="p">(</span><span class="mf">1.02</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">yticks</span><span class="p">([</span><span class="mi">10</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">70</span><span class="p">])</span>
<span class="n">plt</span><span class="o">.</span><span class="n">tight_layout</span><span class="p">();</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/c76abe246826c1b04495176ca66aa00e9a335124575981b763d41ed44b1bac4a.png" src="_images/c76abe246826c1b04495176ca66aa00e9a335124575981b763d41ed44b1bac4a.png" />
</div>
</div>
<p>For all three questions, older people are more likely to choose the sexist response.
The difference is most dramatic for the first question, related to women working outside the home.
The difference is smaller for the other questions, although that is in part because the third question, related to voting for a female presidential candidate, was retired after 2010 as the prevalence dropped into lizard people territory.</p>
<p>The following figure shows responses to the second question grouped by decade of birth and plotted by age.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fepol"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series_fepol</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">nudge</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"1990s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="s2">"1970s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">4</span><span class="p">,</span> <span class="s2">"1940s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="s2">"1920s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s2">"1910s"</span><span class="p">:</span> <span class="mi">1</span><span class="p">}</span>
<span class="n">label_table</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">nudge</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Suited for politics: sexist responses vs age"</span><span class="p">,</span>
<span class="n">legend</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/909dd497af4f76994f4391df665acdbb737c6a2e6bcba05ea20c24728ef331e4.png" src="_images/909dd497af4f76994f4391df665acdbb737c6a2e6bcba05ea20c24728ef331e4.png" />
</div>
</div>
<p>Overall, older people are more likely to be sexist, but within almost every cohort, people become less sexist as they get older.
The results from the other two questions show the same pattern.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fefam"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span> <span class="c1"># strongly agree or agree</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series_fefam</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Women at work or home: sexist responses vs age"</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/3822a4e2c1e19f25714a078d566febc5ca63ed30e3456fc74244e48ba46bef65.png" src="_images/3822a4e2c1e19f25714a078d566febc5ca63ed30e3456fc74244e48ba46bef65.png" />
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"age"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fepres"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1"># would not vote</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series_fepres</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Age"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Female presidential candidate: sexist responses vs age"</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/c503c759a150857cfe85880dd8854c8e74064614c24ce76a35015103810ef230.png" src="_images/c503c759a150857cfe85880dd8854c8e74064614c24ce76a35015103810ef230.png" />
</div>
</div>
<p>As in the previous examples, the reason is that the younger respondents are more likely to belong to recent birth cohorts, which are less sexist, and the older respondents are more likely to belong to earlier birth cohorts, which are more sexist.</p>
<p>This example demonstrates the difference between an “age effect” and a “cohort effect”; in general, there are three ways populations change over time:</p>
<ul class="simple">
<li><p>An “age effect” is something that affects most people at a particular age or life stage. Age effects can be biological, like the loss of deciduous teeth, or social, like the loss of youthful innocence.</p></li>
<li><p>A “period effect” is something that affects most people at a particular point in time. Period effects include notable events, like the September 11 attacks, or intervals like the Cold War.</p></li>
<li><p>A “cohort effect” is something that affects people born at a particular time, usually due to the unique environment they grew up in. When people make generalizations about the characteristics of baby boomers and millennials, for example, they are appealing to cohort effects (often without much evidence).</p></li>
</ul>
<p>It can be hard to distinguish between these effects.
In particular, when we see a cohort effect, it is easy to mistake it for an age effect.
When we see that older people hold particular beliefs, we might assume (or fear) that young people will adopt those beliefs as they age.
But age effects like that are rare.</p>
<p>Most people develop social beliefs based on the environment they are raised in, so that’s primarily a cohort effect.
If those beliefs change over their lifetimes, it is most often because of something happening in the world, which is a period effect.
But it is unusual to adopt or change a belief when you reach a particular age.
Other than registering to vote when you are 18, most political acts don’t depend on the number of candles on the cake.</p>
<p>The previous figure shows one way to distinguish cohort and age effects: grouping people by cohort and plotting their responses as a function of age.
Similarly, to distinguish cohort and period effects, we can group people by birth cohort, again, and plot their responses over time.
For example, the following figure shows responses to the first of the three questions, about whether everyone would be better off if women stayed home, plotted over time.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">xvarname</span> <span class="o">=</span> <span class="s2">"year"</span>
<span class="n">yvarname</span> <span class="o">=</span> <span class="s2">"fefam"</span>
<span class="n">gvarname</span> <span class="o">=</span> <span class="s2">"cohort10"</span>
<span class="n">yvalue</span> <span class="o">=</span> <span class="mi">2</span>
<span class="n">table</span> <span class="o">=</span> <span class="n">make_table</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">,</span> <span class="n">yvarname</span><span class="p">,</span> <span class="n">gvarname</span><span class="p">,</span> <span class="n">yvalue</span><span class="p">)</span>
<span class="k">del</span> <span class="n">table</span><span class="p">[</span><span class="mi">1900</span><span class="p">]</span>
<span class="k">del</span> <span class="n">table</span><span class="p">[</span><span class="mi">1910</span><span class="p">]</span>
<span class="n">series</span> <span class="o">=</span> <span class="n">chunk_series</span><span class="p">(</span><span class="n">gss</span><span class="p">,</span> <span class="n">xvarname</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span>
<span class="n">visualize_table</span><span class="p">(</span><span class="n">series</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">plot_series</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">palette</span><span class="o">=</span><span class="s2">"Blues"</span><span class="p">)</span>
<span class="n">nudge</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"1970s"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s2">"1980s"</span><span class="p">:</span> <span class="o">-</span><span class="mf">2.5</span><span class="p">}</span>
<span class="n">label_table_left</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">nudge</span><span class="p">)</span>
<span class="n">decorate</span><span class="p">(</span>
<span class="n">xlabel</span><span class="o">=</span><span class="s2">"Year of survey"</span><span class="p">,</span>
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"Percent"</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">"Sexist responses vs year of survey"</span><span class="p">,</span>
<span class="n">xlim</span><span class="o">=</span><span class="p">[</span><span class="mi">1972</span><span class="p">,</span> <span class="mi">2021</span><span class="p">],</span>
<span class="n">legend</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/0bddd6a04e3b45fd6dbe1d52b7b56889beb646250911eb4ac93c62e68706dbb0.png" src="_images/0bddd6a04e3b45fd6dbe1d52b7b56889beb646250911eb4ac93c62e68706dbb0.png" />
</div>
</div>
<p>In this figure, there is evidence of a cohort effect: comparing people born in the 1920s through the 1950s, each cohort is less likely to choose a sexist response than the previous one.</p>
<p>There is also some evidence for a weak period effect.
Among the cohorts born in the 1950s through the 1990s, the percentage of sexist responses declined in parallel between 2010 and 2020, which suggests that there was something happening during this time that caused people in these groups to change their minds.</p>
<p>In the next section, we will see evidence for a stronger period effect in attitudes about homosexuality.</p>
</section>
<section id="the-remarkable-decline-of-homophobia">
<h2>The Remarkable Decline of Homophobia<a class="headerlink" href="#the-remarkable-decline-of-homophobia" title="Permalink to this heading">#</a></h2>
<p>The GSS includes four questions related to sexual orientation.</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>What about sexual relations between two adults of the same sex – do you think it is always wrong, almost always wrong, wrong only sometimes, or not wrong at all?</p></li>
<li><p>And what about a man who admits that he is a homosexual? Should such a person be allowed to teach in a college or university, or not?</p></li>
<li><p>If some people in your community suggested that a book he wrote in favor of homosexuality should be taken out of your public library, would you favor removing this book, or not?</p></li>
<li><p>Suppose this admitted homosexual wanted to make a speech in your community. Should he be allowed to speak, or not?</p></li>
</ol>
</div></blockquote>
<p>If the wording of these questions seems dated, remember that they were written around 1970, when one might “admit” to homosexuality, and a large majority thought it was wrong, wrong, or wrong.
In general, the GSS avoids changing the wording of questions, because subtle word choices can influence the results.