-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1816 lines (1743 loc) · 103 KB
/
Copy pathindex.html
File metadata and controls
1816 lines (1743 loc) · 103 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 lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="theme-color" content="#0b1220" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="#f5f7fb" media="(prefers-color-scheme: light)">
<meta name="color-scheme" content="dark light">
<title>Titanic Survival Analysis — Interactive EDA Dashboard</title>
<meta name="description" content="Interactive exploratory data analysis of the Titanic dataset (1,309 passengers): survival rates by sex, class, age, fare, and embarkation, with 95% Wilson confidence intervals, odds ratios, chi-square tests, and effect sizes.">
<meta name="keywords" content="Titanic, Titanic dataset, Titanic survival, exploratory data analysis, EDA, data analysis, data science, statistics, odds ratio, chi-square, Wilson confidence interval, Cramer's V, Cohen's d, Kaggle, machine learning, Python, pandas, dashboard">
<meta name="author" content="Aneek Hait">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://aneekhait.github.io/titanic-data-analysis/">
<meta property="og:type" content="website">
<meta property="og:title" content="Titanic Survival Analysis — Interactive EDA Dashboard">
<meta property="og:description" content="Quantitative analysis of who survived the Titanic and why. 1,309 passengers, 14 features, 95% CIs, odds ratios, effect sizes, dark + light themes.">
<meta property="og:url" content="https://aneekhait.github.io/titanic-data-analysis/">
<meta property="og:site_name" content="Titanic Survival Analysis">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Titanic Survival Analysis — Interactive EDA Dashboard">
<meta name="twitter:description" content="Who survived the Titanic and why — quantified with 95% CIs, odds ratios, and effect sizes.">
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"Dataset","name":"Titanic Survival Analysis","description":"Exploratory data analysis of the titanic5 dataset (1,309 passengers, 14 features) with statistical inference: 95% Wilson confidence intervals, odds ratios, chi-square tests, Cohen's d, and Cramer's V.","keywords":["Titanic","survival analysis","exploratory data analysis","Kaggle","statistics"],"creator":{"@type":"Person","name":"Aneek Hait","url":"https://aneekhait.github.io"},"license":"https://opensource.org/licenses/MIT","url":"https://github.com/AneekHait/titanic-data-analysis"}
</script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<script src="https://unpkg.com/chartjs-plugin-datalabels@2.2.0/dist/chartjs-plugin-datalabels.min.js"></script>
<style>
:root {
--bg-primary: #0b1220; --bg-secondary: #111a2e; --bg-card: #131d33; --bg-hover: #1c2840;
--bg-elev: #0f172a; --border: #1f2c47; --border-strong: #2a3a5e;
--text-primary: #e6edf7; --text-secondary: #94a3b8; --text-muted: #64748b;
--accent: #60a5fa; --accent-strong: #3b82f6; --accent-purple: #a78bfa;
--green: #34d399; --green-strong: #10b981; --red: #f87171; --red-strong: #ef4444;
--yellow: #fbbf24; --pink: #f472b6;
--sidebar-width: 260px;
--shadow-card: 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.25);
}
.light-theme {
--bg-primary: #f5f7fb; --bg-secondary: #ffffff; --bg-card: #ffffff; --bg-hover: #eef2f7;
--bg-elev: #f3f4f8; --border: #e4e9f0; --border-strong: #cbd5e1;
--text-primary: #0f172a; --text-secondary: #334155; --text-muted: #64748b;
--accent: #2563eb; --accent-strong: #1d4ed8; --accent-purple: #7c3aed;
--green: #059669; --green-strong: #047857;
--red: #dc2626; --red-strong: #b91c1c;
--yellow: #b45309; --pink: #be185d;
--shadow-card: 0 1px 2px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.08);
}
/* Tags need more contrast on white backgrounds */
.light-theme .tag-green { background: rgba(5, 150, 105, 0.12); color: #047857; }
.light-theme .tag-red { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.light-theme .tag-blue { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.light-theme .tag-yellow { background: rgba(180, 83, 9, 0.14); color: #92400e; }
.light-theme .tag-purple { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.light-theme code { background: var(--bg-elev); color: var(--accent-strong); border: 1px solid var(--border); }
.light-theme .takeaway { background: rgba(37, 99, 235, 0.08); }
.light-theme .howto { background: var(--bg-card); }
.light-theme .howto-grid dt { color: var(--accent-strong); }
.light-theme .insights { border-left-color: var(--accent-strong); }
.light-theme .insights li::before { color: var(--accent-strong); }
.light-theme .kpi::before { opacity: 1; }
.light-theme .section-head h2 { color: var(--text-primary); }
.light-theme th { color: var(--accent-strong); border-bottom: 2px solid var(--border-strong); }
.light-theme .compare-card h4,
.light-theme .kpi .label { color: var(--text-muted); }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg-primary); color: var(--text-primary);
line-height: 1.6; transition: background .25s, color .25s;
font-feature-settings: 'cv11', 'ss01';
}
.sidebar {
position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh;
background: var(--bg-secondary); border-right: 1px solid var(--border);
padding: 1.5rem 1rem; overflow-y: auto; z-index: 100;
transition: transform 0.3s;
}
.sidebar-logo {
font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em;
background: linear-gradient(90deg, var(--accent), var(--accent-purple));
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.sidebar-logo span { font-size: 1.6rem; -webkit-text-fill-color: initial; }
.sidebar-sub { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 1.5rem;
text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-nav a {
display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem;
color: var(--text-secondary); text-decoration: none; border-radius: 8px;
margin-bottom: 0.15rem; transition: all 0.15s; font-size: 0.9rem; font-weight: 500;
border-left: 2px solid transparent;
}
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav a.active { background: var(--bg-hover); color: var(--accent);
border-left-color: var(--accent); }
.sidebar-nav a .icon { width: 18px; text-align: center; font-size: 0.95rem; opacity: 0.9; }
.sidebar-nav .group-label {
font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
color: var(--text-muted); padding: 0.85rem 0.75rem 0.4rem; font-weight: 700;
border-top: 1px solid var(--border); margin-top: 0.5rem;
display: flex; align-items: center; gap: 0.4rem;
}
.sidebar-nav a.sub { font-size: 0.82rem; padding-left: 1.25rem; }
.sidebar-nav a.sub .icon { font-size: 0.85rem; opacity: 0.55; }
.md-divider {
margin: 2.5rem 0 1.25rem; padding: 1.1rem 1.4rem;
background: linear-gradient(90deg, var(--bg-card), var(--bg-secondary));
border: 1px solid var(--border); border-left: 3px solid var(--accent);
border-radius: 12px; box-shadow: var(--shadow-card);
}
.md-divider-label {
font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em;
color: var(--text-primary); margin-bottom: 0.3rem;
}
.md-divider-desc {
color: var(--text-secondary); font-size: 0.9rem; max-width: 80ch; line-height: 1.55;
}
.md-section { scroll-margin-top: 1.5rem; }
.md-section .md-content {
background: var(--bg-card); border: 1px solid var(--border);
border-radius: 12px; padding: 1.4rem 1.6rem;
box-shadow: var(--shadow-card); margin-bottom: 1.25rem;
color: var(--text-secondary); font-size: 0.95rem; line-height: 1.62;
}
.md-section .md-content > *:first-child { margin-top: 0; }
.md-section .md-content h2 {
font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em;
color: var(--text-primary); margin-bottom: 0.65rem;
padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.md-section .md-content h3 {
font-size: 1rem; font-weight: 700; color: var(--text-primary);
margin: 1.4rem 0 0.45rem;
}
.md-section .md-content h4 {
font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
margin: 1.1rem 0 0.35rem;
}
.md-section .md-content p { margin: 0 0 0.7rem; }
.md-section .md-content strong { color: var(--text-primary); font-weight: 700; }
.md-section .md-content em { color: var(--text-primary); }
.md-section .md-content a { color: var(--accent); text-decoration: none; }
.md-section .md-content a:hover { text-decoration: underline; }
.md-section .md-content ul,
.md-section .md-content ol { padding-left: 1.35rem; margin: 0 0 0.85rem; }
.md-section .md-content li { margin-bottom: 0.32rem; }
.md-section .md-content blockquote {
margin: 0.85rem 0; padding: 0.7rem 1rem;
background: rgba(96, 165, 250, 0.08); border-left: 3px solid var(--accent);
border-radius: 4px;
}
.md-section .md-content blockquote p { margin-bottom: 0; }
.md-section .md-content code {
font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
background: var(--bg-elev); color: var(--accent);
padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.85em;
border: 1px solid var(--border);
}
.md-section .md-content pre {
background: var(--bg-elev); border: 1px solid var(--border);
border-radius: 8px; padding: 1rem; overflow-x: auto;
margin: 0.6rem 0 1rem; font-size: 0.85rem;
}
.md-section .md-content pre code {
background: transparent; border: none; padding: 0; color: var(--text-primary);
}
.md-section .md-content hr {
border: none; border-top: 1px solid var(--border); margin: 1.4rem 0;
}
.md-section .md-content table { margin: 0.4rem 0 1rem; font-size: 0.88rem; }
.md-section .md-content img {
display: block; max-width: 100%; height: auto;
border-radius: 8px; border: 1px solid var(--border);
margin: 0.85rem auto; box-shadow: var(--shadow-card);
}
.light-theme .md-section .md-content blockquote { background: rgba(37, 99, 235, 0.08); }
.light-theme .md-section .md-content code { color: var(--accent-strong); }
.main { margin-left: var(--sidebar-width); padding: 2rem 2.5rem; min-height: 100vh; max-width: 1400px; }
.top-bar {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.top-bar h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.top-bar h1 .sub { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; margin-left: 0.5rem; }
.theme-toggle {
background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
padding: 0.45rem 0.85rem; border-radius: 8px; cursor: pointer; font-size: 0.9rem;
transition: all 0.15s; font-weight: 500;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.section-head { margin: 2rem 0 0.75rem; }
.section-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em;
display: flex; align-items: center; gap: 0.5rem; }
.section-head h2 .icon { font-size: 1.25rem; }
.section-head .desc { color: var(--text-secondary); font-size: 0.92rem; margin-top: 0.35rem; max-width: 80ch; }
.section-head .desc strong { color: var(--text-primary); }
.howto { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 1.1rem 1.3rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-card); }
.howto h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem;
display: flex; align-items: center; gap: 0.4rem; color: var(--text-primary); }
.howto h3 .icon { font-size: 1.1rem; }
.howto p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.7rem; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 0.75rem 1rem; }
.howto-grid dt { font-weight: 700; color: var(--accent); font-size: 0.82rem;
font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace; }
.howto-grid dd { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.1rem;
margin-bottom: 0.6rem; line-height: 1.45; }
.takeaway { margin-top: 0.7rem; padding: 0.55rem 0.8rem;
background: rgba(96, 165, 250, 0.08); border-left: 3px solid var(--accent);
border-radius: 4px; font-size: 0.85rem; color: var(--text-secondary); }
.takeaway strong { color: var(--text-primary); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 0.85rem; margin-bottom: 1.5rem; }
.kpi {
background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 1rem 1.1rem; box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
background: var(--accent); opacity: 0.6; }
.kpi.green::before { background: var(--green); }
.kpi.red::before { background: var(--red); }
.kpi.purple::before { background: var(--accent-purple); }
.kpi.yellow::before { background: var(--yellow); }
.kpi .label { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase;
letter-spacing: 0.06em; font-weight: 600; }
.kpi .value { font-size: 1.7rem; font-weight: 800; margin: 0.15rem 0; letter-spacing: -0.02em; }
.kpi.green .value { color: var(--green); }
.kpi.red .value { color: var(--red); }
.kpi.purple .value { color: var(--accent-purple); }
.kpi.yellow .value { color: var(--yellow); }
.kpi .delta { font-size: 0.78rem; color: var(--text-secondary); }
.kpi .delta .up { color: var(--green); font-weight: 700; }
.kpi .delta .down { color: var(--red); font-weight: 700; }
.compare { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.85rem;
margin-bottom: 1.5rem; }
.compare-card {
background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 1.1rem 1.2rem; box-shadow: var(--shadow-card);
}
.compare-card h4 { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase;
letter-spacing: 0.06em; font-weight: 600; margin-bottom: 0.65rem; }
.compare-row { display: flex; justify-content: space-between; align-items: center;
padding: 0.35rem 0; font-size: 0.92rem; }
.compare-row .name { color: var(--text-secondary); }
.compare-row .pct { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; }
.compare-row .pct.high { color: var(--green); }
.compare-row .pct.low { color: var(--red); }
.compare-row .pct.mid { color: var(--accent); }
.compare-delta { margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px dashed var(--border);
font-size: 0.82rem; color: var(--text-secondary); }
.compare-delta strong { color: var(--text-primary); }
.card {
background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 1.2rem 1.3rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-card);
}
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
gap: 1.25rem; margin-bottom: 1.5rem; }
.chart-card {
background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 1rem 1.1rem; box-shadow: var(--shadow-card);
}
.chart-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
margin-bottom: 0.3rem; }
.chart-card .chart-note { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.7rem; }
.chart-wrapper { position: relative; height: 280px; }
.chart-wrapper.tall { height: 340px; }
.chart-wrapper.short { height: 220px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.55rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-elev); color: var(--text-secondary); font-weight: 600;
text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; }
tr.bar-row td { padding-top: 0; padding-bottom: 0.4rem; border-bottom: none; }
tr:hover { background: var(--bg-hover); }
code { font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace; font-size: 0.82rem;
background: var(--bg-elev); padding: 0.1rem 0.4rem; border-radius: 4px; color: var(--accent); }
.progress-bar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.heatmap { display: grid; gap: 3px; margin-top: 0.75rem; }
.heatmap-cell, .heatmap-label { aspect-ratio: 2.4; display: flex; flex-direction: column;
align-items: center; justify-content: center; border-radius: 6px; font-size: 0.85rem; padding: 0.25rem; }
.heatmap-cell { font-weight: 700; transition: transform .15s; cursor: default; }
.heatmap-cell:hover { transform: scale(1.05); z-index: 2; }
.heatmap-cell .sub { font-size: 0.65rem; font-weight: 500; opacity: 0.85; }
.heatmap-label { font-weight: 600; font-size: 0.78rem; color: var(--text-secondary);
background: var(--bg-elev); }
.insights { background: var(--bg-card); border-left: 4px solid var(--accent);
border-radius: 12px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow-card); }
.insights ul { list-style: none; }
.insights li { padding: 0.6rem 0; border-bottom: 1px solid var(--border);
display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.92rem; }
.insights li:last-child { border-bottom: none; }
.insights li::before { content: "▸"; color: var(--accent); font-size: 1rem; flex-shrink: 0; }
.tag { display: inline-block; padding: 0.18rem 0.5rem; border-radius: 4px;
font-size: 0.72rem; font-weight: 600; }
.tag-green { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.tag-red { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.tag-blue { background: rgba(96, 165, 250, 0.15); color: var(--accent); }
.tag-yellow { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.tag-purple { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.82rem;
border-top: 1px solid var(--border); margin-top: 2rem; }
.mobile-toggle { display: none; position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary);
min-width: 44px; min-height: 44px; padding: 0.45rem 0.7rem; border-radius: 10px;
cursor: pointer; font-size: 1.2rem; box-shadow: var(--shadow-card);
align-items: center; justify-content: center; }
.mobile-toggle:active { transform: scale(0.96); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 90;
background: rgba(0,0,0,0.55); opacity: 0; transition: opacity 0.2s; }
body.menu-open { overflow: hidden; }
body.menu-open .sidebar-backdrop { display: block; opacity: 1; }
@media (max-width: 900px) {
.compare { grid-template-columns: 1fr; }
.charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
.sidebar { transform: translateX(-100%); width: min(280px, 84vw); padding: 1.25rem 0.9rem; }
.sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
.main { margin-left: 0; padding: 1rem; padding-top: 4rem; max-width: 100%; }
.top-bar { flex-wrap: wrap; gap: 0.5rem; padding-left: 3.25rem; }
.top-bar h1 { font-size: 1.15rem; }
.top-bar h1 .sub { display: none; }
.theme-toggle { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.mobile-toggle { display: inline-flex; }
.kpis { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.kpi { padding: 0.8rem 0.85rem; }
.kpi .value { font-size: 1.35rem; }
.section-head { margin: 1.5rem 0 0.6rem; }
.section-head h2 { font-size: 1.05rem; }
.section-head .desc { font-size: 0.85rem; }
.howto { padding: 0.9rem 1rem; }
.howto-grid { grid-template-columns: 1fr; }
.chart-card { padding: 0.8rem 0.85rem; }
.chart-wrapper { height: 240px; }
.chart-wrapper.tall { height: 290px; }
.chart-wrapper.short { height: 200px; }
/* Make data tables scrollable inside their card on phones */
.card,
section > .insights,
section > div:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { font-size: 0.82rem; min-width: 520px; }
th, td { padding: 0.45rem 0.6rem; }
th { font-size: 0.66rem; }
.insights { padding: 1rem 1.1rem; }
.insights li { font-size: 0.86rem; }
/* Markdown report content */
.md-section .md-content { padding: 1.1rem 1.15rem; font-size: 0.9rem; overflow-wrap: anywhere; }
.md-section .md-content h2 { font-size: 1.05rem; }
.md-section .md-content h3 { font-size: 0.95rem; }
.md-section .md-content table { display: block; overflow-x: auto; min-width: 0; }
.md-divider { padding: 0.9rem 1rem; margin: 1.75rem 0 1rem; }
.md-divider-label { font-size: 0.98rem; }
.md-divider-desc { font-size: 0.82rem; }
.heatmap-cell, .heatmap-label { font-size: 0.72rem; padding: 0.15rem; }
.heatmap-cell .sub { font-size: 0.58rem; }
.footer { padding: 1.25rem 0.5rem; font-size: 0.78rem; }
}
@media (max-width: 480px) {
.main { padding: 0.75rem; padding-top: 3.75rem; }
.kpis { grid-template-columns: 1fr; }
.top-bar h1 { font-size: 1.05rem; }
}
</style>
</head>
<body>
<button class="mobile-toggle" aria-label="Toggle navigation" aria-controls="sidebar" onclick="toggleMenu()">☰</button>
<div class="sidebar-backdrop" onclick="closeMenu()" aria-hidden="true"></div>
<aside class="sidebar" id="sidebar">
<div class="sidebar-logo"><span>🚢</span> Titanic EDA</div>
<div class="sidebar-sub">titanic5 · 1,309 passengers</div>
<div style="margin-bottom:1.25rem;font-size:0.78rem;color:var(--text-muted);line-height:1.45;">
by <a href="https://aneekhait.github.io" target="_blank" rel="noopener" style="color:var(--accent);text-decoration:none;font-weight:600;">Aneek Hait</a>
</div>
<nav class="sidebar-nav">
<a href="#overview"><span class="icon">📊</span> Overview</a>
<a href="#power"><span class="icon">🎯</span> Feature Power</a>
<a href="#odds"><span class="icon">⚖️</span> Odds Ratios</a>
<a href="#survival"><span class="icon">💚</span> Survival Rates</a>
<a href="#joint"><span class="icon">🧩</span> Class × Sex</a>
<a href="#demographics"><span class="icon">👥</span> Demographics</a>
<a href="#distributions"><span class="icon">📈</span> Distributions</a>
<a href="#lifeboat"><span class="icon">🛶</span> Lifeboats</a>
<a href="#tests"><span class="icon">🧪</span> Statistical Tests</a>
<a href="#correlation"><span class="icon">🔗</span> Correlations</a>
<a href="#missing"><span class="icon">⚠️</span> Missing Values</a>
<a href="#insights"><span class="icon">💡</span> Key Insights</a>
<div class="group-label">📖 Analyst Report</div>
<a href="#report-executive-summary" class="sub"><span class="icon">›</span> Executive Summary</a>
<a href="#report-1-background-question" class="sub"><span class="icon">›</span> Background & Question</a>
<a href="#report-2-data-method" class="sub"><span class="icon">›</span> Data & Method</a>
<a href="#report-3-the-big-picture" class="sub"><span class="icon">›</span> The Big Picture</a>
<a href="#report-4-the-three-biggest-drivers" class="sub"><span class="icon">›</span> The Three Biggest Drivers</a>
<a href="#report-5-secondary-factors" class="sub"><span class="icon">›</span> Secondary Factors</a>
<a href="#report-6-the-mechanism-lifeboats" class="sub"><span class="icon">›</span> The Mechanism: Lifeboats</a>
<a href="#report-7-statistical-robustness" class="sub"><span class="icon">›</span> Statistical Robustness</a>
<a href="#report-8-conclusions-recommendations" class="sub"><span class="icon">›</span> Conclusions & Recommendations</a>
<a href="#report-appendix-glossary" class="sub"><span class="icon">›</span> Appendix — Glossary</a>
</nav>
</aside>
<main class="main">
<div class="top-bar">
<h1>Titanic Survival Dashboard<span class="sub">interactive EDA</span></h1>
<button class="theme-toggle" onclick="toggleTheme()" id="themeBtn">☾ Theme</button>
</div>
<section id="overview">
<div class="section-head">
<h2><span class="icon">📊</span>Headline Numbers</h2>
<div class="desc">Of 1,309 people aboard the Titanic, only <strong>38.2%</strong> made it out alive. But that average hides everything that matters — survival was wildly uneven across <strong>sex</strong>, <strong>passenger class</strong>, and to a lesser extent <strong>age</strong>. This dashboard breaks down exactly who survived and quantifies how much each factor mattered.</div>
</div>
<div class="kpis">
<div class="kpi"><div class="label">Total Passengers</div>
<div class="value">1,309</div>
<div class="delta">14 features, 51 missing ages</div></div>
<div class="kpi green"><div class="label">Survived</div>
<div class="value">500</div>
<div class="delta"><span class="up">38.2%</span> of passengers</div></div>
<div class="kpi red"><div class="label">Perished</div>
<div class="value">809</div>
<div class="delta"><span class="down">61.8%</span> of passengers</div></div>
<div class="kpi purple"><div class="label">Women Survival</div>
<div class="value">72.8%</div>
<div class="delta">vs men <strong>19.1%</strong> · <span class="up">+53.6pp</span></div></div>
<div class="kpi yellow"><div class="label">1st Class Survival</div>
<div class="value">62.0%</div>
<div class="delta">vs 3rd class <strong>25.5%</strong> · <span class="up">+36.5pp</span></div></div>
<div class="kpi"><div class="label">Strongest Odds Ratio</div>
<div class="value">11.3×</div>
<div class="delta">Female vs Male</div></div>
</div>
<div class="compare">
<div class="compare-card">
<h4>Survival by Sex</h4>
<div class="compare-row"><span class="name">Female (n=466)</span><span class="pct high">72.8%</span></div><div class="compare-row"><span class="name">Male (n=843)</span><span class="pct low">19.1%</span></div>
<div class="compare-delta">Difference: <strong>53.6 percentage points</strong></div>
</div>
<div class="compare-card">
<h4>Survival by Class</h4>
<div class="compare-row"><span class="name">Class 1 (n=324)</span><span class="pct high">62.0%</span></div><div class="compare-row"><span class="name">Class 2 (n=276)</span><span class="pct mid">42.8%</span></div><div class="compare-row"><span class="name">Class 3 (n=709)</span><span class="pct low">25.5%</span></div>
<div class="compare-delta">1st vs 3rd: <strong>36.5pp gap</strong></div>
</div>
<div class="compare-card">
<h4>Survival by Port</h4>
<div class="compare-row"><span class="name">Belfast (n=10)</span><span class="pct low">0.0%</span></div><div class="compare-row"><span class="name">Cherbourg (n=272)</span><span class="pct high">56.6%</span></div><div class="compare-row"><span class="name">Queenstown (n=123)</span><span class="pct mid">35.8%</span></div><div class="compare-row"><span class="name">Southampton (n=904)</span><span class="pct mid">33.4%</span></div>
<div class="compare-delta">Cherbourg edge: <strong>+23.2pp vs Southampton</strong></div>
</div>
</div>
<div class="howto">
<h3><span class="icon">📖</span>How to read this dashboard</h3>
<p>You'll see a few statistical terms repeat throughout. Here's what they mean in plain English:</p>
<dl class="howto-grid">
<dt>Survival rate</dt>
<dd>The percentage of a group that survived. "<strong>62.0%</strong>" means 62 of every 100 people in that group survived.</dd>
<dt>95% Confidence Interval (CI)</dt>
<dd>The range the true rate is very likely to fall in. A tight CI = certain estimate; a wide CI = small sample, less certain.</dd>
<dt>Odds Ratio (OR)</dt>
<dd>How many times more likely one group is to survive vs another. <strong>OR = 11.3x</strong> means 11 times the odds; <strong>OR < 1</strong> means lower odds.</dd>
<dt>Effect size (Cramer's V / r)</dt>
<dd>How strongly a feature predicts survival on a 0–1 scale. Rule of thumb: <strong>0.1</strong> = small, <strong>0.3</strong> = medium, <strong>0.5</strong> = large.</dd>
<dt>p-value</dt>
<dd>The probability the pattern is just coincidence. <strong>p < 0.05</strong> = unlikely a fluke; <strong>p < 0.001</strong> = essentially impossible.</dd>
<dt>pp (percentage points)</dt>
<dd>The arithmetic gap between two percentages. Going from 19% to 73% is a <strong>54pp</strong> jump, not "54%".</dd>
</dl>
</div>
</section>
<section id="power">
<div class="section-head">
<h2><span class="icon">🎯</span>Which factors mattered most?</h2>
<div class="desc">If you had to bet someone's chance of surviving knowing only one thing about them, what should that one thing be? This chart ranks every feature by how strongly it predicts survival on a 0–1 scale (small / medium / large).</div>
</div>
<div class="chart-card">
<h3>Predictive power, ranked</h3>
<div class="chart-note">Bigger bar = stronger predictor. The dashed lines mark the conventional thresholds (small / medium / large).</div>
<div class="chart-wrapper tall"><canvas id="powerChart"></canvas></div>
<div class="takeaway"><strong>Takeaway:</strong> <strong>Sex</strong> is in a league of its own (large effect, ~0.53). <strong>Class</strong> is a clear medium-strength predictor. Everything else — age, family size, port — is small or negligible on its own (though they matter in combination).</div>
</div>
</section>
<section id="odds">
<div class="section-head">
<h2><span class="icon">⚖️</span>How much did each factor change your odds?</h2>
<div class="desc">An <strong>odds ratio</strong> answers a simple question: if you compare two groups, how many times more (or less) likely was one to survive? <strong>OR = 2.0</strong> means twice the odds. <strong>OR = 0.5</strong> means half. The dashed line at <strong>1.0</strong> is "no effect at all". Error bars show the 95% range we're confident the true value lies in.</div>
</div>
<div class="chart-card">
<h3>How much each factor boosted (or shrank) the odds of survival</h3>
<div class="chart-note">Log scale — each gridline is 10×. Green bars are above 1 (helped survival), red bars below 1 (hurt survival). Bars to the right of <strong>1</strong> = better odds; to the left = worse odds.</div>
<div class="chart-wrapper tall"><canvas id="oddsChart"></canvas></div>
<div class="takeaway"><strong>Takeaway:</strong> Being a woman gave you roughly <strong>11× the survival odds</strong> of a man. Being in 3rd class cut your odds to about <strong>0.30×</strong> — roughly a third of the rest. These are the two biggest levers; everything else is much smaller.</div>
</div>
<div class="card">
<table>
<thead><tr><th>Contrast</th><th>Odds Ratio</th><th>95% CI</th><th>Exposed</th><th>Unexposed</th><th>Lift</th><th>p</th></tr></thead>
<tbody>
<tr><td><strong>Female vs Male</strong></td><td><code>11.31×</code></td><td>[8.66, 14.76]</td><td>72.8% (n=466)</td><td>19.1% (n=843)</td><td><span class="tag tag-green">+53.6pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>1st Class vs 2nd/3rd</strong></td><td><code>3.75×</code></td><td>[2.88, 4.87]</td><td>62.0% (n=324)</td><td>30.4% (n=985)</td><td><span class="tag tag-green">+31.7pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>3rd Class vs 1st/2nd</strong></td><td><code>0.30×</code></td><td>[0.24, 0.38]</td><td>25.5% (n=709)</td><td>53.2% (n=600)</td><td><span class="tag tag-red">-27.6pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>Child (<=16) vs Adult</strong></td><td><code>1.65×</code></td><td>[1.18, 2.32]</td><td>49.0% (n=151)</td><td>36.8% (n=1158)</td><td><span class="tag tag-green">+12.2pp</span></td><td><code>4.32e-03</code></td></tr><tr><td><strong>Cherbourg vs Other Ports</strong></td><td><code>2.61×</code></td><td>[1.99, 3.42]</td><td>56.6% (n=272)</td><td>33.4% (n=1037)</td><td><span class="tag tag-green">+23.2pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>Top Fare Quartile vs Rest</strong></td><td><code>2.93×</code></td><td>[2.27, 3.79]</td><td>57.6% (n=330)</td><td>31.7% (n=979)</td><td><span class="tag tag-green">+25.9pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>Bottom Fare Quartile vs Rest</strong></td><td><code>0.38×</code></td><td>[0.28, 0.50]</td><td>22.6% (n=340)</td><td>43.6% (n=969)</td><td><span class="tag tag-red">-21.0pp</span></td><td><code><2e-16</code></td></tr><tr><td><strong>Has Family Aboard vs Alone</strong></td><td><code>2.33×</code></td><td>[1.85, 2.93]</td><td>50.3% (n=519)</td><td>30.2% (n=790)</td><td><span class="tag tag-green">+20.0pp</span></td><td><code><2e-16</code></td></tr>
</tbody>
</table>
</div>
</section>
<section id="survival">
<div class="section-head">
<h2><span class="icon">💚</span>Survival rate by group</h2>
<div class="desc">The percentage of each group that made it out alive. The little vertical lines on each bar are <strong>95% confidence intervals</strong> — they show how certain we are about the number. When two bars' intervals don't overlap, the difference between them is almost certainly real, not a fluke.</div>
</div>
<div class="charts-grid">
<div class="chart-card"><h3>Overall Survival</h3>
<div class="chart-wrapper"><canvas id="survivalChart"></canvas></div>
<div class="takeaway"><strong>500 of 1,309</strong> passengers survived. Roughly 1 in 3.</div></div>
<div class="chart-card"><h3>By Sex</h3>
<div class="chart-note">Hover for sample size and 95% CI.</div>
<div class="chart-wrapper"><canvas id="sexChart"></canvas></div>
<div class="takeaway">Women survived at <strong>73%</strong>, men at <strong>19%</strong>. That's the single biggest gap in the entire dataset.</div></div>
<div class="chart-card"><h3>By Passenger Class</h3>
<div class="chart-wrapper"><canvas id="pclassChart"></canvas></div>
<div class="takeaway">A 1st-class ticket gave you over <strong>2× the survival rate</strong> of a 3rd-class one (62% vs 25%) — cabins on upper decks, closer to the lifeboats.</div></div>
<div class="chart-card"><h3>By Embarkation Port</h3>
<div class="chart-wrapper"><canvas id="embarkedChart"></canvas></div>
<div class="takeaway">Cherbourg looks better at a glance, but most of that is just because more 1st-class passengers boarded there. Port itself isn't really doing the work.</div></div>
</div>
</section>
<section id="joint">
<div class="section-head">
<h2><span class="icon">🧩</span>Class × Sex: what happens when you combine them</h2>
<div class="desc">Sex and class don't add up — they <strong>multiply</strong>. Knowing just one of them gives you a guess; knowing both gives you a near-certain prediction. Each cell shows the survival rate for that exact combination and how many people were in it (n).</div>
</div>
<div class="card">
<div id="jointHeatmap" class="heatmap"></div>
<div class="takeaway"><strong>The most extreme contrast in the dataset:</strong> a 1st-class woman had a <strong>96.5%</strong> chance of survival. A 3rd-class man had a <strong>15.2%</strong> chance. Same ship, same iceberg — an 81-percentage-point gap based purely on what ticket you held and what sex you were.</div>
</div>
</section>
<section id="demographics">
<div class="section-head">
<h2><span class="icon">👥</span>Demographics: who else was favored?</h2>
<div class="desc">Beyond sex and class, four more attributes shifted the odds a little: <strong>age</strong> (children first), <strong>fare paid</strong> (mostly a proxy for class), <strong>title</strong> (encodes sex + age + status), and <strong>family size</strong> (a sweet spot at 2–4).</div>
</div>
<div class="charts-grid">
<div class="chart-card"><h3>By Age Group</h3>
<div class="chart-wrapper"><canvas id="ageChart"></canvas></div>
<div class="takeaway">Youngest passengers fared best — clear evidence the "children first" protocol was real. Survival drops steadily with age.</div></div>
<div class="chart-card"><h3>By Fare Range</h3>
<div class="chart-wrapper"><canvas id="fareChart"></canvas></div>
<div class="takeaway">Higher fares paid = higher survival. But this is largely just class repackaged: a 1st-class ticket cost more <em>and</em> got you onto a higher deck.</div></div>
<div class="chart-card"><h3>By Title</h3>
<div class="chart-wrapper"><canvas id="titleChart"></canvas></div>
<div class="takeaway">"Master" (young boys) and "Mrs" (married women) had the best odds. "Mr" (adult men) had by far the worst at 16% — the same story sex+age tells, just labeled differently.</div></div>
<div class="chart-card"><h3>By Family Size</h3>
<div class="chart-wrapper"><canvas id="familyChart"></canvas></div>
<div class="takeaway">Sweet spot at <strong>2–4 family members</strong>. Solo travelers and very large families (5+) both did worse — possibly because mid-size families coordinated boarding lifeboats together.</div></div>
</div>
</section>
<section id="distributions">
<div class="section-head">
<h2><span class="icon">📈</span>Distributions: what did the passengers actually look like?</h2>
<div class="desc">Background on the population itself — without context for who was on the ship, the survival numbers above are hard to interpret. Most passengers were in their 20s–30s, and the fare distribution is heavily skewed: most paid a little, a few paid a lot. We clip the top 1% of fares for readability.</div>
</div>
<div class="charts-grid">
<div class="chart-card"><h3>Age Distribution</h3>
<div class="chart-wrapper"><canvas id="ageDistChart"></canvas></div></div>
<div class="chart-card"><h3>Fare Distribution (≤0.99 quantile)</h3>
<div class="chart-wrapper"><canvas id="fareDistChart"></canvas></div></div>
</div>
</section>
<section id="lifeboat">
<div class="section-head">
<h2><span class="icon">🛶</span>Lifeboat reality check — the proximate cause</h2>
<div class="desc">Everything above is about who was <em>likely</em> to survive. This is about the mechanism: <strong>did you get onto a lifeboat?</strong> The dataset records lifeboat numbers for confirmed boat occupants. The numbers below explain why sex and class mattered: they determined who got onto a boat.</div>
</div>
<div class="compare">
<div class="compare-card">
<h4>Recorded on a Lifeboat</h4>
<div class="compare-row"><span class="name">Passengers</span><span class="pct mid">486</span></div>
<div class="compare-row"><span class="name">Survived</span><span class="pct high">479 (98.6%)</span></div>
<div class="compare-delta">95% CI: [97.1%, 99.3%]</div>
</div>
<div class="compare-card">
<h4>No Lifeboat Record</h4>
<div class="compare-row"><span class="name">Passengers</span><span class="pct mid">823</span></div>
<div class="compare-row"><span class="name">Survived</span><span class="pct low">21 (2.6%)</span></div>
<div class="compare-delta">95% CI: [1.7%, 3.9%]</div>
</div>
<div class="compare-card">
<h4>Lift</h4>
<div class="compare-row"><span class="name">Δ Survival</span><span class="pct high">+96.0pp</span></div>
<div class="compare-row"><span class="name">Coverage</span><span class="pct mid">37.1%</span></div>
<div class="compare-delta">Lifeboat record is near-deterministic of survival, as expected.</div>
</div>
</div>
</section>
<section id="tests">
<div class="section-head">
<h2><span class="icon">🧪</span>Could these patterns just be random luck?</h2>
<div class="desc">Statistical tests answer one question: <strong>how likely is it that these patterns appeared by chance?</strong> The "p-value" is the probability of seeing the observed difference if there were really no underlying effect. <strong>p < 0.05</strong> is the standard threshold for "probably not coincidence". <strong>p < 2e-16</strong> means it's effectively impossible to be a fluke.</div>
</div>
<div class="card">
<table>
<thead><tr><th>Relationship</th><th>Test</th><th>Statistic</th><th>p-value</th><th>Effect</th></tr></thead>
<tbody><tr><td>Sex → Survived</td><td>Chi-square</td><td>363.6</td><td><code><2e-16</code></td><td><span class="tag tag-green">Very Strong</span></td></tr><tr><td>Pclass → Survived</td><td>Chi-square</td><td>128.6</td><td><code><2e-16</code></td><td><span class="tag tag-green">Very Strong</span></td></tr><tr><td>Embarked → Survived</td><td>Chi-square</td><td>54.4</td><td><code>9.36e-12</code></td><td><span class="tag tag-blue">Very Strong</span></td></tr><tr><td>Fare (survived vs perished)</td><td>Welch t-test</td><td>7.98</td><td><code>6.67e-15</code></td><td><span class="tag tag-blue">d=0.48 (Small)</span></td></tr><tr><td>Age (survived vs perished)</td><td>Welch t-test</td><td>-1.10</td><td><code>0.270</code></td><td><span class="tag tag-yellow">d=-0.06 (Negligible)</span></td></tr></tbody>
</table>
</div>
</section>
<section id="correlation">
<div class="section-head">
<h2><span class="icon">🔗</span>Which numerical features move together?</h2>
<div class="desc">Correlation values run from <strong>-1</strong> (move in opposite directions) to <strong>+1</strong> (move together perfectly). <strong>0</strong> = no relationship. Hover any cell to see the exact value. Reds = positive, blues = negative. Most cells here are pale — only a few of the numerical features are strongly related.</div>
</div>
<div class="card">
<div id="corrHeatmap" class="heatmap"></div>
</div>
</section>
<section id="missing">
<div class="section-head">
<h2><span class="icon">⚠️</span>How much of the data is actually missing?</h2>
<div class="desc">Before drawing conclusions, you need to know what's missing. Two columns have gaps: <strong>Occupation</strong> (47% missing — too sparse to use directly) and <strong>Age</strong> (only 3.9% missing, far better than the popular Kaggle subset's 19.9%, so age-based analysis here is reliable).</div>
</div>
<div class="card">
<table>
<thead><tr><th>Column</th><th>Missing</th><th>Percent</th><th>Severity</th></tr></thead>
<tbody><tr><td>Occupation</td><td>621</td><td>47.4%</td><td><span class="tag tag-red">High</span></td></tr><tr class="bar-row"><td colspan="4"><div class="progress-bar"><div class="progress-bar-fill" style="width:47.44%;background:#f87171"></div></div></td></tr><tr><td>Age</td><td>51</td><td>3.9%</td><td><span class="tag tag-green">Low</span></td></tr><tr class="bar-row"><td colspan="4"><div class="progress-bar"><div class="progress-bar-fill" style="width:3.9%;background:#34d399"></div></div></td></tr></tbody>
</table>
</div>
</section>
<section id="insights">
<div class="section-head">
<h2><span class="icon">💡</span>Key insights, in plain English</h2>
<div class="desc">The story the numbers tell, summarized.</div>
</div>
<div class="insights">
<ul>
<li><strong>Sex was by far the biggest factor.</strong> Women survived at 73%, men at 19% — a 54-percentage-point gap. In odds terms, women were about <strong>11× more likely to survive</strong> than men.</li>
<li><strong>Class made things worse if you were already disadvantaged.</strong> Combine 3rd class with male, and survival drops to 15%. Combine 1st class with female and it jumps to 96%. The two factors don't add — they multiply.</li>
<li><strong>The "children first" rule was real but small.</strong> Kids under 16 had about <strong>1.7× the survival odds</strong> of adults. A genuine effect, but nothing like sex or class.</li>
<li><strong>Higher fares helped — but mostly because they bought a 1st-class ticket.</strong> Top fare quartile survived at 58% vs 32% for everyone else. Fare isn't doing independent work; it's class in disguise.</li>
<li><strong>"Where you boarded" is a red herring.</strong> Cherbourg embarkees had a higher survival rate, but that's because lots of 1st-class passengers happened to board there. Once you control for class, port effects mostly disappear.</li>
<li><strong>Family size has a sweet spot at 2–4.</strong> Solo travelers and 5+ families both did worse. Mid-sized families may have coordinated boarding together; solo passengers may have lacked someone advocating for them.</li>
<li><strong>Lifeboat access is the actual mechanism.</strong> 98.6% of passengers with a recorded boat survived; 2.6% without one did. Everything else — sex, class, age — was really just predicting <em>who got onto a boat</em>.</li>
<li><strong>The data is unusually complete.</strong> Only 51 ages (3.9%) are missing here vs ~20% in the well-known Kaggle subset, so age-based analyses are reliable.</li>
</ul>
</div>
</section>
<div class="md-divider">
<div class="md-divider-label">📖 Full Analyst Report</div>
<div class="md-divider-desc">The same narrative that ships as DOCX + PDF, rendered inline. Sections below are scroll-spy targets and link to the dashboard sub-sections above when they cover the same ground.</div>
</div>
<section id="report-executive-summary" class="md-section">
<div class="md-content"><h2>Executive Summary</h2>
<p>On the morning of April 15, 1912, 1,309 people had boarded the RMS Titanic in Southampton, Cherbourg, Queenstown and Belfast. By the next morning, 809 of them were dead. The headline 38.2% survival rate is misleading on its own — the disaster did not pick its victims at random. It selected them along three sharp axes: <strong>sex</strong>, <strong>passenger class</strong>, and (to a lesser extent) <strong>age</strong>.</p>
<p>This report quantifies how unequal the outcomes were, and separates the factors that genuinely mattered from those that only appeared to.</p>
<h3>Headline findings</h3>
<ul>
<li><strong>Sex was the single largest determinant of survival.</strong> Women survived at <strong>72.8%</strong>; men at <strong>19.1%</strong>. In odds terms, women were roughly <strong>11× more likely</strong> to survive than men.</li>
<li><strong>Class strongly compounded the effect of sex.</strong> A 1st-class woman had a <strong>96.5%</strong> chance of surviving; a 3rd-class man had a <strong>15.2%</strong> chance. Same ship, same iceberg — an 81-percentage-point gap.</li>
<li><strong>The "children first" protocol was real, but modest in size.</strong> Children under 16 had about <strong>1.7× the survival odds</strong> of adults. A genuine effect, but nowhere near the magnitude of sex or class.</li>
<li><strong>Lifeboat access was the proximate cause of survival.</strong> Of 486 passengers with a recorded lifeboat number, <strong>98.6%</strong> survived. Of 823 without one, only <strong>2.6%</strong> did. Every demographic factor above was, in effect, predicting who would get a seat on a boat.</li>
<li><strong>Some apparently important factors are confounded with class.</strong> Fare and embarkation port both appear correlated with survival in raw numbers, but most of that signal disappears once class is controlled for. They are proxies, not independent causes.</li>
</ul>
<blockquote>
<p><strong>Bottom line:</strong> if you could ask only one question to guess whether a Titanic passenger survived, ask their sex. If you could ask two, ask their class as well. After those, every other factor is in the noise.</p>
</blockquote>
<hr /></div>
</section>
<section id="report-1-background-question" class="md-section">
<div class="md-content"><h2>1. Background & Question</h2>
<h3>1.1 What happened</h3>
<p>The RMS Titanic struck an iceberg at 23:40 ship's time on April 14, 1912, in the North Atlantic. The collision opened the hull along five forward compartments — one more than the ship was designed to survive flooding. She sank in 2 hours and 40 minutes, with roughly 1,500 people still on board. The number of lifeboat seats was approximately half the number of people aboard. Survival therefore depended almost entirely on <strong>who was given a seat in a lifeboat</strong> in those 160 minutes.</p>
<h3>1.2 What this analysis is trying to answer</h3>
<p>The historical narrative around the Titanic is dominated by the phrase <em>"women and children first."</em> This report tests that narrative quantitatively. Four concrete questions:</p>
<ul>
<li><strong>Q1.</strong> How unequal were the survival outcomes across demographic groups?</li>
<li><strong>Q2.</strong> Which factors were truly driving survival, and which were just confounded with deeper causes?</li>
<li><strong>Q3.</strong> How large were the effects, and how confident can we be in those estimates given the sample sizes?</li>
<li><strong>Q4.</strong> If we were to build a survival prediction model, which features should we prioritise and why?</li>
</ul>
<hr /></div>
</section>
<section id="report-2-data-method" class="md-section">
<div class="md-content"><h2>2. Data & Method</h2>
<h3>2.1 Dataset</h3>
<p>Source: <strong>titanic5</strong>, curated by Encyclopedia Titanica and hosted by <a href="https://hbiostat.org/data/repo/titanic5.csv">Vanderbilt Biostatistics</a>. The dataset contains 1,309 passengers and 14 columns. It is materially more complete than the well-known Kaggle training subset (891 rows). In particular, only 51 ages are missing (3.9%) versus Kaggle's ~20%, which makes age-stratified analysis reliable.</p>
<table>
<thead>
<tr>
<th>Column</th>
<th>Type</th>
<th>Used for</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Survived</code></td>
<td>0/1</td>
<td>Target outcome</td>
</tr>
<tr>
<td><code>Pclass</code></td>
<td>1/2/3</td>
<td>Socioeconomic class proxy (cabin location, boarding priority)</td>
</tr>
<tr>
<td><code>Sex</code></td>
<td>female / male</td>
<td>The single strongest predictor</td>
</tr>
<tr>
<td><code>Age</code></td>
<td>years</td>
<td>Children-first effect; age stratification</td>
</tr>
<tr>
<td><code>SibSp + Parch</code></td>
<td>int</td>
<td>Combined into FamilySize and IsAlone</td>
</tr>
<tr>
<td><code>Fare</code></td>
<td>USD</td>
<td>Class proxy with finer resolution</td>
</tr>
<tr>
<td><code>Embarked</code></td>
<td>C/Q/S/B</td>
<td>Port of embarkation — confounded with class</td>
</tr>
<tr>
<td><code>Name</code></td>
<td>str</td>
<td>Title (Mr/Mrs/Miss/Master) extracted as derived feature</td>
</tr>
<tr>
<td><code>BoatBody</code></td>
<td>str</td>
<td>Parsed into Lifeboat number and BodyRecovered flag</td>
</tr>
</tbody>
</table>
<p>For the full column dictionary and engineering rules, see <a href="https://github.com/AneekHait/titanic-data-analysis/blob/main/docs/DATA.md">docs/DATA.md</a>.</p>
<h3>2.2 Method</h3>
<p>The analytical approach moves from descriptive to inferential:</p>
<ul>
<li><strong>Descriptive comparisons.</strong> Survival rates by group with 95% Wilson confidence intervals so precision is visible.</li>
<li><strong>Effect-size ranking.</strong> Every feature placed on a single 0–1 comparable scale. Cramer's V for categorical features; the absolute point-biserial correlation for numeric ones.</li>
<li><strong>Odds ratios with 95% CIs.</strong> For each headline contrast (women vs men, 1st class vs the rest, etc.) — log-odds standard error + Fisher's exact test.</li>
<li><strong>Hypothesis tests.</strong> Chi-square for categorical relationships; Welch's t-tests with Cohen's d for numeric comparisons; one-way ANOVA across multiple age groups.</li>
<li><strong>Stratified analysis.</strong> Joint Class × Sex tables to surface compounding effects.</li>
</ul>
<p>For the full statistical machinery and why each test was chosen, see <a href="https://github.com/AneekHait/titanic-data-analysis/blob/main/docs/METHODOLOGY.md">docs/METHODOLOGY.md</a>.</p>
<blockquote>
<p><strong>What this report does NOT do:</strong> fit a predictive model. Effect-size ranking and odds ratios are descriptive — they say which features individually carry survival information but do not adjust for one another. A logistic regression with interaction terms would refine these estimates and is the natural next step (see <a href="ROADMAP.md">ROADMAP.md</a>).</p>
</blockquote>
<hr /></div>
</section>
<section id="report-3-the-big-picture" class="md-section">
<div class="md-content"><h2>3. The Big Picture</h2>
<h3>3.1 Overall survival rate</h3>
<p>Of the 1,309 passengers, <strong>500 survived</strong> — a rate of 38.2%. About one in three. That is the figure most people remember, and it is the figure that hides the entire story of this disaster.</p>
<p><img alt="Survival overview: overall, by sex, by class" src="_pdf_charts/survival_overview.png" />
<em>Figure 1. Overall outcome, survival by sex, and survival by class. The marginal averages already hint that "overall" is a misleading number.</em></p>
<h3>3.2 Why the average is misleading</h3>
<p>Consider three slices of the 38.2% headline:</p>
<ul>
<li><strong>By sex:</strong> 72.8% of women survived vs 19.1% of men.</li>
<li><strong>By class:</strong> 62.0% of 1st class vs 25.5% of 3rd class.</li>
<li><strong>By the two combined:</strong> 96.5% of 1st-class women vs 15.2% of 3rd-class men. The arithmetic average between these is meaningless; nobody had a "typical" Titanic experience.</li>
</ul>
<blockquote>
<p>If you remember nothing else from this section: the 38.2% overall rate is an artefact of averaging together two populations that the evacuation treated almost entirely differently.</p>
</blockquote>
<hr /></div>
</section>
<section id="report-4-the-three-biggest-drivers" class="md-section">
<div class="md-content"><h2>4. The Three Biggest Drivers</h2>
<p>We can rank the factors by predictive strength on a common scale. The chart below uses Cramer's V for categorical features and the absolute value of the point-biserial correlation for numeric ones. Both range from 0 to 1; thresholds for "small", "medium", and "large" are 0.1, 0.3, and 0.5 by convention.</p>
<p><img alt="Feature predictive power ranked" src="_pdf_charts/feature_importance.png" />
<em>Figure 2. Feature predictive power, ranked. Three things matter at all — sex, class, and fare/embarked. Everything else is small or negligible on its own.</em></p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Type</th>
<th>Metric</th>
<th>Effect Size</th>
<th>Strength</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Sex</strong></td>
<td>Categorical</td>
<td>Cramer's V</td>
<td><strong>+0.527</strong></td>
<td><strong>Large</strong></td>
</tr>
<tr>
<td><strong>Pclass</strong></td>
<td>Categorical</td>
<td>Cramer's V</td>
<td><strong>+0.313</strong></td>
<td><strong>Medium</strong></td>
</tr>
<tr>
<td>Fare</td>
<td>Numerical</td>
<td>Point-biserial r</td>
<td>+0.247</td>
<td>Small</td>
</tr>
<tr>
<td>Embarked</td>
<td>Categorical</td>
<td>Cramer's V</td>
<td>+0.204</td>
<td>Small</td>
</tr>
<tr>
<td>Parch</td>
<td>Numerical</td>
<td>Point-biserial r</td>
<td>+0.083</td>
<td>Negligible</td>
</tr>
<tr>
<td>Age</td>
<td>Numerical</td>
<td>Point-biserial r</td>
<td>−0.031</td>
<td>Negligible</td>
</tr>
<tr>
<td>SibSp</td>
<td>Numerical</td>
<td>Point-biserial r</td>
<td>−0.028</td>
<td>Negligible</td>
</tr>
</tbody>
</table>
<h3>4.1 Sex — by far the strongest signal</h3>
<p>With Cramer's V ≈ 0.53, sex is the only feature in "large effect" territory. The contrast is stark: of 466 women, 339 survived; of 843 men, only 161 did. The two confidence intervals do not come close to overlapping, so we can be essentially certain this is not noise.</p>
<blockquote>
<p><strong>What this means in plain English:</strong> A woman on the Titanic had roughly <strong>11× the odds</strong> of surviving that a man had (95% CI: 8.7× to 14.8×). Sex is not just the most useful single variable — it is the only variable that on its own gives you a near-reliable prediction.</p>
</blockquote>
<h3>4.2 Class — the second-strongest, and an enabler of the first</h3>
<p>Class came in at Cramer's V ≈ 0.31 — solidly in "medium" territory. The survival rate falls steadily: <strong>1st class 62.0%, 2nd class 42.8%, 3rd class 25.5%</strong>. The mechanism is not abstract: 1st-class cabins were on upper decks, much closer to the boat deck where lifeboats were loaded; 1st-class passengers had priority boarding and better access to information about what was happening as the ship took on water.</p>
<h3>4.3 Class × Sex — the real story is in the interaction</h3>
<p>Sex and class do not simply add to each other — they compound.</p>
<p><img alt="Joint Class × Sex heatmap" src="_pdf_charts/joint_class_sex.png" />
<em>Figure 3. Class × Sex joint survival. The diagonal is staggering: 1st-class women (top-left, deep green) survived almost universally; 3rd-class men (bottom-right, deep red) almost universally died.</em></p>
<table>
<thead>
<tr>
<th>Group</th>
<th style="text-align: right;">Total</th>
<th style="text-align: right;">Survived</th>
<th style="text-align: right;">Rate</th>
<th>95% CI</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>1st — Female</strong></td>
<td style="text-align: right;">144</td>
<td style="text-align: right;">139</td>
<td style="text-align: right;"><strong>96.5%</strong></td>
<td>[92.1, 98.5]</td>
</tr>
<tr>
<td>1st — Male</td>
<td style="text-align: right;">180</td>
<td style="text-align: right;">62</td>
<td style="text-align: right;">34.4%</td>
<td>[27.9, 41.6]</td>
</tr>
<tr>
<td><strong>2nd — Female</strong></td>
<td style="text-align: right;">106</td>
<td style="text-align: right;">94</td>
<td style="text-align: right;"><strong>88.7%</strong></td>
<td>[81.2, 93.4]</td>
</tr>
<tr>
<td>2nd — Male</td>
<td style="text-align: right;">170</td>
<td style="text-align: right;">24</td>
<td style="text-align: right;">14.1%</td>
<td>[9.7, 20.1]</td>
</tr>
<tr>
<td>3rd — Female</td>
<td style="text-align: right;">216</td>
<td style="text-align: right;">106</td>
<td style="text-align: right;">49.1%</td>
<td>[42.5, 55.7]</td>
</tr>
<tr>
<td><strong>3rd — Male</strong></td>
<td style="text-align: right;">493</td>
<td style="text-align: right;">75</td>
<td style="text-align: right;"><strong>15.2%</strong></td>
<td>[12.3, 18.7]</td>
</tr>
</tbody>
</table>
<blockquote>
<p><strong>What this means in plain English:</strong> The two extreme cells — 1st-class women at 96.5% and 3rd-class men at 15.2% — are roughly 80 percentage points apart. That gap is larger than the marginal effect of either sex or class alone. The "women and children first" protocol was real, but it was <strong>not applied uniformly</strong>: a 1st-class woman and a 3rd-class woman did not have the same experience, and a 3rd-class man was effectively outside the priority order entirely.</p>
</blockquote>
<hr /></div>
</section>
<section id="report-5-secondary-factors" class="md-section">
<div class="md-content"><h2>5. Secondary Factors</h2>
<p>Beyond sex and class, four further attributes shifted the survival odds — some genuinely, some only because they were entangled with the bigger drivers.</p>
<h3>5.1 Age — the "children first" effect was real, but small</h3>
<p>Survivors were about a year younger than non-survivors on average (28.9 vs 29.9 years; Welch's t = −1.10, p = 0.270). That difference is statistically marginal and practically tiny. The real age effect lives at the extremes, not the mean — very young children fared significantly better; the elderly fared significantly worse.</p>
<table>
<thead>
<tr>
<th>Age group</th>
<th style="text-align: right;">Total</th>
<th style="text-align: right;">Survived</th>
<th style="text-align: right;">Rate</th>
<th>95% CI</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Child (0–16)</strong></td>
<td style="text-align: right;">151</td>
<td style="text-align: right;">74</td>
<td style="text-align: right;"><strong>49.0%</strong></td>
<td>[41.1, 56.9]</td>
</tr>
<tr>
<td>Young Adult (17–32)</td>
<td style="text-align: right;">704</td>
<td style="text-align: right;">247</td>
<td style="text-align: right;">35.1%</td>
<td>[31.6, 38.6]</td>
</tr>
<tr>
<td>Adult (33–48)</td>
<td style="text-align: right;">332</td>
<td style="text-align: right;">134</td>
<td style="text-align: right;">40.4%</td>
<td>[35.2, 45.8]</td>
</tr>
<tr>
<td>Older Adult (49–64)</td>
<td style="text-align: right;">111</td>
<td style="text-align: right;">45</td>
<td style="text-align: right;">40.5%</td>
<td>[31.8, 49.9]</td>
</tr>
<tr>
<td><strong>Senior (65+)</strong></td>
<td style="text-align: right;">11</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;"><strong>0.0%</strong></td>
<td>[0.0, 25.9]</td>
</tr>
</tbody>
</table>
<h3>5.2 Family size — a sweet spot at 2–4</h3>