-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.html
More file actions
1181 lines (1150 loc) · 53 KB
/
Copy pathreport.html
File metadata and controls
1181 lines (1150 loc) · 53 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.9.37">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Giovanni Mannucci">
<title>CCA CompEcon Replication Project</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
*/
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 */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; 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 { 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="report_files/libs/clipboard/clipboard.min.js"></script>
<script src="report_files/libs/quarto-html/quarto.js" type="module"></script>
<script src="report_files/libs/quarto-html/tabsets/tabsets.js" type="module"></script>
<script src="report_files/libs/quarto-html/popper.min.js"></script>
<script src="report_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="report_files/libs/quarto-html/anchor.min.js"></script>
<link href="report_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="report_files/libs/quarto-html/quarto-syntax-highlighting-7f8f88aac4f3542376d5c11b86a4c14d.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="report_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="report_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="report_files/libs/bootstrap/bootstrap-138a6193a3bd40baf1e627da441a4734.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script defer="" 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" && texText && texText.data) {
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="quarto-light">
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#paper-and-replication-package" id="toc-paper-and-replication-package" class="nav-link active" data-scroll-target="#paper-and-replication-package"><span class="header-section-number">0.1</span> Paper and Replication Package</a></li>
<li><a href="#high-level-description-of-computational-problem" id="toc-high-level-description-of-computational-problem" class="nav-link" data-scroll-target="#high-level-description-of-computational-problem"><span class="header-section-number">0.2</span> High Level Description of Computational Problem</a></li>
<li><a href="#computational-requirements" id="toc-computational-requirements" class="nav-link" data-scroll-target="#computational-requirements"><span class="header-section-number">0.3</span> Computational Requirements</a></li>
<li><a href="#computational-setup" id="toc-computational-setup" class="nav-link" data-scroll-target="#computational-setup"><span class="header-section-number">0.4</span> Computational Setup</a></li>
<li><a href="#replication-results" id="toc-replication-results" class="nav-link" data-scroll-target="#replication-results"><span class="header-section-number">1</span> Replication Results</a>
<ul class="collapse">
<li><a href="#figure-2" id="toc-figure-2" class="nav-link" data-scroll-target="#figure-2"><span class="header-section-number">1.1</span> Figure 2</a></li>
<li><a href="#table-5" id="toc-table-5" class="nav-link" data-scroll-target="#table-5"><span class="header-section-number">1.2</span> Table 5</a></li>
<li><a href="#counterfactual-5.3.2" id="toc-counterfactual-5.3.2" class="nav-link" data-scroll-target="#counterfactual-5.3.2"><span class="header-section-number">1.3</span> Counterfactual 5.3.2</a></li>
<li><a href="#tables-1-and-2" id="toc-tables-1-and-2" class="nav-link" data-scroll-target="#tables-1-and-2"><span class="header-section-number">1.4</span> Tables 1 and 2</a>
<ul class="collapse">
<li><a href="#table-1-work-hours" id="toc-table-1-work-hours" class="nav-link" data-scroll-target="#table-1-work-hours"><span class="header-section-number">1.4.1</span> Table 1: Work Hours</a></li>
<li><a href="#table-2-household-care-hours" id="toc-table-2-household-care-hours" class="nav-link" data-scroll-target="#table-2-household-care-hours"><span class="header-section-number">1.4.2</span> Table 2: Household Care Hours</a></li>
</ul></li>
<li><a href="#table-6" id="toc-table-6" class="nav-link" data-scroll-target="#table-6"><span class="header-section-number">1.5</span> Table 6</a></li>
</ul></li>
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion"><span class="header-section-number">2</span> Conclusion</a></li>
</ul>
</nav>
</div>
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">CCA <code>CompEcon</code> Replication Project</h1>
<p class="subtitle lead">Replication of Coordinated Work Schedules and the Gender Wage Gap, by G. Cubas, C. Juhn and P. Silos (EJ, 2023)</p>
</div>
<div class="quarto-title-meta-author">
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-heading">Affiliation</div>
<div class="quarto-title-meta-contents">
<p class="author">Giovanni Mannucci <a href="mailto:giovanni.mannucci@carloalberto.org" class="quarto-title-author-email"><i class="bi bi-envelope"></i></a> <a href="https://orcid.org/0009-0000-0087-2843" class="quarto-title-author-orcid"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo1N0NEMjA4MDI1MjA2ODExOTk0QzkzNTEzRjZEQTg1NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozM0NDOEJGNEZGNTcxMUUxODdBOEVCODg2RjdCQ0QwOSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozM0NDOEJGM0ZGNTcxMUUxODdBOEVCODg2RjdCQ0QwOSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZDN0YxMTc0MDcyMDY4MTE5NUZFRDc5MUM2MUUwNEREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU3Q0QyMDgwMjUyMDY4MTE5OTRDOTM1MTNGNkRBODU3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+84NovQAAAR1JREFUeNpiZEADy85ZJgCpeCB2QJM6AMQLo4yOL0AWZETSqACk1gOxAQN+cAGIA4EGPQBxmJA0nwdpjjQ8xqArmczw5tMHXAaALDgP1QMxAGqzAAPxQACqh4ER6uf5MBlkm0X4EGayMfMw/Pr7Bd2gRBZogMFBrv01hisv5jLsv9nLAPIOMnjy8RDDyYctyAbFM2EJbRQw+aAWw/LzVgx7b+cwCHKqMhjJFCBLOzAR6+lXX84xnHjYyqAo5IUizkRCwIENQQckGSDGY4TVgAPEaraQr2a4/24bSuoExcJCfAEJihXkWDj3ZAKy9EJGaEo8T0QSxkjSwORsCAuDQCD+QILmD1A9kECEZgxDaEZhICIzGcIyEyOl2RkgwAAhkmC+eAm0TAAAAABJRU5ErkJggg=="></a></p>
</div>
<div class="quarto-title-meta-contents">
<p class="affiliation">
Uni Turin, Collegio Carlo Alberto
</p>
</div>
</div>
<div class="quarto-title-meta">
</div>
</header>
<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">
<span class="screen-reader-only">Note</span>Collegio Carlo Alberto Replication Project
</div>
</div>
<div class="callout-body-container callout-body">
<p>This report was created as part of the assessment for the <a href="https://floswald.github.io/CompEcon/"><code>Computational Economics</code> Course</a> in the PhD program at Collegio Carlo Alberto taught by <a href="https://floswald.github.io/">Florian Oswald</a>.</p>
</div>
</div>
<section id="paper-and-replication-package" class="level2" data-number="0.1">
<h2 data-number="0.1" class="anchored" data-anchor-id="paper-and-replication-package"><span class="header-section-number">0.1</span> Paper and Replication Package</h2>
<p>This report attempts a partial replication of Cubas, Juhn and Silos, “Coordinated Work Schedules and the Gender Wage Gap”, using the <code>julia</code> computation language.</p>
<ul>
<li>Paper: <a href="https://doi.org/10.1093/ej/ueac086" class="uri">https://doi.org/10.1093/ej/ueac086</a></li>
<li>Replication package: <a href="https://doi.org/10.5281/zenodo.7336171" class="uri">https://doi.org/10.5281/zenodo.7336171</a></li>
<li>Original software in the package: Stata and R</li>
<li>Replication software used here: Julia</li>
</ul>
<p>The replication targets are:</p>
<ol type="1">
<li>Table 1, Table 2 and Figure 2, the main descriptive exhibits.</li>
<li>Table 6, the main empirical wage-regression table.</li>
<li>Table 5, the simple model results.</li>
<li>Counterfactual 5.3.2, the quantitative-model counterfactual in which occupational coordination is set to the healthcare-support value.</li>
</ol>
<p>At the current stage, Figure 2, Tables 1 and 2, Table 6, Table 5 and the quantitative counterfactual are implemented and run in Julia. Tables 1 and 2 use the generated Stata checkpoint <code>5_data_#5.dta</code>, with the final regression and summary-statistic calculations performed in Julia. Table 6 uses the generated CPS/O*NET occupation checkpoint files, with the final weighted regressions and clustered standard errors computed in Julia.</p>
</section>
<section id="high-level-description-of-computational-problem" class="level2" data-number="0.2">
<h2 data-number="0.2" class="anchored" data-anchor-id="high-level-description-of-computational-problem"><span class="header-section-number">0.2</span> High Level Description of Computational Problem</h2>
<p>The paper studies how coordinated work schedules affect the gender wage gap. The empirical part constructs time-use measures of work concentration during regular hours, especially an occupation-level <code>8-to-5</code> ratio, and relates those measures to gender gaps in work, household care, and wages. The main empirical tasks are therefore data construction from ATUS/CPS/ACS/O*NET sources and weighted regressions with demographic controls and occupation-level coordination measures.</p>
<p>The model part solves workers’ time-allocation decisions across prime and non-prime hours. Workers choose labor in two time blocks, <span class="math inline">\(l_1\)</span> and <span class="math inline">\(l_2\)</span>, while household care uses the remaining time. Effective labor in an occupation depends on total labor and a coordination penalty:</p>
<p><span class="math display">\[
\ell^* = l_1 + l_2 - (0.5 - l_1)^\alpha .
\]</span></p>
<p>The worker utility problem has the form</p>
<p><span class="math display">\[
U = c^\theta h^{1-\theta},
\qquad
h = \left(h_1^\xi + h_2^\xi\right)^{1/\xi},
\]</span></p>
<p>where <span class="math inline">\(c = w \ell^*\)</span>, <span class="math inline">\(h_1 = 0.5 - l_1\)</span>, and <span class="math inline">\(h_2 = 0.5 - l_2\)</span>. The Julia code solves these nonlinear choice problems using numerical optimization, then iterates on wages until the general-equilibrium labor-market clearing conditions are satisfied.</p>
<p>The simple model behind Table 5 is a two-occupation version of this problem. The quantitative counterfactual uses the estimated parameters from <code>ces_param</code>, solves the baseline equilibrium, then sets every occupation’s coordination parameter <span class="math inline">\(\alpha\)</span> equal to the healthcare-support occupation’s value.</p>
</section>
<section id="computational-requirements" class="level2" data-number="0.3">
<h2 data-number="0.3" class="anchored" data-anchor-id="computational-requirements"><span class="header-section-number">0.3</span> Computational Requirements</h2>
<p>The original replication package does not provide a single complete machine-readable requirements file. Inspection of the package shows that the original empirical exhibits rely on Stata scripts and the model results rely on R scripts.</p>
<p>For this Julia replication, the main package dependencies are:</p>
<ul>
<li><code>DataFrames.jl</code> and <code>CSV.jl</code> for data handling.</li>
<li><code>XLSX.jl</code> for the Figure 2 checkpoint file.</li>
<li><code>Optim.jl</code> and <code>NLsolve.jl</code> for nonlinear optimization and equation solving.</li>
<li><code>Plots.jl</code> for Figure 2.</li>
<li><code>StatFiles.jl</code> for the planned <code>.dta</code> checkpoint route.</li>
</ul>
<p>The generated Julia package exposes one main entry point:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Pkg</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="bu">Pkg</span>.<span class="fu">activate</span>(<span class="st">"CubasJuhnSilos"</span>)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">CubasJuhnSilos</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a>CubasJuhnSilos.<span class="fu">run_all</span>()</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p>Unit tests can be run with:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">julia</span> <span class="at">--project</span><span class="op">=</span>CubasJuhnSilos <span class="at">-e</span> <span class="st">'using Pkg; Pkg.test()'</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
</section>
<section id="computational-setup" class="level2" data-number="0.4">
<h2 data-number="0.4" class="anchored" data-anchor-id="computational-setup"><span class="header-section-number">0.4</span> Computational Setup</h2>
<p>The replication was run locally with the following setup:</p>
<ul>
<li>Operating system: macOS 26.4.1.</li>
<li>CPU: Apple M1.</li>
<li>Cores: 8.</li>
<li>Memory: 8 GB.</li>
<li>Julia: 1.12.4.</li>
<li>Quarto: 1.9.37.</li>
</ul>
<p>The code and outputs are organized as follows:</p>
<ul>
<li>Julia package: <code>CubasJuhnSilos/</code>.</li>
<li>Original replication files: <code>replication-package/</code>.</li>
<li>Generated tables: <code>output/tables/</code>.</li>
<li>Generated figures: <code>output/figures/</code>.</li>
<li>Notes on missing inputs: <code>output/logs/</code>.</li>
</ul>
</section>
<section id="replication-results" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Replication Results</h1>
<section id="figure-2" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="figure-2"><span class="header-section-number">1.1</span> Figure 2</h2>
<p>Figure 2 is replicated using the Stata-exported data checkpoint <code>fig2_3.xlsx</code>. This file contains the average minutes worked in each hour bin by gender and family status. The Julia code reads the spreadsheet and plots the two panels.</p>
<div id="fig-figure2" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-figure2-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="images/figure2_replicated.png" class="img-fluid figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-figure2-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure 1: Replicated Figure 2: work by hour of day, gender and family status.
</figcaption>
</figure>
</div>
<p>The replicated figure displays the same substantive pattern as the original: full-time workers concentrate work during regular daytime hours, with a larger male-female difference among married workers with children than among single workers without children.</p>
</section>
<section id="table-5" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="table-5"><span class="header-section-number">1.2</span> Table 5</h2>
<p>Table 5 is replicated by porting the simple two-occupation model from R to Julia. The table below reports the main outputs produced by the Julia implementation.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Panel A: No Gender Differences</th>
<th style="text-align: right;">Occupation 1</th>
<th style="text-align: right;">Occupation 2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Share of Workers</td>
<td style="text-align: right;">0.479</td>
<td style="text-align: right;">0.521</td>
</tr>
<tr class="even">
<td>Ratio 8to5</td>
<td style="text-align: right;">0.595</td>
<td style="text-align: right;">0.506</td>
</tr>
<tr class="odd">
<td>Earnings</td>
<td style="text-align: right;">0.416</td>
<td style="text-align: right;">0.383</td>
</tr>
<tr class="even">
<td>Raw labor by occupation</td>
<td style="text-align: right;">0.823</td>
<td style="text-align: right;">0.803</td>
</tr>
<tr class="odd">
<td>Effective labor by occupation</td>
<td style="text-align: right;">0.796</td>
<td style="text-align: right;">0.802</td>
</tr>
</tbody>
</table>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Panel B: Gender-Specific <span class="math inline">\(\nu\)</span></th>
<th style="text-align: right;">Occupation 1</th>
<th style="text-align: right;">Occupation 2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Gender Gap</td>
<td style="text-align: right;">1.031</td>
<td style="text-align: right;">1.031</td>
</tr>
<tr class="even">
<td>Gender Gap, Occupation 2</td>
<td style="text-align: right;">1.005</td>
<td style="text-align: right;">1.005</td>
</tr>
<tr class="odd">
<td>Share of Workers</td>
<td style="text-align: right;">0.437</td>
<td style="text-align: right;">0.563</td>
</tr>
<tr class="even">
<td>Ratio 8to5</td>
<td style="text-align: right;">0.545</td>
<td style="text-align: right;">0.516</td>
</tr>
<tr class="odd">
<td>Earnings</td>
<td style="text-align: right;">0.459</td>
<td style="text-align: right;">0.356</td>
</tr>
<tr class="even">
<td>Raw labor by occupation</td>
<td style="text-align: right;">0.910</td>
<td style="text-align: right;">0.730</td>
</tr>
<tr class="odd">
<td>Effective labor by occupation</td>
<td style="text-align: right;">0.898</td>
<td style="text-align: right;">0.726</td>
</tr>
<tr class="even">
<td>Share female</td>
<td style="text-align: right;">0.000</td>
<td style="text-align: right;">0.888</td>
</tr>
</tbody>
</table>
<table class="caption-top table">
<colgroup>
<col style="width: 27%">
<col style="width: 36%">
<col style="width: 36%">
</colgroup>
<thead>
<tr class="header">
<th>Panel C: Gender-Specific <span class="math inline">\(\nu\)</span> and Tastes</th>
<th style="text-align: right;">Occupation 1</th>
<th style="text-align: right;">Occupation 2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Aggregate Gender Gap</td>
<td style="text-align: right;">1.026</td>
<td style="text-align: right;">1.026</td>
</tr>
<tr class="even">
<td>Gender Gap by Occupation</td>
<td style="text-align: right;">1.047</td>
<td style="text-align: right;">1.005</td>
</tr>
<tr class="odd">
<td>Ratio 8to5</td>
<td style="text-align: right;">0.599</td>
<td style="text-align: right;">0.510</td>
</tr>
<tr class="even">
<td>Share Female</td>
<td style="text-align: right;">0.500</td>
<td style="text-align: right;">0.500</td>
</tr>
<tr class="odd">
<td>Percent Workers</td>
<td style="text-align: right;">0.497</td>
<td style="text-align: right;">0.503</td>
</tr>
<tr class="even">
<td>Earnings</td>
<td style="text-align: right;">0.405</td>
<td style="text-align: right;">0.396</td>
</tr>
<tr class="odd">
<td>Raw Labor</td>
<td style="text-align: right;">0.814</td>
<td style="text-align: right;">0.814</td>
</tr>
<tr class="even">
<td>Effective Labor</td>
<td style="text-align: right;">0.796</td>
<td style="text-align: right;">0.802</td>
</tr>
</tbody>
</table>
<p>The corresponding output files are:</p>
<ul>
<li><code>output/tables/table5_panel_a_no_gender.csv</code></li>
<li><code>output/tables/table5_panel_b_gender_diff_nu.csv</code></li>
<li><code>output/tables/table5_panel_c_tastes.csv</code></li>
<li><code>output/tables/table5_replicated.tex</code></li>
</ul>
</section>
<section id="counterfactual-5.3.2" class="level2" data-number="1.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="counterfactual-5.3.2"><span class="header-section-number">1.3</span> Counterfactual 5.3.2</h2>
<p>The quantitative counterfactual is implemented in Julia by solving the baseline model and then setting all occupation-specific coordination parameters <span class="math inline">\(\alpha\)</span> equal to the healthcare-support occupation’s value. This corresponds to <code>experiment == 1</code> in the original R script <code>main_ge.R</code>.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 15%">
<col style="width: 21%">
<col style="width: 21%">
<col style="width: 21%">
<col style="width: 21%">
</colgroup>
<thead>
<tr class="header">
<th>Scenario</th>
<th style="text-align: right;">Aggregate gender gap (%)</th>
<th style="text-align: right;">Total log gap</th>
<th style="text-align: right;">Across log component</th>
<th style="text-align: right;">Within log component</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Baseline</td>
<td style="text-align: right;">9.626</td>
<td style="text-align: right;">0.092</td>
<td style="text-align: right;">0.019</td>
<td style="text-align: right;">0.073</td>
</tr>
<tr class="even">
<td>Same <span class="math inline">\(\alpha\)</span> as healthcare support</td>
<td style="text-align: right;">6.464</td>
<td style="text-align: right;">0.063</td>
<td style="text-align: right;">0.042</td>
<td style="text-align: right;">0.020</td>
</tr>
</tbody>
</table>
<p>The counterfactual substantially lowers the within-occupation component of the gender wage gap in the model, from 0.073 log points to 0.020 log points. This is consistent with the mechanism emphasized in the paper: coordination requirements amplify within-occupation gender wage differences.</p>
<p>The corresponding output files are:</p>
<ul>
<li><code>output/tables/counterfactual_5_3_2_summary.csv</code></li>
<li><code>output/tables/counterfactual_5_3_2_baseline_regression.csv</code></li>
<li><code>output/tables/counterfactual_5_3_2_counter_regression.csv</code></li>
</ul>
<p>One caveat is important. The downloaded package does not include the original <code>Quantitative_Analysis/data/*.txt</code> calibration moment files used by the R script. The Julia implementation therefore uses the estimated parameters in <code>model_files/ces_param</code> and parses the labor shares from <code>latex_tables/table8.tex</code>. This is sufficient to solve the baseline and counterfactual equilibria, but it does not recompute the full original model-fit statistic.</p>
</section>
<section id="tables-1-and-2" class="level2" data-number="1.4">
<h2 data-number="1.4" class="anchored" data-anchor-id="tables-1-and-2"><span class="header-section-number">1.4</span> Tables 1 and 2</h2>
<p>Tables 1 and 2 are replicated using the generated Stata checkpoint <code>5_data_#5.dta</code>. The Julia code follows the final Stata table script: it drops nonrespondents, restricts the sample to full-time married workers with children between ages 18 and 65, aggregates time-use bins to the respondent-day level, and estimates weighted least-squares regressions with ATUS final weights.</p>
<p>For speed, the Julia workflow first creates and uses a slim checkpoint, <code>5_data_#5_table12.dta</code>, containing only the variables needed for these two tables. This does not change the sample or calculations; it only avoids repeatedly loading hundreds of unused variables from the full two-gigabyte checkpoint file.</p>
<section id="table-1-work-hours" class="level3" data-number="1.4.1">
<h3 data-number="1.4.1" class="anchored" data-anchor-id="table-1-work-hours"><span class="header-section-number">1.4.1</span> Table 1: Work Hours</h3>
<p>The coefficient reported is the female coefficient in regressions of total work hours. Negative values mean women report fewer work hours than comparable men in the selected sample.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: right;">Model</th>
<th style="text-align: right;">Estimate</th>
<th style="text-align: right;">Standard error</th>
<th style="text-align: right;">Observations</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">1</td>
<td style="text-align: right;">-0.898</td>
<td style="text-align: right;">0.069</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">2</td>
<td style="text-align: right;">-0.749</td>
<td style="text-align: right;">0.067</td>
<td style="text-align: right;">12,344</td>
</tr>
<tr class="odd">
<td style="text-align: right;">3</td>
<td style="text-align: right;">-0.901</td>
<td style="text-align: right;">0.069</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">4</td>
<td style="text-align: right;">-0.911</td>
<td style="text-align: right;">0.070</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: right;">-0.703</td>
<td style="text-align: right;">0.070</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">6</td>
<td style="text-align: right;">-0.490</td>
<td style="text-align: right;">0.077</td>
<td style="text-align: right;">8,393</td>
</tr>
</tbody>
</table>
</section>
<section id="table-2-household-care-hours" class="level3" data-number="1.4.2">
<h3 data-number="1.4.2" class="anchored" data-anchor-id="table-2-household-care-hours"><span class="header-section-number">1.4.2</span> Table 2: Household Care Hours</h3>
<p>The coefficient reported is the female coefficient in regressions of total household-care hours. Positive values mean women report more household-care hours than comparable men in the selected sample.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: right;">Model</th>
<th style="text-align: right;">Estimate</th>
<th style="text-align: right;">Standard error</th>
<th style="text-align: right;">Observations</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.436</td>
<td style="text-align: right;">0.028</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">2</td>
<td style="text-align: right;">0.264</td>
<td style="text-align: right;">0.033</td>
<td style="text-align: right;">12,344</td>
</tr>
<tr class="odd">
<td style="text-align: right;">3</td>
<td style="text-align: right;">0.436</td>
<td style="text-align: right;">0.028</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">4</td>
<td style="text-align: right;">0.349</td>
<td style="text-align: right;">0.027</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: right;">0.319</td>
<td style="text-align: right;">0.027</td>
<td style="text-align: right;">12,113</td>
</tr>
<tr class="even">
<td style="text-align: right;">6</td>
<td style="text-align: right;">0.266</td>
<td style="text-align: right;">0.033</td>
<td style="text-align: right;">8,393</td>
</tr>
</tbody>
</table>
<p>The corresponding weighted means are:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Statistic</th>
<th style="text-align: right;">Weighted mean</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Weekday male work</td>
<td style="text-align: right;">7.904</td>
</tr>
<tr class="even">
<td>Weekday female work</td>
<td style="text-align: right;">7.006</td>
</tr>
<tr class="odd">
<td>Weekend male work</td>
<td style="text-align: right;">2.163</td>
</tr>
<tr class="even">
<td>Weekend female work</td>
<td style="text-align: right;">1.414</td>
</tr>
<tr class="odd">
<td>Weekday male household care</td>
<td style="text-align: right;">0.821</td>
</tr>
<tr class="even">
<td>Weekday female household care</td>
<td style="text-align: right;">1.257</td>
</tr>
<tr class="odd">
<td>Weekend male household care</td>
<td style="text-align: right;">1.002</td>
</tr>
<tr class="even">
<td>Weekend female household care</td>
<td style="text-align: right;">1.267</td>
</tr>
</tbody>
</table>
<p>The corresponding output files are:</p>
<ul>
<li><code>output/tables/table1_from_dta.csv</code></li>
<li><code>output/tables/table2_from_dta.csv</code></li>
<li><code>output/tables/tables1_2_weighted_means_from_dta.csv</code></li>
</ul>
</section>
</section>
<section id="table-6" class="level2" data-number="1.5">
<h2 data-number="1.5" class="anchored" data-anchor-id="table-6"><span class="header-section-number">1.5</span> Table 6</h2>
<p>Table 6 is replicated using the generated Stata checkpoint files <code>6_b_reg.dta</code>, <code>ONET_563b.dta</code>, and <code>bratio_563all.dta</code>. The Julia code merges the CPS regression data with O*NET measures and the occupation-level <code>8-to-5</code> ratio, then estimates weighted log-weekly-earnings regressions with education, race, year, age-polynomial and log-hours controls. Standard errors are clustered by detailed occupation.</p>
<p>For speed, the Julia workflow uses a slim checkpoint, <code>6_b_reg_table6.dta</code>, containing only the variables required for the final Table 6 regressions.</p>
<p>The key coefficient is <code>femaleXbratio_563</code>, the interaction between the female indicator and the occupation-level <code>8-to-5</code> work ratio.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 13%">
<col style="width: 17%">
<col style="width: 17%">
<col style="width: 17%">
<col style="width: 17%">
<col style="width: 17%">
</colgroup>
<thead>
<tr class="header">
<th>Sample</th>
<th style="text-align: right;">Model</th>
<th style="text-align: right;">Female</th>
<th style="text-align: right;">Female x ratio8to5</th>
<th style="text-align: right;">Ratio8to5</th>
<th style="text-align: right;">Observations</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>All</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">-0.218</td>
<td style="text-align: right;">-0.049</td>
<td style="text-align: right;">0.113</td>
<td style="text-align: right;">263,245</td>
</tr>
<tr class="even">
<td>All</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">-0.254</td>
<td style="text-align: right;">-0.046</td>
<td style="text-align: right;">0.064</td>
<td style="text-align: right;">263,245</td>
</tr>
<tr class="odd">
<td>All</td>
<td style="text-align: right;">3</td>
<td style="text-align: right;">-0.244</td>
<td style="text-align: right;">-0.044</td>
<td style="text-align: right;">0.063</td>
<td style="text-align: right;">263,179</td>
</tr>
<tr class="even">
<td>All</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;">-0.212</td>
<td style="text-align: right;">-0.028</td>
<td style="text-align: right;">0.069</td>
<td style="text-align: right;">256,672</td>
</tr>
<tr class="odd">
<td>Single, no children</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">-0.135</td>
<td style="text-align: right;">-0.022</td>
<td style="text-align: right;">0.102</td>
<td style="text-align: right;">73,536</td>
</tr>
<tr class="even">
<td>Single, no children</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">-0.169</td>
<td style="text-align: right;">-0.025</td>
<td style="text-align: right;">0.062</td>
<td style="text-align: right;">73,536</td>
</tr>
<tr class="odd">
<td>Single, no children</td>
<td style="text-align: right;">3</td>
<td style="text-align: right;">-0.165</td>
<td style="text-align: right;">-0.024</td>
<td style="text-align: right;">0.061</td>
<td style="text-align: right;">73,516</td>
</tr>
<tr class="even">
<td>Single, no children</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;">-0.132</td>
<td style="text-align: right;">-0.010</td>
<td style="text-align: right;">0.062</td>
<td style="text-align: right;">71,577</td>
</tr>
<tr class="odd">
<td>Married with children</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">-0.263</td>
<td style="text-align: right;">-0.063</td>
<td style="text-align: right;">0.109</td>
<td style="text-align: right;">110,230</td>
</tr>
<tr class="even">
<td>Married with children</td>
<td style="text-align: right;">2</td>
<td style="text-align: right;">-0.298</td>
<td style="text-align: right;">-0.060</td>
<td style="text-align: right;">0.065</td>
<td style="text-align: right;">110,230</td>
</tr>
<tr class="odd">
<td>Married with children</td>
<td style="text-align: right;">3</td>
<td style="text-align: right;">-0.286</td>
<td style="text-align: right;">-0.058</td>
<td style="text-align: right;">0.065</td>
<td style="text-align: right;">110,206</td>
</tr>
<tr class="even">
<td>Married with children</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;">-0.255</td>
<td style="text-align: right;">-0.040</td>
<td style="text-align: right;">0.072</td>
<td style="text-align: right;">107,626</td>
</tr>
</tbody>
</table>
<p>The corresponding output file is:</p>
<ul>
<li><code>output/tables/table6_from_dta.csv</code></li>
</ul>
<p>The commands for the empirical checkpoint route are:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>CubasJuhnSilos.<span class="fu">run_table1_table2</span>(source <span class="op">=</span> <span class="op">:</span>dta)</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>CubasJuhnSilos.<span class="fu">run_table6</span>(source <span class="op">=</span> <span class="op">:</span>dta)</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p>A raw-data port is also scaffolded:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>CubasJuhnSilos.<span class="fu">run_table1_table2</span>(source <span class="op">=</span> <span class="op">:</span>raw)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>CubasJuhnSilos.<span class="fu">run_table6</span>(source <span class="op">=</span> <span class="op">:</span>raw)</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p>The raw route still requires translating the full Stata data-construction chain. The checkpoint route is complete once the Stata intermediate files have been generated.</p>
</section>
</section>
<section id="conclusion" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Conclusion</h1>
<p>This replication currently reproduces Figure 2, Tables 1 and 2, Table 6, the model-based Table 5, and the quantitative counterfactual in Julia. The remaining limitation is that the empirical tables rely on Stata-generated checkpoint datasets rather than a full Julia port of the raw ATUS/CPS/O*NET data-construction pipeline.</p>
</section>
</main>
<!-- /main column -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const outerScaffold = trigger.parentElement.cloneNode(true);
const codeEl = outerScaffold.querySelector('code');
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// undo the damage that might have been done by quarto-nav.js in the case of
// links that we want to consider external
if (link.dataset.originalHref !== undefined) {
link.href = link.dataset.originalHref;
}
}
}
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start',
};
if (contentFn) {
config.content = contentFn;
}
if (onTriggerFn) {
config.onTrigger = onTriggerFn;
}
if (onUntriggerFn) {
config.onUntrigger = onUntriggerFn;
}
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note) {
return note.innerHTML;
} else {
return "";
}
});
}
const xrefs = window.document.querySelectorAll('a.quarto-xref');
const processXRef = (id, note) => {
// Strip column container classes
const stripColumnClz = (el) => {
el.classList.remove("page-full", "page-columns");
if (el.children) {
for (const child of el.children) {
stripColumnClz(child);
}
}
}
stripColumnClz(note)
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
// Remove any anchor links if they are present
const anchorLink = note.querySelector('a.anchorjs-link');
if (anchorLink) {
anchorLink.remove();
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
if (note.classList.contains("callout")) {
return note.outerHTML;
} else {
return note.innerHTML;
}
}
}
for (var i=0; i<xrefs.length; i++) {
const xref = xrefs[i];
tippyHover(xref, undefined, function(instance) {
instance.disable();
let url = xref.getAttribute('href');
let hash = undefined;
if (url.startsWith('#')) {
hash = url;
} else {
try { hash = new URL(url).hash; } catch {}
}
if (hash) {
const id = hash.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note !== null) {
try {
const html = processXRef(id, note.cloneNode(true));
instance.setContent(html);
} finally {
instance.enable();
instance.show();
}
} else {
// See if we can fetch this
fetch(url.split('#')[0])
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.getElementById(id);
if (note !== null) {
const html = processXRef(id, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
} else {
// See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)