-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchap2.html
1355 lines (1213 loc) · 140 KB
/
chap2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>第 2 章 一些非参数程序 | 医学研究中的生存数据建模</title>
<meta name="author" content="Wang Zhen">
<meta name="description" content="分析一组生存数据的第一步是呈现特定总体中个体生存时间的数字或图形总结。这些总结本身可能令人感兴趣,或作为对数据进行更详细分析的前奏。通过生存函数和风险函数的估计,可以方便地总结生存数据。第 2.1 节和第 2.3 节描述了从单个生存数据样本估计这些函数的方法。这些方法被认为是非参数的或无分布的 (distribution-free),因为它们不需要对生存时间的分布做出特定的假设。...">
<meta name="generator" content="bookdown 0.38 with bs4_book()">
<meta property="og:title" content="第 2 章 一些非参数程序 | 医学研究中的生存数据建模">
<meta property="og:type" content="book">
<meta property="og:description" content="分析一组生存数据的第一步是呈现特定总体中个体生存时间的数字或图形总结。这些总结本身可能令人感兴趣,或作为对数据进行更详细分析的前奏。通过生存函数和风险函数的估计,可以方便地总结生存数据。第 2.1 节和第 2.3 节描述了从单个生存数据样本估计这些函数的方法。这些方法被认为是非参数的或无分布的 (distribution-free),因为它们不需要对生存时间的分布做出特定的假设。...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="第 2 章 一些非参数程序 | 医学研究中的生存数据建模">
<meta name="twitter:description" content="分析一组生存数据的第一步是呈现特定总体中个体生存时间的数字或图形总结。这些总结本身可能令人感兴趣,或作为对数据进行更详细分析的前奏。通过生存函数和风险函数的估计,可以方便地总结生存数据。第 2.1 节和第 2.3 节描述了从单个生存数据样本估计这些函数的方法。这些方法被认为是非参数的或无分布的 (distribution-free),因为它们不需要对生存时间的分布做出特定的假设。...">
<!-- JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/6ecbd6c532.js" crossorigin="anonymous"></script><script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="libs/bootstrap-4.6.0/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-4.6.0/bootstrap.bundle.min.js"></script><script src="libs/bs3compat-0.7.0/transition.js"></script><script src="libs/bs3compat-0.7.0/tabs.js"></script><script src="libs/bs3compat-0.7.0/bs3compat.js"></script><link href="libs/bs4_book-1.0.0/bs4_book.css" rel="stylesheet">
<script src="libs/bs4_book-1.0.0/bs4_book.js"></script><script>
/* ========================================================================
* Bootstrap: transition.js v3.3.7
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
if (!$.support.transition) return
$.event.special.bsTransitionEnd = {
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}
}
})
}(jQuery);
</script><script>
/* ========================================================================
* Bootstrap: collapse.js v3.3.7
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
/* jshint latedef: false */
+function ($) {
'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning = null
if (this.options.parent) {
this.$parent = this.getParent()
} else {
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
if (this.options.toggle) this.toggle()
}
Collapse.VERSION = '3.3.7'
Collapse.TRANSITION_DURATION = 350
Collapse.DEFAULTS = {
toggle: true
}
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')
if (activesData && activesData.transitioning) return
}
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
if (actives && actives.length) {
Plugin.call(actives, 'hide')
activesData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element
.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
Collapse.prototype.getParent = function () {
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
var isOpen = $element.hasClass('in')
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
function getTargetFromTrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
return $(target)
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.collapse
$.fn.collapse = Plugin
$.fn.collapse.Constructor = Collapse
// COLLAPSE NO CONFLICT
// ====================
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
// COLLAPSE DATA-API
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this)
if (!$this.attr('data-target')) e.preventDefault()
var $target = getTargetFromTrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
Plugin.call($target, option)
})
}(jQuery);
</script><script>
window.initializeCodeFolding = function(show) {
// handlers for show-all and hide all
$("#rmd-show-all-code").click(function() {
$('div.r-code-collapse').each(function() {
$(this).collapse('show');
});
});
$("#rmd-hide-all-code").click(function() {
$('div.r-code-collapse').each(function() {
$(this).collapse('hide');
});
});
// index for unique code element ids
var currentIndex = 1;
// select all R code blocks
var rCodeBlocks = $('pre.sourceCode, pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.js');
rCodeBlocks.each(function() {
// create a collapsable div to wrap the code in
var div = $('<div class="collapse r-code-collapse"></div>');
if (show)
div.addClass('in');
var id = 'rcode-643E0F36' + currentIndex++;
div.attr('id', id);
$(this).before(div);
$(this).detach().appendTo(div);
// add a show code button right above
var showCodeText = $('<span>' + (show ? 'Hide' : 'Code') + '</span>');
var showCodeButton = $('<button type="button" class="btn btn-default btn-xs code-folding-btn pull-right"></button>');
showCodeButton.append(showCodeText);
showCodeButton
.attr('data-toggle', 'collapse')
.attr('data-target', '#' + id)
.attr('aria-expanded', show)
.attr('aria-controls', id);
var buttonRow = $('<div class="row"></div>');
var buttonCol = $('<div class="col-md-12"></div>');
buttonCol.append(showCodeButton);
buttonRow.append(buttonCol);
div.before(buttonRow);
// update state of button on show/hide
div.on('hidden.bs.collapse', function () {
showCodeText.text('Code');
});
div.on('show.bs.collapse', function () {
showCodeText.text('Hide');
});
});
}
</script><script>
/* ========================================================================
* Bootstrap: dropdown.js v3.3.7
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle="dropdown"]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.VERSION = '3.3.7'
function getParent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $this = $(this)
var $parent = getParent($this)
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
})
}
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$(document.createElement('div'))
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)
}
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger($.Event('shown.bs.dropdown', relatedTarget))
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
var $this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if (!isActive && e.which != 27 || isActive && e.which == 27) {
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc = ' li:not(.disabled):visible a'
var $items = $parent.find('.dropdown-menu' + desc)
if (!$items.length) return
var index = $items.index(e.target)
if (e.which == 38 && index > 0) index-- // up
if (e.which == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items.eq(index).trigger('focus')
}
// DROPDOWN PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.dropdown
$.fn.dropdown = Plugin
$.fn.dropdown.Constructor = Dropdown
// DROPDOWN NO CONFLICT
// ====================
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
}(jQuery);
</script><style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
.row { display: flex; }
.collapse { display: none; }
.in { display:block }
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.open > .dropdown-menu {
display: block;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
</style>
<script>
$(document).ready(function () {
window.initializeCodeFolding("show" === "show");
});
</script><script>
document.write('<div class="btn-group pull-right" style="position: absolute; top: 20%; right: 2%; z-index: 200"><button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" data-_extension-text-contrast=""><span>Code</span> <span class="caret"></span></button><ul class="dropdown-menu" style="min-width: 50px;"><li><a id="rmd-show-all-code" href="#">Show All Code</a></li><li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li></ul></div>')
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- CSS --><style type="text/css">
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
</style>
<link rel="stylesheet" href="style.css">
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container-fluid">
<div class="row">
<header class="col-sm-12 col-lg-3 sidebar sidebar-book"><a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
<div class="d-flex align-items-start justify-content-between">
<h1>
<a href="index.html" title="">医学研究中的生存数据建模</a>
</h1>
<button class="btn btn-outline-primary d-lg-none ml-2 mt-1" type="button" data-toggle="collapse" data-target="#main-nav" aria-expanded="true" aria-controls="main-nav"><i class="fas fa-bars"></i><span class="sr-only">Show table of contents</span></button>
</div>
<div id="main-nav" class="collapse-lg">
<form role="search">
<input id="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>
<nav aria-label="Table of contents"><h2>Table of contents</h2>
<ul class="book-toc list-unstyled">
<li><a class="" href="index.html">前言</a></li>
<li><a class="" href="%E4%BD%9C%E8%80%85%E4%BB%8B%E7%BB%8D.html">作者介绍</a></li>
<li><a class="" href="%E7%9B%AE%E5%BD%95.html">目录</a></li>
<li class="book-part">正文</li>
<li><a class="" href="chap1.html"><span class="header-section-number">1</span> 生存分析</a></li>
<li><a class="active" href="chap2.html"><span class="header-section-number">2</span> 一些非参数程序</a></li>
<li><a class="" href="chap3.html"><span class="header-section-number">3</span> Cox 回归模型</a></li>
<li><a class="" href="cox-%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B.html">►Cox 回归模型</a></li>
<li><a class="" href="chap4.html"><span class="header-section-number">4</span> Cox 回归模型的模型检查</a></li>
<li><a class="" href="chap5.html"><span class="header-section-number">5</span> 参数回归模型</a></li>
<li><a class="" href="%E5%8F%82%E6%95%B0%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B.html">►参数回归模型</a></li>
<li><a class="" href="chap6.html"><span class="header-section-number">6</span> 灵活的参数模型</a></li>
<li><a class="" href="chap7.html"><span class="header-section-number">7</span> 参数模型的模型检查</a></li>
<li><a class="" href="chap8.html"><span class="header-section-number">8</span> 时依变量</a></li>
<li><a class="" href="chap9.html"><span class="header-section-number">9</span> 区间删失生存数据</a></li>
<li><a class="" href="chap10.html"><span class="header-section-number">10</span> 脆弱模型</a></li>
<li><a class="" href="chap11.html"><span class="header-section-number">11</span> 非比例风险和机构的比较</a></li>
<li><a class="" href="chap12.html"><span class="header-section-number">12</span> 竞争风险</a></li>
<li><a class="" href="chap13.html"><span class="header-section-number">13</span> 多次事件和事件史分析</a></li>
<li><a class="" href="chap14.html"><span class="header-section-number">14</span> 相依删失</a></li>
<li><a class="" href="chap15.html"><span class="header-section-number">15</span> 生存研究的样本量要求</a></li>
<li><a class="" href="chap16.html"><span class="header-section-number">16</span> 贝叶斯生存分析</a></li>
<li><a class="" href="chap17.html"><span class="header-section-number">17</span> 使用 R 进行生存分析</a></li>
<li class="book-part">附录</li>
<li><a class="" href="A.html"><span class="header-section-number">A</span> 最大似然估计</a></li>
<li><a class="" href="B.html"><span class="header-section-number">B</span> 额外数据集</a></li>
<li class="book-part">—</li>
<li><a class="" href="bib.html">参考书目</a></li>
<li><a class="" href="exm.html">示例索引</a></li>
</ul>
<div class="book-extra">
</div>
</nav>
</div>
</header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><div id="chap2" class="section level1" number="2">
<h1>
<span class="header-section-number">第 2 章</span> 一些非参数程序<a class="anchor" aria-label="anchor" href="#chap2"><i class="fas fa-link"></i></a>
</h1>
<p>分析一组生存数据的第一步是呈现特定总体中个体生存时间的数字或图形总结。这些总结本身可能令人感兴趣,或作为对数据进行更详细分析的前奏。通过生存函数和风险函数的估计,可以方便地总结生存数据。第 <a href="chap2.html#sec2-1">2.1</a> 节和第 <a href="chap2.html#sec2-3">2.3</a> 节描述了从单个生存数据样本估计这些函数的方法。这些方法被认为是非参数的或无分布的 (distribution-free),因为它们不需要对生存时间的分布做出特定的假设。</p>
<p>一旦找到生存函数的估计,就可以估计生存时间分布的中位数和其他百分位数,如第 <a href="chap2.html#sec2-4">2.4</a> 节所示。数据的数字总结,基于对数据的概率分布假设得出,将在第 <a href="chap5.html#chap5">5</a> 章考虑。</p>
<p>当比较两组患者的生存时间时,可以使用生存函数估计对每组个体的生存经历进行非正式比较。然而,有更正式的程序可以比较两组生存数据。第 <a href="chap2.html#sec2-6">2.6</a> 节描述了用于比较两组或多组生存时间的三种非参数程序,即 log-rank, Wilcoxon 和 Peto-Peto 检验。</p>
<div id="sec2-1" class="section level2" number="2.1">
<h2>
<span class="header-section-number">2.1</span> 估计生存函数<a class="anchor" aria-label="anchor" href="#sec2-1"><i class="fas fa-link"></i></a>
</h2>
<p>首先假设我们有一个生存时间样本,其中没有任何删失的观测。生存函数 <span class="math inline">\(S(t)\)</span> 由式 <a href="chap1.html#eq:1-2">(1.2)</a> 定义,是个体生存时间大于等于 <span class="math inline">\(t\)</span> 的概率。该函数可以通过<strong>经验生存函数</strong> (empirical survival function) 来估计,由下式给出</p>
<p><span class="math display" id="eq:2-1">\[\begin{equation}
\hat S(t)=\frac{\text{生存时间 }\ge t \text{ 的个体数量}}{\text{数据集中的个体数量}}
\tag{2.1}
\end{equation}\]</span></p>
<p>等价地,<span class="math inline">\(\hat S(t)=1 − \hat F(t)\)</span>,其中 <span class="math inline">\(\hat F(t)\)</span> 是经验分布函数 (empirical distribution function),即研究中在 <span class="math inline">\(t\)</span> 时刻生存的个体总数与该组个体总数的比值。请注意,经验生存函数在第一个死亡时间 <span class="math inline">\(t\)</span> 之前等于 1,在最终死亡时间之后等于 0.</p>
<p>假设生存函数估计 <span class="math inline">\(\hat S(t)\)</span> 在两个相邻死亡时间之间是恒定的,因此 <span class="math inline">\(\hat S(t)\)</span> 关于 <span class="math inline">\(t\)</span> 的图像是阶跃函数 (step function). 在每个生存时间之后,函数立即下降。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-1" class="example"><strong>示例 2.1 (肺转移) </strong></span><br></p>
<p>恶性骨肿瘤或骨肉瘤患者治疗中的一项并发症是肿瘤经常扩散到肺部。这种肺部转移会危及生命。在一项有关治疗骨肉瘤引起的肺转移的研究中,Burdette and Gehan (1970) 给出了 11 名男性患者的以下生存时间(以月为单位):11 13 13 13 13 13 14 14 15 15 17. 使用式 <a href="chap2.html#eq:2-1">(2.1)</a>,生存函数在第 11, 13, 14, 15 和 17 个月时的估计值为 1.000, 0.909, 0.455, 0.273 和 0.091. 生存函数的估计值从时间起点到 11 个月为 1,在 17 个月后为 0. 图 2.1 给出了生存函数估计的图示。</p>
<details><summary><font color="#8B2232">图 2.1</font>
</summary><img src="figure/figure%202.1.png#center" style="width:80.0%"></details>
</div>
</div>
<p>当存在删失观测时,上述示例中所示的估计生存函数的方法无法使用。原因是该方法不允许将在时间 <span class="math inline">\(t\)</span> 之前生存时间删失的个体的信息用于计算时间 <span class="math inline">\(t\)</span> 处的生存函数估计。以下部分描述了可用于存在删失生存时间情况下估计 <span class="math inline">\(S(t)\)</span> 的非参数方法。</p>
<div id="sec2-1-1" class="section level3" number="2.1.1">
<h3>
<span class="header-section-number">2.1.1</span> 生存函数的生命表估计<a class="anchor" aria-label="anchor" href="#sec2-1-1"><i class="fas fa-link"></i></a>
</h3>
<p>生存函数的<strong>生命表估计</strong> (life-table estimate),也称为生存函数的<strong>精算估计</strong> (actuarial estimate),是通过首先将观察期划分为一系列时间区间而获得的。这些区间不一定是等长的,尽管它们通常是等长的。使用的区间数量取决于研究中的人数,但通常在 5 到 15 之间。假设有 <span class="math inline">\(m\)</span> 个这样的区间,第 <span class="math inline">\(j(=1,2,\cdots,m)\)</span> 个区间的时间范围为 <span class="math inline">\([t^\prime_{j-1},t^\prime_j)\)</span>,我们取 <span class="math inline">\(t_0 = 0\)</span> 且 <span class="math inline">\(t_m = \infty\)</span>。另外,令 <span class="math inline">\(d_j\)</span> 和 <span class="math inline">\(c_j\)</span> 分别表示该时间区间内的死亡人数和删失生存时间数,令 <span class="math inline">\(n_j\)</span> 为在第 <span class="math inline">\(j\)</span> 个区间开始时存活且面临死亡风险的个体数量。我们现在假设删失程序是这样的,即删失生存时间在第 <span class="math inline">\(j\)</span> 个时间区间内均匀出现,因此在该时间区间内处于风险的平均人数为</p>
<p><span class="math display" id="eq:2-2">\[\begin{equation}
n'_j=n_j-c_j/2
\tag{2.2}
\end{equation}\]</span></p>
<p>该假设有时称为<strong>精算假设</strong> (actuarial assumption).</p>
<p>在第 <span class="math inline">\(j\)</span> 个区间内,死亡概率可以通过 <span class="math inline">\(d_{j}/n_{j}^{\prime}\)</span> 来估计,因此对应的生存概率为 <span class="math inline">\((n'_j-d_j)/n'_j\)</span> 。现考虑个体在时间 <span class="math inline">\(t_{j-1}^{\prime},j=2,3,\ldots,m\)</span> 之后生存的概率,即生存到第 <span class="math inline">\(j\)</span> 个区间开始后的某个时间。这将是个体在前 <span class="math inline">\(j − 1\)</span> 个区间中生存的概率的乘积,因此生存函数的生命表估计由下式给出</p>
<p><span class="math display" id="eq:2-3">\[\begin{equation}
S^*(t)=\prod_{i=1}^{j-1}\left(\frac{n_i'-d_i}{n_i'}\right)
\tag{2.3}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(t'_{j-1}\leqslant t<t'_j,j=2,3,\ldots,m\)</span>. 在第一个区间 <span class="math inline">\(t'_0\)</span> 开始之后的生存概率估计当然是 1,而在 <span class="math inline">\(t'_m\)</span> 之外的生存概率估计为 0. 生存函数的图形估计将是一个阶跃函数,在每个时间区间内函数值恒定。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-2" class="example"><strong>示例 2.2 (多发性骨髓瘤患者的生存情况) </strong></span><br></p>
<p>为了说明生命表估计值的计算,请考虑表 1.3 中给出的 48 名多发性骨髓瘤患者的生存时间数据。在此示例中,将忽略为每个个体收集的关于其他解释变量的信息。</p>
<p>首先对生存时间进行分组,得出研究前五年和随后三年的死亡患者人数 <span class="math inline">\(d_j\)</span> 和删失人数 <span class="math inline">\(c_j\)</span>. 然后计算每个区间开始时处于死亡风险的人数 <span class="math inline">\(n_j\)</span>,以及调整后的处于风险数 <span class="math inline">\(n′_j\)</span>. 最后,估计每个区间的生存概率,使用式 <a href="chap2.html#eq:2-3">(2.3)</a> 获得生存函数估计。计算如表 2.1 所示,其中时间段以月为单位。第 <span class="math inline">\(j\)</span> 个区间从时间 <span class="math inline">\(t^\prime_{j−1}\)</span> 开始,在时间 <span class="math inline">\(t^\prime_{j}\)</span> 之前结束,表示为 <span class="math inline">\(t_{j−1}^{\prime}-\)</span>,其中 <span class="math inline">\(j=1,2,\cdots,m\)</span>。</p>
<details><summary><font color="#8B2232">表 2.1</font>
</summary><img src="figure/table%202.1.png#center" style="width:80.0%"></details><p><br>
生存函数的生命表估计图如图 2.2 所示。</p>
<details><summary><font color="#8B2232">图 2.2</font>
</summary><img src="figure/figure%202.2.png#center" style="width:80.0%"></details>
</div>
</div>
<p>使用这种方法得到的生存函数估计的形式对其构造中使用的区间选择很敏感,正如直方图的形状取决于类别区间的选择一样。另一方面,生命表估计特别适用于实际死亡时间未知的情况,这时唯一可用的信息是在一系列连续时间区间内发生的死亡数和删失观测数。在实践中,这种区间删失的生存数据相当常见。</p>
<p>当实际生存时间已知时,仍然可以使用生命表估计,如例 2.2 所示,但生存时间的分组确实会导致一些信息丢失。使用其他方法来估计生存函数会更为合适,例如生存函数的 Kaplan-Meier 估计。</p>
</div>
<div id="sec2-1-2" class="section level3" number="2.1.2">
<h3>
<span class="header-section-number">2.1.2</span> 生存函数的 Kaplan-Meier 估计<a class="anchor" aria-label="anchor" href="#sec2-1-2"><i class="fas fa-link"></i></a>
</h3>
<p>分析未分组的删失生存数据的第一步通常是获得生存函数的 <strong>Kaplan-Meier 估计</strong>。因此,这一估计是经过详细考虑的。为了获得 Kaplan-Meier 估计,需要构建一系列时间区间,就像生命表估计一样。然而,每个这样的区间都被设计成只包含一个死亡时间,且这个死亡时间被认为发生在该区间的开始时刻。</p>
<p>作为说明,假设 <span class="math inline">\(t_{(1)},t_{(2)}, t_{(3)}\)</span> 是按秩次 (rank order) 排列的三个生存时间,即 <span class="math inline">\(t_{(1)}<t_{(2)}<t_{(3)}\)</span>,并且 <span class="math inline">\(c\)</span> 是介于 <span class="math inline">\(t_{(2)}\)</span> 和 <span class="math inline">\(t_{(3)}\)</span> 之间的删失生存时间。然后,构建的区间从时间 <span class="math inline">\(t_{(1)},t_{(2)}\)</span> 和 <span class="math inline">\(t_{(3)}\)</span> 开始,每个区间包含一个死亡时间,尽管在任何特定死亡时间可能有多个个体死亡。请注意,没有区间从删失时间 <span class="math inline">\(c\)</span> 开始。现在假设有 2 个人在 <span class="math inline">\(t_{(1)}\)</span> 死亡,1 个人在 <span class="math inline">\(t_{(2)}\)</span> 死亡,3 个人在 <span class="math inline">\(t_{(3)}\)</span> 死亡。如图 2.3 所示,其中 D 代表死亡,C 代表删失生存时间。</p>
<details><summary><font color="#8B2232">图 2.3</font>
</summary><img src="figure/figure%202.3.png#center" style="width:80.0%"></details><p><br>
时间起点用 <span class="math inline">\(t_0\)</span> 表示,因此有一个从 <span class="math inline">\(t_0\)</span> 开始的初始时间段,在 <span class="math inline">\(t_{(1)}\)</span>(第一次死亡时间)之前结束。这意味着从 <span class="math inline">\(t_0\)</span> 到 <span class="math inline">\(t_{(1)}\)</span> 的区间将不包括死亡时间。第一个构造的区间的范围从 <span class="math inline">\(t_{(1)}\)</span> 延伸到 <span class="math inline">\(t_{(2)}\)</span> 之前,并且由于第二次死亡时间为 <span class="math inline">\(t_{(2)}\)</span>,因此该区间包括 <span class="math inline">\(t_{(1)}\)</span> 处的单个死亡时间。第二个区间从时间 <span class="math inline">\(t_{(2)}\)</span> 开始,在 <span class="math inline">\(t_{(3)}\)</span> 之前结束,包括 <span class="math inline">\(t_{(2)}\)</span> 处的死亡时间和删失时间 <span class="math inline">\(c\)</span>。还有从 <span class="math inline">\(t_{(3)}\)</span> 开始的第三个区间,其中包含最长的生存时间 <span class="math inline">\(t_{(3)}\)</span>。</p>
<p>一般来说,假设有 <span class="math inline">\(n\)</span> 个个体,生存时间为 <span class="math inline">\(t_1, t_2,...,t_n\)</span>。其中一些观测可能是右删失的,并且也可能有多个个体具有相同的生存时间。因此,我们假设个体中有 <span class="math inline">\(r\)</span> 个死亡时间,其中 <span class="math inline">\(r \le n\)</span>。将这些死亡时间按升序排列后,第 <span class="math inline">\(j\)</span> 个死亡时间记为 <span class="math inline">\(t_{(j)}\)</span>,其中 <span class="math inline">\(j = 1, 2,...,r\)</span>,因此 <span class="math inline">\(r\)</span> 个死亡时间依次为 <span class="math inline">\(t_{(1)} < t_{(2)} < \cdots < t_{(r)}\)</span>。在时间 <span class="math inline">\(t_{(j)}\)</span> 之前还存活的个体数量,包括此时即将死亡的个体数量,表示为 <span class="math inline">\(n_j\)</span>,并且 <span class="math inline">\(d_j\)</span> 表示此时死亡的数量,其中 <span class="math inline">\(j = 1, 2,...,r\)</span>。从 <span class="math inline">\(t_{(j)} − \delta\)</span> 到 <span class="math inline">\(t_{(j)}\)</span> 的时间区间(其中 <span class="math inline">\(\delta\)</span> 是无穷小的时间区间)包含一次死亡时间。由于在 <span class="math inline">\(t_{(j)}\)</span> 之前有 <span class="math inline">\(n_j\)</span> 个个体还存活,并且在 <span class="math inline">\(t_{(j)}\)</span> 时有 <span class="math inline">\(d_j\)</span> 个个体死亡,因此个体在 <span class="math inline">\(t_{(j)} − \delta\)</span> 到 <span class="math inline">\(t_{(j)}\)</span> 的时间区间内死亡的概率估计为 <span class="math inline">\(d_j/n_j\)</span>。在该时间区间内相应的生存概率估计为 <span class="math inline">\((n_j − d_j )/n_j\)</span>。</p>
<p>有时删失生存时间与一个或多个死亡时间同时出现的情况,导致死亡时间和删失生存时间看似同时发生。在这种情况下计算 <span class="math inline">\(n_j\)</span> 值时,删失生存时间视为在死亡时间之后立即发生。</p>
<p>从构建时间区间的方式来看,从 <span class="math inline">\(t_{(j)}\)</span> 到 <span class="math inline">\(t_{(j+1)} − \delta\)</span>(下一次死亡时间之前)的区间不包含任何死亡。因此,从 <span class="math inline">\(t_{(j)}\)</span> 到 <span class="math inline">\(t_{(j+1)} − \delta\)</span> 的生存概率为 1,并且从 <span class="math inline">\(t_{(j)}-\delta\)</span> 到 <span class="math inline">\(t_{(j)}\)</span> 以及从 <span class="math inline">\(t_{(j)}\)</span> 到 <span class="math inline">\(t_{(j+1)} − \delta\)</span> 的联合生存概率可估计为 <span class="math inline">\((n_j − d_j )/n_j\)</span>。当 <span class="math inline">\(\delta\)</span> 趋于零时,<span class="math inline">\((n_j − d_j )/n_j\)</span> 就是 <span class="math inline">\(t_{(j)}\)</span> 到 <span class="math inline">\(t_{(j+1)}\)</span> 区间的生存概率估计。</p>
<p>我们现在假设样本中个体的死亡是相互独立发生的。那么,在构造的第 <span class="math inline">\(k\)</span> 个时间区间 <span class="math inline">\([t_{(k)}, t_{(k+1)})\)</span>(其中 <span class="math inline">\(k=1, 2,...,r\)</span>,且 <span class="math inline">\(t_{(r+1)}\)</span> 定义为 <span class="math inline">\(\infty\)</span>)中的任意时间 <span class="math inline">\(t\)</span> 处生存函数的估计将是生存到 <span class="math inline">\(t_{(k)}\)</span> 之后的概率的估计。这实际上是生存到 <span class="math inline">\([t_{(k)}, t_{(k+1)})\)</span> 这个区间以及所有之前区间的概率,并由此得到 Kaplan-Meier 生存函数估计,其表达式为:</p>
<p><span class="math display" id="eq:2-4">\[\begin{equation}
\hat{S}(t)=\prod_{j=1}^k\left(\frac{n_j-d_j}{n_j}\right)
\tag{2.4}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(t_{(k)}\leqslant t<t_{(k+1)},k=1,2,\ldots,r\)</span>,对于 <span class="math inline">\(t<t_{(1)}\)</span> 有 <span class="math inline">\(\hat S(t)=1\)</span>,且 <span class="math inline">\(t_{(r+1)}\)</span> 取 <span class="math inline">\(\infty\)</span>。如果最大的观测是删失生存时间 <span class="math inline">\(t ^*\)</span>,则对于 <span class="math inline">\(t > t^*\)</span>,<span class="math inline">\(\hat S(t)\)</span> 是未定义的。另一方面,如果最大生存时间 <span class="math inline">\(t_{(r)}\)</span> 是右删失观测,则 <span class="math inline">\(n_r = d_r\)</span>,对于 <span class="math inline">\(t \ge t_{(r)}\)</span>,<span class="math inline">\(\hat S(t)\)</span> 为 0. 生存函数的 Kaplan-Meier 估计图是一个阶跃函数,其中生存概率估计在相邻死亡时间之间保持恒定,并在每个死亡时间减少。</p>
<p>式 <a href="chap2.html#eq:2-4">(2.4)</a> 表明,对于式 <a href="chap2.html#eq:2-3">(2.3)</a> 中生存函数的生命表估计,Kaplan-Meier 估计是由一系列概率估计的乘积得到的。事实上,Kaplan-Meier 估计是式 <a href="chap2.html#eq:2-3">(2.3)</a> 中生命表估计的极限值,因为区间数量趋于无穷大且宽度趋于零。因此,Kaplan-Meier 估计也称为生存函数的<strong>乘积极限估计</strong> (product-limit estimate).</p>
<p>请注意,如果数据集中没有删失生存时间,则式 <a href="chap2.html#eq:2-4">(2.4)</a> 中的 <span class="math inline">\(n_j − d_j = n_{j+1}, j = 1, 2,...,k\)</span>,并且展开乘积可以得到</p>
<p><span class="math display">\[\hat{S}(t)=\frac{n_2}{n_1}\times\frac{n_3}{n_2}\times\cdots\times\frac{n_{k+1}}{n_k}\]</span></p>
<p>对于 <span class="math inline">\(k = 1, 2,...,r − 1\)</span>,这可简化为 <span class="math inline">\(n_{k+1}/n_1\)</span>。对于 <span class="math inline">\(t<t_{(1)}\)</span> 有 <span class="math inline">\(\hat S(t) = 1\)</span>;对于 <span class="math inline">\(t \ge t_{(r)}\)</span> 有 <span class="math inline">\(\hat S(t) = 0\)</span>。现在,<span class="math inline">\(n_1\)</span> 是在第一次死亡时间之前处于风险中的个体数量,即样本的个体数量,<span class="math inline">\(n_{k+1}\)</span> 是生存时间大于等于 <span class="math inline">\(t_{(k+1)}\)</span> 的个体数量。因此,在没有删失的情况下,<span class="math inline">\(\hat S(t)\)</span> 只是式 <a href="chap2.html#eq:2-1">(2.1)</a> 中定义的经验生存函数。因此,Kaplan-Meier 估计是经验生存函数的推广,该函数用于适应删失观测。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-3" class="example"><strong>示例 2.3 (停用宫内节育器的时间) </strong></span><br></p>
<p>表 1.1 给出了 18 名妇女停用宫内节育器的时间数据。对于这些数据,生存函数 <span class="math inline">\(S(t)\)</span> 表示妇女在任何时间 <span class="math inline">\(t\)</span> 后停用避孕装置的概率。使用式 <a href="chap2.html#eq:2-4">(2.4)</a> 可以很容易地获得生存函数的 Kaplan-Meier 估计,所需的计算如表 2.2 所示。</p>
<details><summary><font color="#8B2232">表 2.2</font>
</summary><img src="figure/table%202.2.png#center" style="width:80.0%"></details><p><br>
生存函数估计如图 2.4 所示。请注意,由于最大停用时间 107 天是删失的,因此在 <span class="math inline">\(t=107\)</span> 之后无法定义 <span class="math inline">\(\hat S(t)\)</span>。</p>
<details><summary><font color="#8B2232">图 2.4</font>
</summary><img src="figure/figure%202.4.png#center" style="width:80.0%"></details>
</div>
</div>
</div>
<div id="sec2-1-3" class="section level3" number="2.1.3">
<h3>
<span class="header-section-number">2.1.3</span> 生存函数的 Nelson-Aalen 估计<a class="anchor" aria-label="anchor" href="#sec2-1-3"><i class="fas fa-link"></i></a>
</h3>
<p>基于单个事件时间生存函数的另一种估计是 <strong>Nelson-Aalen 估计</strong>,由下式给出</p>
<p><span class="math display" id="eq:2-5">\[\begin{equation}
\tilde{S}(t)=\prod_{j=1}^k\exp(-d_j/n_j)
\tag{2.5}
\end{equation}\]</span></p>
<p>如第 <a href="chap2.html#sec2-3-3">2.3.3</a> 节所示,可以从累积风险函数估计中获得该估计。此外,生存函数的 Kaplan-Meier 估计可以看作是 Nelson-Aalen 估计的近似。为了证明这一点,利用如下结果</p>
<p><span class="math display">\[\begin{aligned}e^{-x}&=1-x+\frac{x^2}{2}-\frac{x^3}{6}+\cdots\end{aligned}\]</span></p>
<p>当 <span class="math inline">\(x\)</span> 很小时,该式近似于 <span class="math inline">\(1−x\)</span>。因此只要 <span class="math inline">\(d+j\)</span> 相对于 <span class="math inline">\(n_j\)</span> 很小(除非在最长的生存时间),就有 <span class="math inline">\(\exp ({-d_j/n_j})\approx1-(d_j/n_j)=(n_j-d_j)/n_j\)</span>。因此,式 <a href="chap2.html#eq:2-4">(2.4)</a> 中的 Kaplan-Meier 估计 <span class="math inline">\(\hat S(t)\)</span> 近似于式 <a href="chap2.html#eq:2-5">(2.5)</a> 中的 Nelson-Aalen 估计 <span class="math inline">\(\tilde S(t)\)</span>。</p>
<p>生存函数的 Nelson-Aalen 估计,也称为 <strong>Altshuler 估计</strong>,在任何给定时间都始终大于 Kaplan-Meier 估计,因为对于 <span class="math inline">\(x\)</span> 的所有值,<span class="math inline">\(e−x\ge 1−x\)</span>。尽管已证明 Nelson-Allen 估计在小样本中比 Kaplan-Meiser 估计表现更好,但在许多情况下,估计值将非常相似,特别是在较早的生存时间。由于 Kaplan-Meier 估计是经验生存函数的一般形式,因此具有许多值得推荐的地方。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-4" class="example"><strong>示例 2.4 (停用宫内节育器的时间) </strong></span><br></p>
<p>表 2.2 所示的值给出了停用宫内节育器数据的生存函数的 Kaplan-Meier 估计,可用于计算 Nelson-Aalen 估计。这一估计如表 2.3 所示。</p>
<details><summary><font color="#8B2232">表 2.3</font>
</summary><img src="figure/table%202.3.png#center" style="width:80.0%"></details><p><br>
从该表中我们可以看出,Kaplan-Meier 和 Nelson-Aalen 对生存函数的估计相差小于 0.04。然而,当我们在第 <a href="chap2.html#sec2-2">2.2</a> 节中考虑这些估计的精度时,我们发现 0.04 的差异没有实际意义。</p>
</div>
</div>
</div>
</div>
<div id="sec2-2" class="section level2" number="2.2">
<h2>
<span class="header-section-number">2.2</span> 生存函数估计的标准误<a class="anchor" aria-label="anchor" href="#sec2-2"><i class="fas fa-link"></i></a>
</h2>
<p>解释任何量的估计的重要辅助手段是估计的精度,这反映在估计的标准误中。其定义为估计的方差估计的平方根,并且可用于构造感兴趣的量的区间估计。本节给出了生存函数估计的标准误。</p>
<p>由于 Kaplan-Meier 估计是生存函数最重要和最广泛使用的估计,因此本节将详细介绍 <span class="math inline">\(\hat S(t)\)</span> 标准误的推导。这种推导的细节可以在第一次阅读时省略。</p>
<div id="sec2-2-1" class="section level3" number="2.2.1">
<h3>
<span class="header-section-number">2.2.1</span> Kaplan-Meier 估计的标准误<a class="anchor" aria-label="anchor" href="#sec2-2-1"><i class="fas fa-link"></i></a>
</h3>
<p>对于 <span class="math inline">\([t_{(k)},t_{(k+1)})\)</span> 区间中的任何 <span class="math inline">\(t\)</span> 值,生存函数的 Kaplan-Meier 估计可以写为</p>
<p><span class="math display">\[\begin{aligned}\hat{S}(t)=\prod_{j=1}^k\hat{p}_j\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(k=1,2,\cdots,r\)</span>,<span class="math inline">\(\hat p_j=(n_j−d_j)/n_j\)</span> 是个体在开始于 <span class="math inline">\(t_{(j)}\)</span> 的时间区间内生存的概率估计,<span class="math inline">\(j=1,2,\cdots,r\)</span>。取对数</p>
<p><span class="math display">\[\log\hat{S}(t)=\sum_{j=1}^k\log\hat{p}_j\]</span></p>
<p>因此 <span class="math inline">\(\log \hat S(t)\)</span> 的方差由下式给出</p>
<p><span class="math display" id="eq:2-6">\[\begin{equation}
\text{var }\left\{\log\hat{S}(t)\right\}=\sum_{j=1}^k\text{ var }\left\{\log\hat{p}_j\right\}
\tag{2.6}
\end{equation}\]</span></p>
<p>现在,可以假设在开始于 <span class="math inline">\(t_{(j)}\)</span> 的区间中生存的个体数量服从参数为 <span class="math inline">\(n_j\)</span> 和 <span class="math inline">\(p_j\)</span> 的二项分布 (binomial distribution),其中 <span class="math inline">\(p_j\)</span> 是在该区间中生存的真实概率。生存数为 <span class="math inline">\(n_j−d_j\)</span>,利用参数为 <span class="math inline">\(n,p\)</span> 的二项随机变量的方差为 <span class="math inline">\(np(1−p)\)</span> 这一结果,<span class="math inline">\(n_j−d_j\)</span> 的方差由下式给出</p>
<p><span class="math display">\[\text{var}\,\,(n_j-d_j)=n_jp_j(1-p_j)\]</span></p>
<p>由于 <span class="math inline">\(\hat p_j=(n_j-d_j)/n_j\)</span>,<span class="math inline">\(\hat p_j\)</span> 的方差为 <span class="math inline">\(\text{var}\,(n_j-d_j)/n_j^2\)</span>,即 <span class="math inline">\(p_j(1-p_j)/n_j\)</span>。那么 <span class="math inline">\(\hat p_j\)</span> 的方差可估计为</p>
<p><span class="math display" id="eq:2-7">\[\begin{equation}
\hat p_j(1-\hat p_j)/n_j
\tag{2.7}
\end{equation}\]</span></p>
<p>为了获得 <span class="math inline">\(\log \hat p_j\)</span> 的方差,我们需利用随机变量函数近似方差的一般结果。根据这个结果,随机变量 <span class="math inline">\(X\)</span> 的函数 <span class="math inline">\(g(X)\)</span> 的方差由下式给出</p>
<p><span class="math display" id="eq:2-8">\[\begin{equation}
\text{var }\{g(X)\}\approx\left\{\frac{\text{d}g(X)}{\text{d}X}\right\}^2\text{ var}\left(X\right)
\tag{2.8}
\end{equation}\]</span></p>
<p>这称为随机变量函数方差的泰勒级数近似 (Taylor series approximation). 使用式 <a href="chap2.html#eq:2-8">(2.8)</a>,<span class="math inline">\(\log \hat p_j\)</span> 的近似方差为 <span class="math inline">\(\mathrm{var}\left(\hat{p}_j\right)/\hat{p}_j^2\)</span>,再使用式 <a href="chap2.html#eq:2-7">(2.7)</a>,<span class="math inline">\(\log \hat p_j\)</span> 的近似方差为 <span class="math inline">\(\left(1-\hat{p}_j\right)/\left(n_j\hat{p}_j\right)\)</span>,替换 <span class="math inline">\(\hat p_j\)</span> 后简化为</p>
<p><span class="math display" id="eq:2-9">\[\begin{equation}
\frac{d_j}{n_j(n_j-d_j)}
\tag{2.9}
\end{equation}\]</span></p>
<p>那么,根据式 <a href="chap2.html#eq:2-6">(2.6)</a></p>
<p><span class="math display" id="eq:2-10">\[\begin{equation}
\text{var }\left\{\log\hat{S}(t)\right\}\approx\sum_{j=1}^k\frac{d_j}{n_j(n_j-d_j)}
\tag{2.10}
\end{equation}\]</span></p>
<p>再次应用式 <a href="chap2.html#eq:2-8">(2.8)</a> 中的结果,给出</p>
<p><span class="math display">\[\text{var }\left\{\log\hat{S}(t)\right\}\approx\frac{1}{[\hat{S}(t)]^2}\text{var }\left\{\hat{S}(t)\right\}\]</span></p>
<p>因此</p>
<p><span class="math display" id="eq:2-11">\[\begin{equation}
\text{var }\left\{\hat{S}(t)\right\}\approx[\hat{S}(t)]^2\sum_{j=1}^k\frac{d_j}{n_j(n_j-d_j)}
\tag{2.11}
\end{equation}\]</span></p>
<p>最后,生存函数的 Kaplan-Meier 估计的标准误,定义为估计的方差估计的平方根,由下式给出</p>
<p><span class="math display" id="eq:2-12">\[\begin{equation}
\text{se }\left\{\hat{S}(t)\right\}\approx\hat{S}(t)\left\{\sum_{j=1}^k\frac{d_j}{n_j(n_j-d_j)}\right\}^{\frac{1}{2}}
\tag{2.12}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(t_{(k)}\le t<t_{(k+1)}\)</span>。这个结果称为 <strong>Greenwood 公式</strong>。</p>
<p>如果没有删失生存时间,则 <span class="math inline">\(n_j-d_j=n_{j+1}\)</span>,式 <a href="chap2.html#eq:2-9">(2.9)</a> 成为 <span class="math inline">\((n_j-n_{j+1})/n_jn_{j+1}\)</span>。现在</p>
<p><span class="math display">\[\begin{aligned}\sum_{j=1}^k\frac{n_j-n_{j+1}}{n_jn_{j+1}}&=\sum_{j=1}^k\left(\frac{1}{n_{j+1}}-\frac{1}{n_j}\right)=\frac{n_1-n_{k+1}}{n_1n_{k+1}}\end{aligned}\]</span></p>
<p>在无删失时,对于 <span class="math inline">\(t_{(k)}\le t<t_{(k+1)},k=1,2,\cdots,r-1\)</span> 有 <span class="math inline">\(\hat S(t)=n_{k+1}/n_1\)</span>,因此上式可写作</p>
<p><span class="math display">\[\frac{1-\hat S(t)}{n_1\hat S(t)}\]</span></p>
<p>因此,根据式 <a href="chap2.html#eq:2-11">(2.11)</a>,<span class="math inline">\(\hat S(t)\)</span> 的方差估计为 <span class="math inline">\(\hat{S}(t)[1-\hat{S}(t)]/n_1\)</span>。这是式 <a href="chap2.html#eq:2-1">(2.1)</a> 中给出的经验生存函数方差的估计,其假设在时间 <span class="math inline">\(t\)</span> 处于风险中的个体数量服从参数为 <span class="math inline">\(n_1,S(t)\)</span> 的二项分布。</p>
</div>
<div id="sec2-2-2" class="section level3" number="2.2.2">
<h3>
<span class="header-section-number">2.2.2</span> 其他估计的标准误<a class="anchor" aria-label="anchor" href="#sec2-2-2"><i class="fas fa-link"></i></a>
</h3>
<p>生存函数的生命表估计在形式上类似于 Kaplan-Meier 估计,因此该估计的标准误是以类似的方式获得的。沿用 <a href="chap2.html#sec2-1-1">2.1.1</a> 节的记号,生命表估计的标准误由下式给出</p>
<p><span class="math display">\[\text{se }\left\{S^*(t)\right\}\approx S^*(t)\left\{\sum_{j=1}^k\frac{d_j}{n_j^\prime(n_j^\prime-d_j)}\right\}^{\frac{1}{2}}\]</span></p>
<p>Nelson-Aalen 估计的标准误为</p>
<p><span class="math display">\[\text{se }\left\{\tilde{S}(t)\right\}\approx\tilde{S}(t)\left\{\sum_{j=1}^k\frac{d_j}{n_j^2}\right\}^{\frac12}\]</span></p>
<p>但也存在其他表达式。</p>
</div>
<div id="sec2-2-3" class="section level3" number="2.2.3">
<h3>
<span class="header-section-number">2.2.3</span> 生存函数的置信区间<a class="anchor" aria-label="anchor" href="#sec2-2-3"><i class="fas fa-link"></i></a>
</h3>
<p>一旦计算出生存函数的标准误估计,就可以找到生存函数在给定时间 <span class="math inline">\(t\)</span> 处的置信区间。置信区间是生存函数的区间估计,其以预设的概率包含真实生存函数值。以这种方式构建的区间有时称为<strong>逐点置信区间</strong> (pointwise confidence intervals),因为它们适用于特定的生存时间。</p>
<p>通过在给定时间 <span class="math inline">\(t\)</span> 假设生存函数的估计服从均值为 <span class="math inline">\(S(t)\)</span>,方差由式 <a href="chap2.html#eq:2-11">(2.11)</a> 给出的正态分布,我们可以获得生存函数在 <span class="math inline">\(t\)</span> 时刻真实值的置信区间。该区间是根据标准正态分布的百分位点计算得出的。因此,如果 <span class="math inline">\(Z\)</span> 是一个具有标准正态分布的随机变量,则该分布的上(单侧)<span class="math inline">\(\alpha/2\)</span> 分位点或双侧 <span class="math inline">\(\alpha\)</span> 分位点为 <span class="math inline">\(z_{\alpha/2}\)</span>,满足 <span class="math inline">\(\text P(Z>z_{\alpha/2})=\alpha/2\)</span>。该概率是标准正态曲线在下 <span class="math inline">\(z_{\alpha/2}\)</span> 右侧的面积,如图 2.5 所示。例如,标准正态分布的双侧 5% 和 1% 分位点 <span class="math inline">\(z_{0.025}\)</span> 和 <span class="math inline">\(z_{0.005}\)</span> 分别为 1.96 和 2.58.</p>
<details><summary><font color="#8B2232">图 2.5</font>
</summary><img src="figure/figure%202.5.png#center" style="width:80.0%"></details><p><br>
对于给定的 <span class="math inline">\(t\)</span> 值,<span class="math inline">\(S(t)\)</span> 的 <span class="math inline">\(100(1−\alpha)\%\)</span> 置信区间为 <span class="math inline">\(\left[\hat S(t)-z_{\alpha/2}\,\text{se}\,\{\hat S(t)\},\,\,\hat S(t)+z_{\alpha/2}\,\text{se}\,\{\hat S(t)\}\right]\)</span>,其中,<span class="math inline">\(\text{se}\,\{\hat S(t)\}\)</span> 可根据式 <a href="chap2.html#eq:2-12">(2.12)</a> 得出。<span class="math inline">\(S(t)\)</span> 的这些区间可以叠加在生存函数估计的图中,如<a href="chap2.html#exm:ex2-5">示例 2.5</a> 所示。</p>
<p>该方法的问题在于其置信区间是对称的。当生存函数估计接近 0 或 1 时,对称区间是不合适的,因为它们可能导致生存函数的置信区间超出 (0, 1) 区间。一个务实的解决方案是将任何大于 1 的上限替换为 1.0,将任何小于 0 的下限替换为 0.0.</p>
<p>另一种方法是先将 <span class="math inline">\(\hat S(t)\)</span> 转换为 <span class="math inline">\((−\infty, \infty)\)</span> 范围内的一个值,然后为转换后的值获得一个置信区间。接着,将得到的置信区间反向转换,以给出 <span class="math inline">\(S(t)\)</span> 本身的置信区间。可能的转换方法包括 logistic 转换,即 <span class="math inline">\(\log[S(t)/\{1 − S(t)\}]\)</span>,以及互补双对数 (complementary log-log) 转换,即 <span class="math inline">\(\log\{− \log S(t)\}\)</span>。注意到,根据式 <a href="chap1.html#eq:1-8">(1.8)</a>,后一个量是累积风险函数的对数。在任何情况下,都可以使用式 <a href="chap2.html#eq:2-8">(2.8)</a> 中的近似来获得 <span class="math inline">\(\hat S(t)\)</span> 转换值的标准误。</p>
<p>例如,<span class="math inline">\(\log\{-\log\hat{S}(t)\}\)</span> 的方差是从式 <a href="chap2.html#eq:2-10">(2.10)</a> 中 <span class="math inline">\(\text{var}\left\{\log\hat{S}(t)\right\}\)</span> 的表达式获得的。使用式 <a href="chap2.html#eq:2-8">(2.8)</a> 中的一般结果,</p>
<p><span class="math display">\[\mathrm{var}\left\{\log(-X)\right\}\approx\frac1{X^2}\operatorname{var}\left(X\right)\]</span></p>
<p>令 <span class="math inline">\(X=\log\hat{S}(t)\)</span> 得到</p>
<p><span class="math display">\[\begin{aligned}\text{var }\left[\log\{-\log\hat{S}(t)\}\right]\approx\frac1{\{\log\hat{S}(t)\}^2}\sum_{j=1}^k\frac{d_j}{n_j(n_j-d_j)}\end{aligned}\]</span></p>
<p><span class="math inline">\(\log\{-\log\hat{S}(t)\}\)</span> 的标准误为此量的平方根,得到如下形式的 <span class="math inline">\(100(1 − \alpha)\%\)</span> 置信限</p>
<p><span class="math display">\[\hat{S}(t)^{\exp[\pm z_{\alpha/2}\operatorname{se}\{\log[-\log\hat{S}(t)]\}]}\]</span></p>
<p>其中 <span class="math inline">\(z_{\alpha/2}\)</span> 是标准正态分布的上 <span class="math inline">\(\alpha/2\)</span> 分位点。</p>
<p>进一步的问题是,在生存时间分布的尾部,即当 <span class="math inline">\(\hat S(t)\)</span> 接近于 0 或 1 时,使用 Greenwood 公式获得的 <span class="math inline">\(\hat S(t)\)</span> 的方差可能会低估实际方差。在这些情况下,可以使用 <span class="math inline">\(\hat S(t)\)</span> 标准误的替代表达式。Peto et al. (1977) 提出 <span class="math inline">\(\hat S(t)\)</span> 的标准误应根据下式获得</p>
<p><span class="math display">\[\text{se}\left\{\hat{S}(t)\right\}=\frac{\hat{S}(t)√\{1-\hat{S}(t)\}}{√(n_k)}\]</span></p>
<p>其中 <span class="math inline">\(t_{(k)}\leqslant t<t_{(k+1)},k=1,2,\ldots,r,\hat S(t)\)</span> 为 <span class="math inline">\(S(t)\)</span> 的 Kaplan-Meier 估计,<span class="math inline">\(n_k\)</span> 为在 <span class="math inline">\(t_{(k)}\)</span> 处于风险的个体数,<span class="math inline">\(t_{(k)}\)</span> 为第 <span class="math inline">\(k\)</span> 个构造区间的起点。</p>
<p><span class="math inline">\(\hat S(t)\)</span> 标准误的这种表达式是保守的,因为获得的标准误往往会大于应有的值。因此,建议一般使用 Greenwood 估计。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-5" class="example"><strong>示例 2.5 (停用宫内节育器的时间) </strong></span><br></p>
<p>表 2.4 给出了例 1.1 中关于停用宫内节育器时间数据的生存函数估计的标准误以及该函数相应真值的 95% 置信限。在此表中,位于范围 (0, 1) 之外的置信限已替换为 0 或 1.</p>
<details><summary><font color="#8B2232">表 2.4</font>
</summary><img src="figure/table%202.4.png#center" style="width:80.0%"></details><p><br>
从该表中我们可以看出,一般来说,生存函数估计的标准误随着停止时间的增加而增加。这是因为晚期生存函数是基于较少个体来估计的。图 2.6 给出了生存函数估计图,其中 95% 置信限显示为虚线。</p>
<details><summary><font color="#8B2232">图 2.6</font>
</summary><img src="figure/figure%202.6.png#center" style="width:80.0%"></details>
</div>
</div>
<p>需要注意的是,图 2.6 中所示生存函数的置信限仅对给定时间有效。需要不同的方法来生成置信带 (confidence bands),使得生存函数对于所有 <span class="math inline">\(t\)</span> 值以给定概率(例如 0.95)包含在带中。这些置信带通常会比由逐点置信限形成的带更宽。不再赘述细节,但本章最后一节会给出这些方法的参考文献。还要注意,这些区间的宽度远大于生存函数的 Kaplan-Meier 和 Nelson-Aalen 估计之间的差异,如表 2.2 和 2.3 所示。基于生命表和生存函数 Nelson-Aalen 估计的置信限可通过类似计算获得。</p>
</div>
</div>
<div id="sec2-3" class="section level2" number="2.3">
<h2>
<span class="header-section-number">2.3</span> 估计风险函数<a class="anchor" aria-label="anchor" href="#sec2-3"><i class="fas fa-link"></i></a>
</h2>
<p>单个生存数据样本也可使用风险函数进行总结,该函数显示了瞬时死亡风险与时间之间的依赖关系。有多种方法可以估计该函数,本节将描述其中的两种方法。</p>
<div id="sec2-3-1" class="section level3" number="2.3.1">
<h3>
<span class="header-section-number">2.3.1</span> 风险函数的生命表估计<a class="anchor" aria-label="anchor" href="#sec2-3-1"><i class="fas fa-link"></i></a>
</h3>
<p>假设生存时间已被划分成一系列 <span class="math inline">\(m\)</span> 个区间,就像在构建生存函数生命表估计时那样。在每个区间内,单位时间内平均死亡风险合适的估计是该区间内死亡人数除以该区间内平均生存时间。后者是区间内平均风险人数的乘积,再乘以区间的长度。设第 <span class="math inline">\(j\)</span> 个时间区间内的死亡人数为 <span class="math inline">\(d_j,j=1,2,\cdots,m\)</span>,并假设 <span class="math inline">\(n^\prime_j\)</span> 是该时间区间内面临死亡风险的平均人数,其中 <span class="math inline">\(n^\prime_j\)</span> 由式 <a href="chap2.html#eq:2-2">(2.2)</a> 给出。假设第 <span class="math inline">\(j\)</span> 个时间区间内死亡率恒定,则该时间区间内的平均生存时间为 <span class="math inline">\((n^\prime_j-d_j/2)\tau_j\)</span>,其中 <span class="math inline">\(\tau_j\)</span> 是第 <span class="math inline">\(j\)</span> 个时间区间的长度。第 <span class="math inline">\(j\)</span> 个时间区间内风险函数的生命表估计由下式给出</p>
<p><span class="math display">\[\begin{aligned}h^*(t)&=\frac{d_j}{(n_j^\prime-d_j/2)\tau_j}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t'_{j-1}\leqslant t<t'_j,j=1,2,\ldots,m\)</span>,因此 <span class="math inline">\(h^*(t)\)</span> 是阶跃函数。</p>
<p>Gehan (1969) 表明该估计的渐近标准误为</p>
<p><span class="math display">\[\begin{aligned}\text{se}\left\{h^*(t)\right\}&=\frac{h^*(t)\surd\{1-[h^*(t)\tau_j/2]^2\}}{\surd(d_j)}\end{aligned}\]</span></p>
<p><span class="math inline">\(m\)</span> 个时间区间中每个时间区间内相应真实风险的置信区间可以按照 <a href="chap2.html#sec2-2-3">2.2.3</a> 节中描述的方式获得。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-6" class="example"><strong>示例 2.6 (多发性骨髓瘤患者的生存) </strong></span><br></p>
<p>表 2.1 给出了<a href="chap1.html#exm:ex1-3">示例 1.3</a> 中 48 名多发性骨髓瘤患者生存时间数据生存函数的生命表估计。使用与<a href="chap2.html#exm:ex2-2">示例 2.2</a> 中相同的时间区间,表 2.5 中给出了风险函数生命表估计的计算结果。</p>
<details><summary><font color="#8B2232">表 2.5</font>
</summary><img src="figure/table%202.5.png#center" style="width:80.0%"></details><p><br>
风险函数估计如图 2.7 所示,为阶跃函数。一般的模式是,在确诊后的头两年内,风险大致保持不变,之后风险会下降,然后逐渐增加。然而,在解释这一估计时需要谨慎,因为确诊两年后很少有人死亡。</p>
<details><summary><font color="#8B2232">图 2.7</font>
</summary><img src="figure/figure%202.7.png#center" style="width:80.0%"></details>
</div>
</div>
</div>
<div id="sec2-3-2" class="section level3" number="2.3.2">
<h3>
<span class="header-section-number">2.3.2</span> Kaplan-Meier 型估计<a class="anchor" aria-label="anchor" href="#sec2-3-2"><i class="fas fa-link"></i></a>
</h3>
<p>对于未分组的生存数据,估计风险函数的一种自然方法是,将给定死亡时间的死亡人数与该时间点处于风险的人数之比作为风险函数的估计。如果假设相邻死亡时间之间的风险函数是恒定的,那么可进一步通过将风险值除以时间区间的长度来找到单位时间的风险。因此,如果在第 <span class="math inline">\(j\)</span> 个死亡时间 <span class="math inline">\(t_{(j)}\)</span> 有 <span class="math inline">\(d_j\)</span> 人死亡,<span class="math inline">\(j=1,2,...,r\)</span>,且在时间 <span class="math inline">\(t_{(j)}\)</span> 处于风险的人数为 <span class="math inline">\(n_j\)</span>,那么区间 <span class="math inline">\([t_j,t_{(j+1)})\)</span> 内的风险函数的估计为:</p>
<p><span class="math display" id="eq:2-13">\[\begin{equation}
\hat{h}(t)=\frac{d_j}{n_j\tau_j}
\tag{2.13}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(t_j\le t<t_{(j+1)},\tau_j=t_{(j+1)}-t_j\)</span>。请注意,无法使用式 <a href="chap2.html#eq:2-13">(2.13)</a> 来估计以最终死亡时间为起点的区间的风险,因为该区间是开的 (open-ended)。</p>
<p>式 <a href="chap2.html#eq:2-13">(2.13)</a> 中的估计称为 Kaplan-Meier 型估计,因为从中得出的生存函数估计为 Kaplan-Meier 估计。为了证明这一点,请注意,由于 <span class="math inline">\(\hat{h}(t),t_{(j)}\leqslant t<t_{(j+1)}\)</span> 是对第 <span class="math inline">\(j\)</span> 个区间中每单位时间的死亡风险的估计,因此该区间中的死亡概率为 <span class="math inline">\(\hat{h}(t)\tau_j\)</span>,即 <span class="math inline">\(d_j/n_j\)</span>。因此,该区间中相应生存概率的估计为 <span class="math inline">\(1−(d_j/n_j)\)</span>,生存函数估计如式 <a href="chap2.html#eq:2-4">(2.4)</a> 所示。</p>
<p>可以根据 <span class="math inline">\(d_j\)</span> 的方差得到 <span class="math inline">\(\hat h(t)\)</span> 的近似标准误,根据 <a href="chap2.html#sec2-2-1">2.2.1</a> 节,可以假设 <span class="math inline">\(d_j\)</span> 服从参数为 <span class="math inline">\(n_j,p_j\)</span> 的二项分布,其中 <span class="math inline">\(p_j\)</span> 是长度为 <span class="math inline">\(\tau\)</span> 的区间内的死亡概率。因此 <span class="math inline">\(\text{var}\left(d_j\right)=n_jp_j\left(1-p_j\right)\)</span>,使用 <span class="math inline">\(d_j/n_j\)</span> 估计 <span class="math inline">\(p_j\)</span>,从而给出</p>
<p><span class="math display">\[\text{se}\left\{\hat{h}(t)\right\}=\hat{h}(t)\sqrt{\frac{n_j-d_j}{n_jd_j}}\]</span></p>
<p>然而当 <span class="math inline">\(d_j\)</span> 很小时,使用该标准误构建的置信区间太宽,实际无法使用。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-7" class="example"><strong>示例 2.7 (停用宫内节育器的时间) </strong></span><br></p>
<p>再次考虑<a href="chap1.html#exm:ex1-1">示例 1.1</a> 中给出的 18 名妇女停用宫内节育器的时间数据。表 2.2 给出了这些数据的生存函数的 Kaplan-Meier 估计,表 2.6 给出了根据式 <a href="chap2.html#eq:2-13">(2.13)</a> 计算的风险函数的相应 Kaplan-Meier 型估计。还给出了 <span class="math inline">\(\hat h(t)\)</span> 的近似标准误。</p>
<details><summary><font color="#8B2232">表 2.6</font>
</summary><img src="figure/table%202.6.png#center" style="width:80.0%"></details><p><br>
图 2.8 显示了风险函数估计图。从这个图像来看,有一些证据表明,宫内节育器使用的时间越长,停用的风险就越大,但情况并不十分清楚。风险函数估计在不同时间的近似标准误对解释该图几乎没有帮助。</p>
<details><summary><font color="#8B2232">图 2.8</font>
</summary><img src="figure/figure%202.8.png#center" style="width:80.0%"></details>
</div>
</div>
<p>在实践中,通过这种方式获得的风险函数估计往往会相当不规则。因此,可以对风险函数图进行“平滑” (smoothed) 处理,以便更清楚地看到任何模式。有多种方法可以平滑风险函数,这些方法会得到在 <span class="math inline">\(t\)</span> 邻域内的死亡时间点上估计风险函数 <span class="math inline">\(\hat h(t)\)</span> 的加权平均值。例如,基于 <span class="math inline">\(r\)</span> 个有序的死亡时间 <span class="math inline">\(t_{(1)}, t_{(2)},...,t_{(r)}\)</span>,在时间 <span class="math inline">\(t_{(j)}\)</span> 有 <span class="math inline">\(d_j\)</span> 人死亡以及 <span class="math inline">\(n_j\)</span> 人处于风险中,可以通过以下方式找到基于核函数平滑的风险函数估计:</p>
<p><span class="math display">\[h^\dagger(t)=b^{-1}\sum_{j=1}^r0.75\left\{1-\left(\frac{t-t_{(j)}}{b}\right)^2\right\}\frac{d_j}{n_j}\]</span></p>
<p>其中 <span class="math inline">\(b\)</span> 的值需要选择。函数 <span class="math inline">\(h^\dagger (t)\)</span> 定义在从 <span class="math inline">\(b\)</span> 到 <span class="math inline">\(t_{(r)}−b\)</span> 区间所有的 <span class="math inline">\(t\)</span> 值上,其中 <span class="math inline">\(t_{(r)}\)</span> 是最大的死亡时间。对于这个区间内的任何 <span class="math inline">\(t\)</span> 值,区间 <span class="math inline">\((t−b,t+b)\)</span> 内的死亡时间都会对该加权平均值有所贡献。参数 <span class="math inline">\(b\)</span> 称为<strong>带宽</strong> (bandwidth),其值控制着图形的形状;<span class="math inline">\(b\)</span> 的值越大,平滑程度就越高。有公式可以导出“最优”的 <span class="math inline">\(b\)</span> 值,但这些公式往往相当繁琐。有关详情可以在本章最后一节提供的参考文献中找到。在本书中,我们提倡使用建模方法分析生存数据,因此,后续章节将考虑基于模型的风险函数估计。</p>
</div>
<div id="sec2-3-3" class="section level3" number="2.3.3">
<h3>
<span class="header-section-number">2.3.3</span> 估计累积风险函数<a class="anchor" aria-label="anchor" href="#sec2-3-3"><i class="fas fa-link"></i></a>
</h3>
<p>如第 1 章 <a href="chap1.html#sec1-4-3">1.4.3</a> 节所述,根据在给定时间内发生的预期事件数对累积风险函数进行解释,该函数在识别生存数据模型方面很重要,这将在 <a href="chap4.html#sec4-4">4.4</a> 节和 <a href="chap5.html#sec5-2">5.2</a> 节中看到。此外,由于累积风险函数的导数是风险函数本身,因此累积风险函数斜率提供了有关潜在风险函数形状的信息。例如,在某个时间区间内的线性累积风险函数表明,风险在该时间区间内是恒定的。现在描述可用于估计该函数的方法。</p>
<p>时间 <span class="math inline">\(t\)</span> 的累积风险 <span class="math inline">\(H(t)\)</span> 在式 <a href="chap1.html#eq:1-7">(1.7)</a> 中定义为风险函数的积分,但使用式 <a href="chap1.html#eq:1-8">(1.8)</a> 来求解更为简便。根据这一结果,我们有 <span class="math inline">\(H(t) = -\log S(t)\)</span>,其中 <span class="math inline">\(S(t)\)</span> 表示生存函数,即在时间 <span class="math inline">\(t\)</span> 仍然生存的概率。</p>
<p>现在使用式 <a href="chap2.html#eq:2-4">(2.4)</a></p>
<p><span class="math display">\[\begin{aligned}\hat{H}(t)&=-\sum_{j=1}^k\log\left(\frac{n_j-d_j}{n_j}\right)\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t_{(k)}\leqslant t<t_{(k+1)},k=1,2,\ldots,r\)</span> 且 <span class="math inline">\(t_{(1)},t_{(2)},\ldots,t_{(r)}\)</span> 为 <span class="math inline">\(t\)</span> 个有序的死亡时间且 <span class="math inline">\(t_{(r+1)}=\infty\)</span>。</p>
<p>若使用风险函数的 Nelson-Aalen 估计,则累积风险函数估计 <span class="math inline">\(\tilde{H}(t)=-\log\tilde{S}(t)\)</span> 由下式给出</p>
<p><span class="math display">\[\begin{aligned}\tilde{H}(t)=\sum_{j=1}^k\frac{d_j}{n_j}\end{aligned}\]</span></p>
<p>这是从第一个时间区间到第 <span class="math inline">\(k\)</span> 个时间区间的死亡概率估计的累积和,<span class="math inline">\(k=1,2,\ldots r\)</span>。 因此,这个量作为累积风险的估计是直观的。</p>
<p>如果数据中最长的生存时间是右删失的,则生存函数的 Kaplan-Meier 估计在该时间之后为 0,并且无法确定 <span class="math inline">\(\hat{H}(t)=-\operatorname{log}\hat{S}(t)\)</span> 的值。然而,当使用 Nelson-Aalen 估计 <span class="math inline">\(\tilde H(t)\)</span> 时,可以在最晚的事件时间估计累积风险函数。</p>
<p>对累积风险函数的估计也可以推导出相应风险函数的估计,因为将估计的累积风险函数相邻值之差除以时间区间长度后,就能得到风险估计。具体来说,Nelson-Aalen 累积风险估计相邻值之差可以直接推导出 <a href="chap2.html#sec2-3-2">2.3.2</a> 节中风险函数的估计。</p>
</div>
</div>
<div id="sec2-4" class="section level2" number="2.4">
<h2>
<span class="header-section-number">2.4</span> 估计生存时间的中位数和百分位数<a class="anchor" aria-label="anchor" href="#sec2-4"><i class="fas fa-link"></i></a>
</h2>
<p>由于生存时间的分布往往呈正偏态,因此中位数是分布位置首选的总结性度量。一旦估计了生存函数,就可以直接获得中位生存时间的估计。这是所研究总体中 50% 的个体预期生存的时间,由值 <span class="math inline">\(t{(50)}\)</span> 给出,即 <span class="math inline">\(S\{t(50)\} = 0.5\)</span>。</p>
<p>因为 <span class="math inline">\(S(t)\)</span> 的非参数估计是阶跃函数,所以通常无法得到使生存函数恰好等于 0.5 的生存时间估计。相反,中位生存时间估计 <span class="math inline">\(\hat t (50)\)</span> 定义为生存函数估计小于 0.5 的最小观测生存时间。</p>
<p>在数学形式上</p>
<p><span class="math display">\[\begin{aligned}\hat{t}(50)=\min\{t_i\mid\hat{S}(t_i)<0.5\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t_i\)</span> 是第 <span class="math inline">\(i\)</span> 个个体的生存时间,<span class="math inline">\(i=1,2,\ldots,n\)</span>。由于生存函数估计只在死亡时发生变化,这相当于定义</p>
<p><span class="math display">\[\begin{aligned}\hat{t}(50)=\min\{t_{(j)}\mid\hat{S}(t_{(j)})<0.5\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t_{(j)}\)</span> 为第 <span class="math inline">\(j\)</span> 个死亡时间,<span class="math inline">\(j=1,2,\ldots,r\)</span>。</p>
<p>在特定情况下,当生存函数估计在 <span class="math inline">\(t_{(j)}\)</span> 到 <span class="math inline">\(t_{(j+1)}\)</span> 的区间内的值恰好等于 0.5 时,中位数取该区间的中点,即 <span class="math inline">\((t_{(j)} + t_{(j+1)})/2\)</span>。当不存在删失生存时间时,中位生存时间估计将是样本中超过 50% 的个体能够生存的最短时间。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-8" class="example"><strong>示例 2.8 (停用宫内节育器的时间) </strong></span><br></p>
<p>表 2.2 中给出了<a href="chap1.html#exm:ex1-1">示例 1.1</a> 中关于停用宫内节育器时间数据生存函数的 Kaplan-Meier 估计。这些数据的生存函数估计,<span class="math inline">\(\hat S(t)\)</span>,示于图 2.4 中。根据生存函数估计,停用概率估计小于 0.5 的最小停用时间为 93 周。因此,这是该研究中停用宫内节育器的中位时间估计。</p>
<details><summary><font color="#8B2232">图 2.4</font>
</summary><img src="figure/figure%202.4.png#center" style="width:80.0%"></details>
</div>
</div>
<p>可以使用与上述描述类似的方法来估计生存时间分布的其他百分位数。生存时间分布的第 <span class="math inline">\(p\)</span> 个百分位数定义为值 <span class="math inline">\(t(p)\)</span>,使得对于 0 到 100 之间的任何 <span class="math inline">\(p\)</span> 值有 <span class="math inline">\(F\{t(p)\} = p/100\)</span>。就生存函数而言,<span class="math inline">\(t(p)\)</span> 是使得 <span class="math inline">\(S\{t(p)\} = 1 − (p/100)\)</span> 的值,因此第 10 和第 90 百分位数由下式给出:</p>
<p><span class="math display">\[\begin{aligned}S\{t(10)\}=0.9,\quad S\{t(90)\}=0.1\end{aligned}\]</span></p>
<p>利用生存函数估计,第 <span class="math inline">\(p\)</span> 个百分位数的估计是最小的观测生存时间 <span class="math inline">\(\hat t (p)\)</span>,其满足 <span class="math inline">\(\hat S\{\hat t(p)\} < 1 − (p/100)\)</span>。</p>
<p>有时,对于所有的 <span class="math inline">\(t\)</span> 值,生存函数估计都大于 0.5,此时无法估计中位生存时间,因此自然会用生存时间分布的其他百分位数或特定时间点的生存概率估计来总结数据。</p>
<p>生存数据样本离散 (dispersion) 的估计并未广泛使用,但若需要这样的估计,则可以计算半四分位距 (semi-interquartile range, SIQR)。这定义为生存时间分布的第 75 百分位数和第 25 百分位数之差的一半。即</p>
<p><span class="math display">\[\begin{aligned}SIQR=\frac{1}{2}\left\{t(75)-t(25)\right\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t(25)\)</span> 和 <span class="math inline">\(t(75)\)</span> 是生存时间分布的第 25 个和第 75 个百分位数。这两个百分位数也分别称为第一个和第三个四分位数。相应的基于样本的 <span class="math inline">\(SIQR\)</span> 估计为 <span class="math inline">\(\{\hat{t}(75)-\hat{t}(25)\}/2\)</span>。与方差一样,<span class="math inline">\(SIQR\)</span> 值越大,生存时间分布离散程度越大。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-9" class="example"><strong>示例 2.9 (停用宫内节育器的时间) </strong></span><br></p>
<p>根据表 2.2 中给出的<a href="chap1.html#exm:ex1-1">示例 1.1</a> 数据生存函数的 Kaplan-Meier 估计,停止时间分布的第 25 和第 75 百分位数分别为 36 周和 107 周。因此,分布的 <span class="math inline">\(SIQR\)</span> 估计为 35.5 周。</p>
<details><summary><font color="#8B2232">表 2.2</font>
</summary><img src="figure/table%202.2.png#center" style="width:80.0%"></details>
</div>
</div>
</div>
<div id="sec2-5" class="section level2" number="2.5">
<h2>
<span class="header-section-number">2.5</span> 中位数和百分位数的置信区间<a class="anchor" aria-label="anchor" href="#sec2-5"><i class="fas fa-link"></i></a>
</h2>
<p>一旦获得百分位数估计的方差,就可以得到生存时间分布的中位数和其他百分位数的近似置信区间。百分位数近似方差的表达式可以通过直接应用式 <a href="chap2.html#eq:2-8">(2.8)</a> 中随机变量函数方差的一般结果来导出。使用这个结果</p>
<p><span class="math display" id="eq:2-14">\[\begin{equation}
\mathrm{var}\left[\hat{S}\{t(p)\}\right]=\left(\frac{\mathrm{d}\hat{S}\{t(p)\}}{\mathrm{d}t(p)}\right)^2\mathrm{var}\left\{t(p)\right\}
\tag{2.14}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(t(p)\)</span> 是分布的第 <span class="math inline">\(p\)</span> 个百分位数,<span class="math inline">\(\hat{S}\{t(p)\}\)</span> 是生存函数在 <span class="math inline">\(t(p)\)</span> 处的 Kaplan-Meier 估计。现在</p>
<p><span class="math display">\[-\frac{\mathrm{d}\hat{S}\{t(p)\}}{\mathrm{d}t(p)}=\hat{f}\{t(p)\}\]</span></p>
<p>为 <span class="math inline">\(t(p)\)</span> 时生存时间的概率密度函数的估计,将其代入式 <a href="chap2.html#eq:2-14">(2.14)</a> 并整理后,我们得到</p>
<p><span class="math display">\[\mathrm{var}\left\{t(p)\right\}=\left(\frac1{\hat{f}\{t(p)\}}\right)^2\mathrm{var}\left[\hat{S}\{t(p)\}\right]\]</span></p>
<p>因此,估计的第 <span class="math inline">\(p\)</span> 个百分位数 <span class="math inline">\(\hat t(p)\)</span> 的标准误由下式给出</p>
<p><span class="math display" id="eq:2-15">\[\begin{equation}
\mathrm{se}\left\{\hat{t}(p)\right\}=\frac1{\hat{f}\{\hat{t}(p)\}}\operatorname{se}\left[\hat{S}\{\hat{t}(p)\}\right]
\tag{2.15}
\end{equation}\]</span></p>
<p>使用式 <a href="chap2.html#eq:2-12">(2.12)</a> 中给出的生存函数 Kaplan-Meier 估计的标准误的 Greenwood 公式,可以得到 <span class="math inline">\(\hat{S}\{t(p)\}\)</span> 的标准误,而 <span class="math inline">\(\hat t(p)\)</span> 的概率密度函数的估计为</p>
<p><span class="math display">\[\hat{f}\{\hat{t}(p)\}=\frac{\hat{S}\{\hat{u}(p)\}-\hat{S}\{\hat{l}(p)\}}{\hat{l}(p)-\hat{u}(p)}\]</span></p>
<p>其中</p>
<p><span class="math display">\[\begin{aligned}\hat{u}(p)&=\max\left\{t_{(j)}\mid\hat{S}(t_{(j)})\geqslant1-\frac p{100}+\epsilon\right\}\\\hat{l}(p)&=\min\left\{t_{(j)}\mid\hat{S}(t_{(j)})\leqslant1-\frac p{100}-\epsilon\right\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(j=1,2,\ldots,r\)</span> 和较小的 <span class="math inline">\(\varepsilon\)</span> 值。在许多情况下,取 <span class="math inline">\(\varepsilon=0.05\)</span> 可满足要求,但如果事实证明 <span class="math inline">\(\hat u(p)\)</span> 和 <span class="math inline">\(\hat l(p)\)</span> 相等,则需要更大的 <span class="math inline">\(\varepsilon\)</span> 值。特别地,根据式 <a href="chap2.html#eq:2-15">(2.15)</a>,中位生存时间的标准误由下式给出</p>
<p><span class="math display" id="eq:2-16">\[\begin{equation}
\operatorname{se}\left\{\hat{t}(50)\right\}=\frac1{\hat{f}\{\hat{t}(50)\}}\operatorname{se}\left[\hat{S}\{\hat{t}(50)\}\right]
\tag{2.16}
\end{equation}\]</span></p>
<p>其中 <span class="math inline">\(\hat{f}\{\hat{t}(50)\}\)</span> 为</p>
<p><span class="math display" id="eq:2-17">\[\begin{equation}
\hat{f}\{\hat{t}(50)\}=\frac{\hat{S}\{\hat{u}(50)\}-\hat{S}\{\hat{l}(50)\}}{\hat{l}(50)-\hat{u}(50)}
\tag{2.17}
\end{equation}\]</span></p>
<p>在此表达式中,<span class="math inline">\(\hat u(50)\)</span> 是生存函数的 Kaplan-Meier 估计超过 0.55 的最大生存时间,<span class="math inline">\(\hat l(50)\)</span> 是生存函数小于等于 0.45 的最小生存时间。</p>
<p>一旦得到第 <span class="math inline">\(p\)</span> 个百分位数的标准误估计,<span class="math inline">\(t(p)\)</span> 的 <span class="math inline">\(100(1 − \alpha)\%\)</span> 置信限为</p>
<p><span class="math display">\[\begin{aligned}\hat{t}(p)\pm z_{\alpha/2}\text{se}\{\hat{t}(p)\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(z_{\alpha/2}\)</span> 是标准正态分布的上(单侧)<span class="math inline">\(\alpha/2\)</span> 分位点。</p>
<p>此区间估计只是近似值,因为该区间包含真实百分位数的概率不会恰好为 <span class="math inline">\(1 − \alpha\)</span>。虽然有许多其他方法来构建具有优良特性的中位置信区间,但这些方法比本节考虑的区间估计更难计算。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex2-10" class="example"><strong>示例 2.10 (停用宫内节育器的时间) </strong></span><br></p>
<p>使用<a href="chap1.html#exm:ex1-1">示例 1.1</a> 中给出的宫内节育器使用者停用时间的数据来说明中位停用时间置信区间的计算。根据<a href="chap2.html#exm:ex2-8">示例 2.8</a>,该组女性中位停用时间估计为 <span class="math inline">\(\hat t(50) = 93\)</span> 周。另外,从表 2.4 可以看出,此时生存函数的 Kaplan-Meier 估计的标准误为 <span class="math inline">\([\hat{S}\{\hat{t}(50)\}]=0.1452\)</span>。</p>
<p>为了使用式 <a href="chap2.html#eq:2-16">(2.16)</a> 获得 <span class="math inline">\(\hat t(50)\)</span> 的标准误,我们需要估计中位停止时间处的密度函数。这是从式 <a href="chap2.html#eq:2-16">(2.16)</a> 获得的。该方程中所需的量 <span class="math inline">\(\hat u(50),\hat l(50)\)</span> 为:</p>
<p><span class="math display">\[\begin{aligned}\hat{u}(50)&=\max\{t_{(j)}\mid\hat{S}(t_{(j)})\geqslant0.55\}\\\hat{l}(50)&=\min\{t_{(j)}\mid\hat{S}(t_{(j)})\leqslant0.45\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(t_{(j)}\)</span> 为第 <span class="math inline">\(j\)</span> 个停用时间,<span class="math inline">\(j=1,2,\ldots,9\)</span>。使用表 2.4,<span class="math inline">\(\hat u(50)=75,\hat l(50)=97\)</span>,因此</p>
<p><span class="math display">\[\hat{f}\{\hat{t}(50)\}=\frac{\hat{S}(75)-\hat{S}(97)}{97-75}=\frac{0.5594-0.3729}{22}=0.0085\]</span></p>
<p>那么中位数的标准误由下式给出</p>
<p><span class="math display">\[\mathrm{se}\left\{\hat{t}(50)\right\}=\frac1{0.0085}\times0.1452=17.13\]</span></p>
<p>中位停用时间的 95% 置信限为</p>
<p><span class="math display">\[93\pm1.96\times17.13\]</span></p>
<p>因此中位数区间估计范围为 59 到 127 天。</p>