-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchap5.html
1692 lines (1550 loc) · 174 KB
/
chap5.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>第 5 章 参数回归模型 | 医学研究中的生存数据建模</title>
<meta name="author" content="Wang Zhen">
<meta name="description" content="当 Cox 回归模型用于生存数据分析时,不需要假设生存时间特定形式的概率分布。因此,风险函数不局限于特定的函数形式,该模型具有灵活性和广泛的适用性。另一方面,如果特定概率分布的假设对于数据是有效的,基于这种假设的推断将更加精确。具体来说,相对风险和中位生存时间等量的估计往往比没有分布假设的情况下具有更小的标准误。假设生存时间具有特定概率分布的模型称为参数模型 (parametric...">
<meta name="generator" content="bookdown 0.38 with bs4_book()">
<meta property="og:title" content="第 5 章 参数回归模型 | 医学研究中的生存数据建模">
<meta property="og:type" content="book">
<meta property="og:description" content="当 Cox 回归模型用于生存数据分析时,不需要假设生存时间特定形式的概率分布。因此,风险函数不局限于特定的函数形式,该模型具有灵活性和广泛的适用性。另一方面,如果特定概率分布的假设对于数据是有效的,基于这种假设的推断将更加精确。具体来说,相对风险和中位生存时间等量的估计往往比没有分布假设的情况下具有更小的标准误。假设生存时间具有特定概率分布的模型称为参数模型 (parametric...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="第 5 章 参数回归模型 | 医学研究中的生存数据建模">
<meta name="twitter:description" content="当 Cox 回归模型用于生存数据分析时,不需要假设生存时间特定形式的概率分布。因此,风险函数不局限于特定的函数形式,该模型具有灵活性和广泛的适用性。另一方面,如果特定概率分布的假设对于数据是有效的,基于这种假设的推断将更加精确。具体来说,相对风险和中位生存时间等量的估计往往比没有分布假设的情况下具有更小的标准误。假设生存时间具有特定概率分布的模型称为参数模型 (parametric...">
<!-- 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="" 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="active" 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="chap5" class="section level1" number="5">
<h1>
<span class="header-section-number">第 5 章</span> 参数回归模型<a class="anchor" aria-label="anchor" href="#chap5"><i class="fas fa-link"></i></a>
</h1>
<p>当 Cox 回归模型用于生存数据分析时,不需要假设生存时间特定形式的概率分布。因此,风险函数不局限于特定的函数形式,该模型具有灵活性和广泛的适用性。另一方面,如果特定概率分布的假设对于数据是有效的,基于这种假设的推断将更加精确。具体来说,相对风险和中位生存时间等量的估计往往比没有分布假设的情况下具有更小的标准误。假设生存时间具有特定概率分布的模型称为参数模型 (parametric models),是本章的主题。</p>
<p>在生存数据分析中起核心作用的概率分布是 Weibull 分布,由 W. Weibull 于 1951 年在工业可靠性测试中引入。事实上,<strong>就像正态分布在线性模型中的核心地位一样,Weibull 分布是生存数据参数分析的核心</strong>。因此,<a href="chap5.html#sec5-5">5.5</a> 节至 <a href="chap5.html#sec5-7">5.7</a> 节对基于 Weibull 分布的模型进行了详细讨论。</p>
<p>尽管比例风险模型在生存数据分析中具有广泛的应用,但能与该模型一起使用的生存时间概率分布却相对较少。此外,现有的分布,主要是 Weibull 分布和 Gompertz 分布,会导致风险函数随着时间的推移而增加或减少。一个涵盖更广泛生存时间分布的模型是加速失效时间模型 (accelerated failure time model),这在 <a href="%E5%8F%82%E6%95%B0%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B.html#sec5-10">5.10</a> 节至 <a href="%E5%8F%82%E6%95%B0%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B.html#sec5-13">5.13</a> 节中描述。在比例风险假设不成立的情况下,基于该系列的模型可能是富有成效的。同样,加速失效时间模型中的生存时间分布可以采用 Weibull 分布,也可以使用其他一些概率分布。因此,本章首先对可能用于参数模型的生存数据分布进行简要概述。另一个生存模型系列,称为比例几率模型 (proportional odds model),在某些情况下可能很有用。该模型在 <a href="%E5%8F%82%E6%95%B0%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B.html#sec5-15">5.15</a> 节中描述。</p>
<div id="sec5-1" class="section level2" number="5.1">
<h2>
<span class="header-section-number">5.1</span> 风险函数的模型<a class="anchor" aria-label="anchor" href="#sec5-1"><i class="fas fa-link"></i></a>
</h2>
<p>一旦根据概率密度函数指定了生存时间分布的模型,就可以从以下关系式中获得相应的生存函数和风险函数</p>
<p><span class="math display">\[\begin{aligned}S(t)&=1-\int_0^tf(u)\mathrm{d}u\end{aligned}\]</span></p>
<p>以及</p>
<p><span class="math display">\[\begin{aligned}h(t)=\frac{f(t)}{S(t)}=-\frac{\mathrm{d}}{\mathrm{d}t}\{\log S(t)\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(f(t)\)</span> 是生存时间的概率密度函数。这些关系在 <a href="chap1.html#sec1-4">1.4</a> 节推导过。另一种方法是为风险函数指定一种函数形式,然后可根据以下式子确定生存函数和概率密度函数</p>
<p><span class="math display" id="eq:5-1">\[\begin{align}
S(t)=\exp\left\{-H(t)\right\}
\tag{5.1}
\end{align}\]</span></p>
<p>以及</p>
<p><span class="math display">\[\begin{aligned}f(t)=h(t)S(t)=-\frac{\mathrm{d}S(t)}{\mathrm{d}t}\end{aligned}\]</span></p>
<p>其中</p>
<p><span class="math display">\[\begin{aligned}H(t)&=\int_0^th(u)\mathrm{d}u\end{aligned}\]</span></p>
<p>为累积风险函数。</p>
<div id="sec5-1-1" class="section level3" number="5.1.1">
<h3>
<span class="header-section-number">5.1.1</span> 指数分布<a class="anchor" aria-label="anchor" href="#sec5-1-1"><i class="fas fa-link"></i></a>
</h3>
<p>风险函数最简单的模型是假设它随着时间的推移保持不变。因此,无论经过多长时间,研究开始后任何时间的死亡风险都是相同的。在该模型下,风险函数可写为</p>
<p><span class="math display">\[\begin{aligned}h(t)=\lambda\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(0\le t<\infty\)</span>。参数 <span class="math inline">\(\lambda\)</span> 是一个正的常数,可以通过为观测生存数据拟合模型来估计。由式 <a href="chap5.html#eq:5-1">(5.1)</a> 可知,相应的生存函数为</p>
<p><span class="math display" id="eq:5-2">\[\begin{align}
S(t)&=\exp\left\{-\int_0^t\lambda\mathrm{d}u\right\}\\
&=e^{-\lambda t}
\tag{5.2}
\end{align}\]</span></p>
<p>因此生存时间隐含的概率密度函数是</p>
<p><span class="math display" id="eq:5-3">\[\begin{align}
f(t)=\lambda e^{-\lambda t}
\tag{5.3}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(0\le t<\infty\)</span>。这是均值为 <span class="math inline">\(\lambda^{-1}\)</span> 的指数分布随机变量 <span class="math inline">\(T\)</span> 的概率密度函数。有时可以方便地写成 <span class="math inline">\(\mu = \lambda^{-1}\)</span>,从而风险函数为 <span class="math inline">\(\mu^{−1}\)</span>,生存时间分布的均值为 <span class="math inline">\(\mu\)</span>。然而,本书通常会使用前一个风险函数指定。</p>
<p>指数分布的中位数 <span class="math inline">\(t(50)\)</span> 满足 <span class="math inline">\(S\{t(50)\}=0.5\)</span>,即</p>
<p><span class="math display">\[\exp\{-\lambda t(50)\}=0.5\]</span></p>
<p>从而</p>
<p><span class="math display">\[\begin{aligned}t(50)=\frac1\lambda\log2\end{aligned}\]</span></p>
<p>更一般地说,生存时间分布的第 <span class="math inline">\(p\)</span> 个百分位数是值 <span class="math inline">\(t(p)\)</span>,满足 <span class="math inline">\(S\{t(p)\}=1−(p/100)\)</span>,使用式 <a href="chap5.html#eq:5-2">(5.2)</a>,这是</p>
<p><span class="math display">\[\begin{aligned}t(p)&=\frac{1}{\lambda}\log\left(\frac{100}{100-p}\right)\end{aligned}\]</span></p>
<p>图 5.1 给出了三个 <span class="math inline">\(\lambda\)</span> 值(即 1.0, 0.1 和 0.01)的风险函数图,相应的概率密度函数如图 5.2 所示。对于这些 <span class="math inline">\(\lambda\)</span> 值,相应指数分布的均值分别为 1, 10 和 100,中位生存时间分别为 0.69, 6.93 和69.31.</p>
<details><summary><font color="#8B2232">图 5.1</font>
</summary><img src="figure/figure%205.1.png#center" style="width:80.0%"></details><br><details><summary><font color="#8B2232">图 5.2</font>
</summary><img src="figure/figure%205.2.png#center" style="width:80.0%"></details><p><br></p>
</div>
<div id="sec5-1-2" class="section level3" number="5.1.2">
<h3>
<span class="header-section-number">5.1.2</span> Weibull 分布<a class="anchor" aria-label="anchor" href="#sec5-1-2"><i class="fas fa-link"></i></a>
</h3>
<p>在实践中,恒定风险函数的假设(或等价的,指数分布生存时间的假设)很少是成立的。风险函数的一种更通用的形式是</p>
<p><span class="math display" id="eq:5-4">\[\begin{align}
h(t)=\lambda\gamma t^{\boldsymbol{\gamma}-1}
\tag{5.4}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(0\le t<\infty\)</span>,这是一个具有双参数 <span class="math inline">\(\lambda,\gamma\)</span> 的函数,参数均大于零。在 <span class="math inline">\(\gamma=1\)</span> 的特殊情况下,风险函数取恒定值 <span class="math inline">\(\lambda\)</span>,生存时间呈指数分布。对于 <span class="math inline">\(\gamma\)</span> 的其他值,风险函数单调增加或减少,即不改变方向。风险函数的形状主要取决于 <span class="math inline">\(\gamma\)</span> 的值,因此 <span class="math inline">\(\gamma\)</span> 被称为形状参数 (shape parameter),而参数 <span class="math inline">\(\lambda\)</span> 是一个尺度参数 (scale parameter). 图 5.3 展示了不同 <span class="math inline">\(\gamma\)</span> 值的风险函数。</p>
<details><summary><font color="#8B2232">图 5.3</font>
</summary><img src="figure/figure%205.3.png#center" style="width:80.0%"></details><p><br>
对于这种特定的风险函数,生存函数由下式给出</p>
<p><span class="math display" id="eq:5-5">\[\begin{align}
S(t)=\exp\left\{-\int_0^t\lambda\gamma u^{\gamma-1}\mathrm{d}u\right\}=\exp(-\lambda t^\gamma)
\tag{5.5}
\end{align}\]</span></p>
<p>相应的概率密度函数为</p>
<p><span class="math display">\[\begin{aligned}f(t)=\lambda\gamma t^{\gamma-1}\exp(-\lambda t^{\gamma})\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(0\le t<\infty\)</span>,这是尺度参数为 <span class="math inline">\(\lambda\)</span>、形状参数为 <span class="math inline">\(\gamma\)</span> 的 Weibull 分布随机变量的密度。该分布表示为 <span class="math inline">\(W(\lambda, \gamma)\)</span>。该分布的右尾比左尾长,因此该分布呈正偏态。</p>
<p>服从 <span class="math inline">\(W(\lambda, \gamma)\)</span> 分布的随机变量 <span class="math inline">\(T\)</span> 的均值或期望为</p>
<p><span class="math display">\[\begin{aligned}\operatorname{E}\left(T\right)=\lambda^{-1/\gamma}\Gamma(\gamma^{-1}+1)\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(\Gamma(c)\)</span> 是由如下积分定义的 gamma 函数</p>
<p><span class="math display" id="eq:5-6">\[\begin{align}
\Gamma(x)&=\int_0^\infty u^{x-1}e^{-u}\mathrm{d}u
\tag{5.6}
\end{align}\]</span></p>
<p>该积分的值为 <span class="math inline">\((x-1)!\)</span>,因此对于 <span class="math inline">\(x\)</span> 的整数值,该积分易于计算。该函数也为 <span class="math inline">\(x\)</span> 的非整数值有定义,可在许多软件包中计算。</p>
<p>由于 Weibull 分布是偏态的,因此对分布位置的更合适且更容易处理的总结是中位生存时间。这是值 <span class="math inline">\(t(50)\)</span>,满足 <span class="math inline">\(S\{t(50)\} = 0.5\)</span>,即</p>
<p><span class="math display">\[\exp\left\{-\lambda[t(50)]^{\gamma}\right\}=0.5\]</span></p>
<p>以及</p>
<p><span class="math display">\[t(50)=\left\{\frac{1}{\lambda}\log2\right\}^{1/\gamma}\]</span></p>
<p>更一般地,Weibull 分布第 <span class="math inline">\(p\)</span> 个百分位 <span class="math inline">\(t(p)\)</span> 满足</p>
<p><span class="math display" id="eq:5-7">\[\begin{align}
t(p)=\left\{\frac{1}{\lambda}\log\left(\frac{100}{100-p}\right)\right\}^{1/\gamma}
\tag{5.7}
\end{align}\]</span></p>
<p>因此,Weibull 分布的中位数和其他百分位数比分布的均值更容易计算。</p>
<p>中位数为 20、形状参数 <span class="math inline">\(\gamma = 0.5, 1.5\)</span> 和 <span class="math inline">\(3.0\)</span> 的 Weibull 分布的风险函数和相应概率密度函数分别如图 5.4 和 5.5 所示。这三个 Weibull 分布的尺度参数 <span class="math inline">\(\lambda\)</span> 的相应值分别为 0.15, 0.0078 和 0.000087.</p>
<details><summary><font color="#8B2232">图 5.4</font>
</summary><img src="figure/figure%205.4.png#center" style="width:80.0%"></details><br><details><summary><font color="#8B2232">图 5.5</font>
</summary><img src="figure/figure%205.5.png#center" style="width:80.0%"></details><p><br>
由于 Weibull 风险函数可以根据形状参数 <span class="math inline">\(\gamma\)</span> 采取多种形式,并且可以轻松获得适当的总结总统计量,因此该分布广泛应用于生存数据的参数分析。</p>
</div>
<div id="sec5-1-3" class="section level3" number="5.1.3">
<h3>
<span class="header-section-number">5.1.3</span> log-logistic 分布<a class="anchor" aria-label="anchor" href="#sec5-1-3"><i class="fas fa-link"></i></a>
</h3>
<p>Weibull 风险函数的一个局限性为:它是时间的单调函数。但是,可能会出现风险函数改变方向的情况。例如,心脏移植后,患者在移植后的头十天左右,在身体适应新器官的同时,死亡风险越来越大的。随着患者的康复,这种风险会随着时间的推移而减小。在这种情况下,单峰 (unimodal) 风险函数可能是合适的。</p>
<p>单峰风险的一种特殊形式是函数</p>
<p><span class="math display" id="eq:5-8">\[\begin{align}
h(t)=\frac{e^\theta\kappa t^{\kappa-1}}{1+e^\theta t^\kappa}
\tag{5.8}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty,\kappa>0\)</span>。若 <span class="math inline">\(\kappa>1\)</span>,风险函数单调递减,但若 <span class="math inline">\(\kappa\le1\)</span>,风险是单峰的。对应于式 <a href="chap5.html#eq:5-8">(5.8)</a> 风险函数的生存函数由下式给出</p>
<p><span class="math display" id="eq:5-9">\[\begin{align}
S(t)=\left\{1+e^\theta t^\kappa\right\}^{-1}
\tag{5.9}
\end{align}\]</span></p>
<p>概率密度函数为</p>
<p><span class="math display">\[\begin{aligned}f(t)&=\frac{e^\theta\kappa t^{\kappa-1}}{(1+e^\theta t^\kappa)^2}\end{aligned}\]</span></p>
<p>这是 log-logistic 分布随机变量 <span class="math inline">\(T\)</span> 的密度,参数为 <span class="math inline">\(\theta,\kappa\)</span>。该分布之所以如此称,是因为变量 <span class="math inline">\(\log T\)</span> 服从 logistic 分布,这是一种对称分布,其概率密度函数与正态分布的概率密度函数非常相似。</p>
<p>log-logistic 分布的第 <span class="math inline">\(p\)</span> 个百分位数为</p>
<p><span class="math display">\[t(p)=\left(\frac{pe^{-\theta}}{100-p}\right)^{1/\kappa}\]</span></p>
<p>所以分布的中位数为</p>
<p><span class="math display">\[\begin{aligned}t(50)=e^{\large-\theta/\kappa}\end{aligned}\]</span></p>
<p>中位数为 20 且 <span class="math inline">\(\kappa=0.5, 2.0\)</span> 和 <span class="math inline">\(5.0\)</span> 的 log-logistic 分布的风险函数如图 5.6 所示。这些分布对应的 <span class="math inline">\(θ\)</span> 值分别为 −1.5, −6.0 和 −15.0.</p>
<details><summary><font color="#8B2232">图 5.6</font>
</summary><img src="figure/figure%205.6.png#center" style="width:80.0%"></details>
</div>
<div id="sec5-1-4" class="section level3" number="5.1.4">
<h3>
<span class="header-section-number">5.1.4</span> log-normal 分布<a class="anchor" aria-label="anchor" href="#sec5-1-4"><i class="fas fa-link"></i></a>
</h3>
<p>log-normal 分布对应的随机变量也取正值,因此可以用作生存数据的模型。如果 <span class="math inline">\(\log T\)</span> 服从均值为 <span class="math inline">\(\mu\)</span>、方差为 <span class="math inline">\(\sigma^2\)</span> 的正态分布,则称随机变量 <span class="math inline">\(T\)</span> 服从参数为 <span class="math inline">\(\mu\)</span> 和 <span class="math inline">\(\sigma\)</span> 的 log-normal 分布。<span class="math inline">\(T\)</span> 的概率密度函数由下式给出</p>
<p><span class="math display">\[\begin{aligned}f(t)=\frac{1}{\sigma\surd(2\pi)}t^{-1}\exp\left\{-(\log t-\mu)^2/2\sigma^2\right\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty,\sigma>0\)</span>,从中可以得到生存函数和风险函数。log-normal 分布的生存函数为</p>
<p><span class="math display" id="eq:5-10">\[\begin{align}
S(t)=1-\Phi\left(\frac{\log t-\mu}\sigma\right)
\tag{5.10}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(\Phi(\cdot)\)</span> 为标准正态分布函数,由下式给出</p>
<p><span class="math display">\[\begin{aligned}\Phi(z)&=\frac{1}{\surd(2\pi)}\int_{-\infty}^{z}\exp\left(-u^2/2\right)\mathrm{d}u\end{aligned}\]</span></p>
<p>该分布的第 <span class="math inline">\(p\)</span> 个百分位数为</p>
<p><span class="math display">\[t(p)=\exp\left\{\sigma\Phi^{-1}(p/100)+\mu\right\}\]</span></p>
<p>其中 <span class="math inline">\(\Phi^{-1}(p/100)\)</span> 为标准正态分布的第 <span class="math inline">\(p\)</span> 个百分位数,有时也称为 <span class="math inline">\(p/100\)</span> 的 probit. 特别是,在这种分布下的中位生存时间简单地为 <span class="math inline">\(t(50)=e^{\mu}\)</span>。</p>
<p>风险函数可以根据关系式 <span class="math inline">\(h(t)=f(t)/S(t)\)</span> 得到。当 <span class="math inline">\(t=0\)</span> 时,此函数为 0,在 <span class="math inline">\(t\)</span> 趋于无穷大的过程中,该函数增大到最大值,然后减小为 0. 生存函数和风险函数只能用积分表示,这一事实限制了该模型的实用性。此外,<strong>考虑到正态分布和 logistic 分布的相似性,log-normal 模型往往与 log-logistic 模型非常相似</strong>。</p>
</div>
<div id="sec5-1-5" class="section level3" number="5.1.5">
<h3>
<span class="header-section-number">5.1.5</span> Gompertz 分布<a class="anchor" aria-label="anchor" href="#sec5-1-5"><i class="fas fa-link"></i></a>
</h3>
<p>Gompertz 分布由 Gompertz 作为人类死亡率的模型于 1825 年引入,现在用于人口学和生物科学。该分布的风险函数由下式给出</p>
<p><span class="math display">\[h(t)=\lambda e^{\theta t}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty\)</span> 以及 <span class="math inline">\(\lambda>0\)</span>。在 <span class="math inline">\(\theta = 0\)</span> 的特殊情况下,风险函数具有恒定值 <span class="math inline">\(\lambda\)</span>,并且生存时间服从指数分布。参数 <span class="math inline">\(\theta\)</span> 决定了风险函数的形状,正值导致风险函数随时间递增。风险函数也可以表示为 <span class="math inline">\(h(t)=\exp(\alpha+\theta t)\)</span>,这表明其对数风险函数关于 <span class="math inline">\(t\)</span> 是线性的。另一方面,根据式 <a href="chap5.html#eq:5-4">(5.4)</a> ,Weibull 对数风险函数关于 <span class="math inline">\(\log t\)</span> 呈线性。与 Weibull 风险函数类似,Gompertz 风险函数单调增加或减少。</p>
<p>Gompertz 分布的生存函数由下式给出</p>
<p><span class="math display">\[S(t)=\exp\left\{\frac{\lambda}{\theta}(1-e^{\theta t})\right\}\]</span></p>
<p>相应的密度函数为</p>
<p><span class="math display">\[f(t)=\lambda e^{\theta t}\exp\left\{\frac\lambda\theta(1-e^{\theta t})\right\}\]</span></p>
<p>第 <span class="math inline">\(p\)</span> 个百分位数满足</p>
<p><span class="math display">\[\begin{aligned}t(p)=\frac{1}{\theta}\log\left\{1-\frac{\theta}{\lambda}\log\left(\frac{100-p}{100}\right)\right\}\end{aligned}\]</span></p>
<p>中位生存时间为</p>
<p><span class="math display">\[\begin{aligned}t(50)=\frac{1}{\theta}\log\left\{1+\frac{\theta}{\lambda}\log2\right\}\end{aligned}\]</span></p>
<p>图 5.7 显示了中位数为 <span class="math inline">\(20\)</span> 且 <span class="math inline">\(\theta = −0.2, 0.02\)</span> 和 <span class="math inline">\(0.05\)</span> 的分布的 Gompertz 风险函数图。对应的 <span class="math inline">\(\lambda\)</span> 值为 0.141, 0.028 和 0.020.</p>
<details><summary><font color="#8B2232">图 5.7</font>
</summary><img src="figure/figure%205.7.png#center" style="width:80.0%"></details>
</div>
<div id="sec5-1-6" class="section level3" number="5.1.6">
<h3>
<span class="header-section-number">5.1.6</span> gamma 分布<a class="anchor" aria-label="anchor" href="#sec5-1-6"><i class="fas fa-link"></i></a>
</h3>
<p>均值为 <span class="math inline">\(\rho/\lambda\)</span> 且方差为 <span class="math inline">\(\rho/\lambda^2\)</span> 的 gamma 分布的概率密度函数为</p>
<p><span class="math display" id="eq:5-11">\[\begin{align}
f(t)=\frac{\lambda^\rho t^{\rho-1}e^{-\lambda t}}{\Gamma(\rho)}
\tag{5.11}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty,\lambda>0\)</span> 以及 <span class="math inline">\(\rho>0\)</span>。如同 log-normal 分布,gamma 分布的生存函数只能表示为积分,写作</p>
<p><span class="math display">\[S(t)=1-\Gamma_{\lambda t}(\rho)\]</span></p>
<p>其中 <span class="math inline">\(\Gamma_{\lambda t}(\rho)\)</span> 为不完全 gamma 函数,由下式给出</p>
<p><span class="math display">\[\begin{aligned}\Gamma_{\lambda t}(\rho)&=\frac{1}{\Gamma(\rho)}\int_{0}^{\lambda t}u^{\rho-1}e^{-u}\mathrm{d}u\end{aligned}\]</span></p>
<p>gamma 分布的风险函数为 <span class="math inline">\(h(t) = f(t)/S(t)\)</span>。如果 <span class="math inline">\(\rho > 1\)</span>,则该风险函数单调增加;如果 <span class="math inline">\(ρ < 1\)</span>,则该风险函数单调减少,并且当 <span class="math inline">\(t\)</span> 趋于 <span class="math inline">\(\infty\)</span> 时趋于 <span class="math inline">\(\lambda\)</span>。</p>
<p>当 <span class="math inline">\(\rho = 1\)</span> 时,gamma 分布简化为 <a href="chap5.html#sec5-1-1">5.1.1</a> 节中描述的指数分布,因此该分布与 Weibull 分布一样,都以指数分布为特例。事实上,<strong>gamma 分布与 Weibull 分布非常相似,并且基于模型的推断通常非常相似</strong>。</p>
<p>gamma 分布的推广实际上比 gamma 分布本身更有用,因为它以 Weibull 和 log-normal 分布为特例。因此,这样的模型称为广义 gamma 分布,可用于区分生存数据的替代参数模型。</p>
<p>广义 gamma 分布的概率密度函数是式 <a href="chap5.html#eq:5-11">(5.11)</a> 中 gamma 密度的扩展,包括一个额外参数 <span class="math inline">\(\theta>0\)</span>,定义为</p>
<p><span class="math display">\[\begin{aligned}f(t)=\frac{\theta\lambda^{\rho\theta}t^{\rho\theta-1}\exp\{-(\lambda t)^\theta\}}{\Gamma(\rho)}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty\)</span>。该分布的生存函数也由不完全 gamma 函数定义,并由下式给出</p>
<p><span class="math display">\[\begin{aligned}S(t)=1-\Gamma_{(\lambda t)^\theta}(\rho)\end{aligned}\]</span></p>
<p>然后根据 <span class="math inline">\(h(t)=f(t)/S(t)\)</span> 得到风险函数。这种分布导致风险函数的形状范围很广,由形状参数 <span class="math inline">\(\theta\)</span> 决定。当 <span class="math inline">\(\rho=1\)</span> 时,分布变为 Weibull;当 <span class="math inline">\(\theta=1\)</span> 时,为 gamma;当 <span class="math inline">\(\rho\rightarrow\infty\)</span> 时成为 lognormal。</p>
</div>
<div id="sec5-1-7" class="section level3" number="5.1.7">
<h3>
<span class="header-section-number">5.1.7</span> 逆高斯分布<a class="anchor" aria-label="anchor" href="#sec5-1-7"><i class="fas fa-link"></i></a>
</h3>
<p>逆高斯分布 (inverse gaussian distribution) 是一个灵活的模型,具有一些重要的理论性质。具有均值 <span class="math inline">\(\mu\)</span> 和尺度参数 <span class="math inline">\(\lambda\)</span> 的分布的概率密度函数由下式给出</p>
<p><span class="math display">\[\begin{aligned}f(t)=\left(\frac{\lambda}{2\pi t^3}\right)^{\frac{1}{2}}\exp\left\{\frac{\lambda(t-\mu^2)}{2\mu^2t}\right\}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(0\leqslant t<\infty\)</span> 以及 <span class="math inline">\(\lambda>0\)</span>。相应的生存函数为</p>
<p><span class="math display">\[\begin{aligned}S(t)=\Phi\left\{\left(1-t\mu^{-1}\right)\surd\left(\lambda t^{-1}\right)\right\}-\exp(2\lambda/\mu)\Phi\left\{-\left(1+t\mu^{-1}\right)\surd\left(\lambda t^{-1}\right)\right\}\end{aligned}\]</span></p>
<p>然后根据 <span class="math inline">\(h(t)=f(t)/S(t)\)</span> 得到风险函数。然而,如此复杂的生存函数形式使这种分布难以处理。</p>
</div>
<div id="sec5-1-8" class="section level3" number="5.1.8">
<h3>
<span class="header-section-number">5.1.8</span> 一些其他分布<a class="anchor" aria-label="anchor" href="#sec5-1-8"><i class="fas fa-link"></i></a>
</h3>
<p>尽管已详细考虑了生存数据的许多分布,但还有其他分布在特定情况下可能有用。</p>
<p>当死亡风险预计在短期内随着时间的推移而增加或减少,然后变为常数时,服从一般指数曲线 (general exponential curve) 或 Mitscherlich 曲线的风险函数可能是合适的。那么我们将风险函数设为</p>
<p><span class="math display">\[\begin{aligned}h(t)=\theta-\beta e^{-\gamma t}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(\theta>0,\beta>0\)</span> 以及 <span class="math inline">\(\gamma>0\)</span>。这本质上是 <a href="chap5.html#sec5-1-5">5.1.5</a> 节中定义的 Gompertz 风险函数,但带有一个额外常数。该函数的总体形状如图 5.8 所示。当 <span class="math inline">\(t=0\)</span> 时,该函数的值为 <span class="math inline">\(\theta-\beta\)</span>,并递增至接近 <span class="math inline">\(\theta\)</span> 的水平渐近线。类似地,函数</p>
<p><span class="math display">\[\begin{aligned}h(t)=\theta+\beta e^{-\gamma t}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(\theta>0,\beta>0\)</span> 以及 <span class="math inline">\(\gamma>0\)</span> 可用于为这样的风险进行建模:从 <span class="math inline">\(\theta + \beta\)</span> 递减至接近 <span class="math inline">\(\theta\)</span> 的水平渐近线。</p>
<details><summary><font color="#8B2232">图 5.8</font>
</summary><img src="figure/figure%205.8.png#center" style="width:80.0%"></details><p><br>
使用式 <a href="chap1.html#eq:1-6">(1.6)</a> 可以求出相应的生存函数,由此可以得到概率密度函数。与该风险函数指定相对应的概率分布称为 Gompertz-Makeham 分布。</p>
<p>为了对关于最小值对称地先减少后增加的风险函数进行建模,二次风险函数可能是合适的。因此,如果对于下式,<span class="math inline">\(\theta,\beta\)</span> 和 <span class="math inline">\(\gamma\)</span> 给出了所需的风险形状</p>
<p><span class="math display">\[\begin{aligned}h(t)=\theta+\beta t+\gamma t^2\end{aligned}\]</span></p>
<p>并确保 <span class="math inline">\(h(t)\ge 0\)</span>,可以获得生存函数和概率密度函数的显式表达。</p>
<p>另一种形式的风险函数是“浴缸” (bathtub) 风险,它会先减小到一个最小值,然后再增加。模型</p>
<p><span class="math display">\[\begin{aligned}h(t)&=\alpha t+\frac{\beta}{1+\gamma t}\end{aligned}\]</span></p>
<p>提供了这种形式的风险的直接表达,并且可以找到生存函数和密度函数的相应表达式。</p>
</div>
</div>
<div id="sec5-2" class="section level2" number="5.2">
<h2>
<span class="header-section-number">5.2</span> 评估参数模型的适用性<a class="anchor" aria-label="anchor" href="#sec5-2"><i class="fas fa-link"></i></a>
</h2>
<p>在根据假设的风险函数参数形式拟合模型之前,应对该假设的有效性进行初步研究。一种方法是使用 <a href="chap2.html#sec2-3">2.3</a> 节中概述的方法来估计风险函数。如果风险函数随着时间的推移是较为恒定的,这将表明指数分布可能是数据的合适模型。另一方面,如果风险函数随着生存时间的增加而单调增加或减少,则表明应使用基于 Weibull 分布的模型。</p>
<p>评估生存时间的特定分布是否合理的一种富有信息的方法是将数据的生存函数与所选模型的生存函数进行比较。如果假设的模型是合适的,通过转换生存函数将产生一条直线图形。</p>
<p>假设有单个生存数据样本,并且考虑了生存时间的 Weibull 分布。由于具有尺度参数 <span class="math inline">\(\lambda\)</span> 和形状参数 <span class="math inline">\(\gamma\)</span> 的 Weibull 分布的生存函数为</p>
<p><span class="math display">\[\begin{aligned}S(t)=\exp\left\{-\lambda t^{\gamma}\right\}\end{aligned}\]</span></p>
<p>取其对数,乘以负一,然后再取对数,得到</p>
<p><span class="math display" id="eq:5-12">\[\begin{align}
\log\left\{-\log S(t)\right\}=\log\lambda+\gamma\log t
\tag{5.12}
\end{align}\]</span></p>
<p>现在,我们用生存函数的 Kaplan-Meier 估计 <span class="math inline">\(\hat S(t)\)</span> 代替式 <a href="chap5.html#eq:5-12">(5.12)</a> 中的 <span class="math inline">\(S(t)\)</span>。如果 Weibull 假设成立,则 <span class="math inline">\(\hat S(t)\)</span> 将“接近” <span class="math inline">\(S(t)\)</span>,并且 <span class="math inline">\(\log\{-\log\hat{S}(t)\}\)</span> 关于 <span class="math inline">\(\log t\)</span> 的图形将给出一条近似的直线。根据式 <a href="chap1.html#eq:1-8">(1.8)</a>,累积风险函数 <span class="math inline">\(H(t)=− \log S(t)\)</span>,因此 <span class="math inline">\(\log\{-\log S(t)\}\)</span> 是对数累积风险。<span class="math inline">\(\log\{-\log\hat{S}(t)\}\)</span> 关于 <span class="math inline">\(\log t\)</span> 的图形是对数累积风险图,这在第 4 章 <a href="chap4.html#sec4-4-1">4.4.1</a> 节介绍过。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex5-1" class="example"><strong>示例 5.1 (停用宫内节育器的时间) </strong></span><br></p>
<p>在<a href="chap2.html#exm:ex2-3">示例 2.3</a> 中,获得了关于停用宫内节育器时间数据的生存函数的 Kaplan-Meier 估计 <span class="math inline">\(\hat S(t)\)</span>。这些数据的对数累积风险图,即 <span class="math inline">\(\log\{-\log\hat{S}(t)\}\)</span> 关于 <span class="math inline">\(\log t\)</span> 的图,如图 5.9 所示。</p>
<details><summary><font color="#8B2232">图 5.9</font>
</summary><img src="figure/figure%205.9.png#center" style="width:80.0%"></details><p><br>
该图表明对数累积风险与 <span class="math inline">\(\log t\)</span> 之间存在直线关系,证实 Weibull 分布是停用时间的合适模型。从图中可以看出,直线的截距约为 -6.0,斜率约为 1.25. 因此, Weibull 分布参数的近似估计为 <span class="math inline">\(\lambda^* = \exp(−6.0) = 0.002\)</span> 和 <span class="math inline">\(\gamma^* = 1.25\)</span>. Weibull 分布形状参数 <span class="math inline">\(\gamma\)</span> 的估计非常接近于 1,这表明停用时间可以使用指数分布建模。</p>
</div>
</div>
<p>可用类似的程序评估 log-logistic 分布的适用性,使用生存函数的变换来生成直线图。根据式 <a href="chap5.html#eq:5-9">(5.9)</a>,生存超过时间 <span class="math inline">\(t\)</span> 的几率 (odds) 为</p>
<p><span class="math display">\[\begin{aligned}\frac{S(t)}{1-S(t)}&=e^{-\theta}t^{-\kappa}\end{aligned}\]</span></p>
<p>因此生存超过 <span class="math inline">\(t\)</span> 的对数几率 (log-odds) 可以表示为</p>
<p><span class="math display">\[\begin{aligned}\log\left\{\frac{S(t)}{1-S(t)}\right\}&=-\theta-\kappa\log t\end{aligned}\]</span></p>
<p>如果使用 Kaplan-Meier 估计来估计数据的生存函数,并绘制生存超过 <span class="math inline">\(t\)</span> 的对数几率关于 <span class="math inline">\(\log t\)</span> 的图形,如果生存时间的 log-logistic 模型合适,将获得直线图。log-logistic 分布的参数 <span class="math inline">\(\theta\)</span> 和 <span class="math inline">\(\kappa\)</span> 的估计可以从直线图的截距和斜率获得。</p>
<p>其他参数模型的适用性可以按照类似的思路进行研究。例如,根据式 <a href="chap5.html#eq:5-10">(5.10)</a> 给出的 log-normal 分布的生存函数,</p>
<p><span class="math display">\[\begin{aligned}\Phi^{-1}\{1-S(t)\}&=\frac{\log t-\mu}{\sigma}\end{aligned}\]</span></p>
<p>因此如果 log-normal 模型是合适的,<span class="math inline">\(\Phi^{-1}\{1-S(t)\}\)</span> 关于 <span class="math inline">\(\log t\)</span> 的图形将给出一条直线。该线的斜率和截距分别提供了 <span class="math inline">\(\sigma^{−1}\)</span> 和 <span class="math inline">\(−\mu/\sigma\)</span> 的估计。</p>
<div class="rmdnote">
<div class="example">
<p><span id="exm:ex5-2" class="example"><strong>示例 5.2 (停用宫内节育器的时间) </strong></span><br></p>
<p>在<a href="chap5.html#exm:ex5-1">示例 5.1</a> 中,使用对数累积风险图来评估 Weibull 分布对<a href="chap1.html#exm:ex1-1">示例 1.1</a> 给出的宫内节育器停用时间数据的拟合度。我们现在考虑 log-logistic 分布是否合适。图 5.10 显示了宫内节育器停用时间数据的 <span class="math inline">\(\log\{\hat{S}(t)/[1-\hat{S}(t)]\}\)</span> 关于 <span class="math inline">\(\log t\)</span> 的图形。</p>
<details><summary><font color="#8B2232">图 5.10</font>
</summary><img src="figure/figure%205.10.png#center" style="width:80.0%"></details><p><br>
根据该图,时间 <span class="math inline">\(t\)</span> 后停用宫内节育器的对数几率估计与 <span class="math inline">\(\log t\)</span> 之间有合理的直线关系。这表明可以使用 log-logistic 模型对观测数据进行建模。</p>
</div>
</div>
<p>请注意,图 5.9 和 5.10 图中偏离线性的程度几乎没有差异。这意味着 Weibull 分布和 log-logistic 分布可能都令人满意,即使在这两种分布下风险函数估计可能非常不同。事实上,当只有相对较少数量个体的生存数据时,如本例所示,通常在数据的替代分布模型之间几乎没有选择余地。然后采用最方便的模型。</p>
<p>使用图形方法获得的生存时间概率分布中未知参数的非正式估计也可以用于估计这些参数的函数,例如分布的中位数。然而,这并不能度量所估量的精度。下一节将开发一种更正式的方法:为生存数据拟合参数模型。</p>
</div>
<div id="sec5-3" class="section level2" number="5.3">
<h2>
<span class="header-section-number">5.3</span> 为单样本拟合参数模型<a class="anchor" aria-label="anchor" href="#sec5-3"><i class="fas fa-link"></i></a>
</h2>
<p>可以使用第 3 章 <a href="chap3.html#sec3-3">3.3</a> 节概述的最大似然方法为观测生存数据集拟合参数模型。首先考虑无删失观测情况,我们有 <span class="math inline">\(n\)</span> 个个体的实际观测生存时间。若与生存时间相关的随机变量的概率密度函数为 <span class="math inline">\(f(t)\)</span>,<span class="math inline">\(n\)</span> 个观测 <span class="math inline">\(t_1,t_2,\ldots,t_n\)</span> 的似然简单地为乘积</p>
<p><span class="math display">\[\prod_{i=1}^nf(t_i)\]</span></p>
<p>该似然是概率密度函数中未知参数的函数,这些参数的最大似然估计是使似然函数达到最大值的那些值。在实践中,使用对数似然函数通常更方便。使对数似然达到最大的未知参数值当然与使似然函数本身达到最大的值相同。</p>
<p>我们现在考虑一种更常见的情况,其中生存数据包包含若干个删失生存时间。具体来说,假设 <span class="math inline">\(r\)</span> 个个体在时间 <span class="math inline">\(t_1, t_2,...,t_r\)</span> 处死亡,剩余 <span class="math inline">\(n − r\)</span> 个个体的生存时间 <span class="math inline">\(t_1^*,t_2^*,\ldots,t_{n-r}^*\)</span> 为右删失的。<span class="math inline">\(r\)</span> 个死亡时间为总体似然函数贡献了以下形式的项</p>
<p><span class="math display">\[\prod_{j=1}^rf(t_j)\]</span></p>
<p>当然,我们不能忽视 <span class="math inline">\(n − r\)</span> 个个体的生存经历的信息,这些个体的删失生存时间已被记录。如果在时间 <span class="math inline">\(t^*\)</span> 处生存时间删失,那么我们知道个体的生命至少为 <span class="math inline">\(t^*\)</span>,并且该事件的概率为 <span class="math inline">\(\mathrm{P}(T\geqslant t^*)\)</span>,即 <span class="math inline">\(S(t^*)\)</span>。因此,每个删失观测为似然函数贡献了一个如此形式的项。因此,总似然函数为</p>
<p><span class="math display" id="eq:5-13">\[\begin{align}
\prod_{j=1}^rf(t_j)\prod_{l=1}^{n-r}S(t_l^*)
\tag{5.13}
\end{align}\]</span></p>
<p>其中第一个乘积运算关于 <span class="math inline">\(r\)</span> 个死亡时间进行,第二个乘积运算关于 <span class="math inline">\(n−r\)</span> 个删失生存时间进行。</p>
<p>或者以另一种方式,假设数据被视为 <span class="math inline">\(n\)</span> 对观测值,其中第 <span class="math inline">\(i\)</span> 个个体的观测对是 <span class="math inline">\((t_i, \delta_i),i = 1, 2,...,n\)</span>。在这种表示中,<span class="math inline">\(\delta_i\)</span> 是一个指示变量,当生存时间 <span class="math inline">\(t_i\)</span> 删失时,<span class="math inline">\(δ_i=0\)</span>;当 <span class="math inline">\(t_i\)</span> 是未删失的生存时间时,<span class="math inline">\(δ_i=1\)</span>。似然函数可以写为</p>
<p><span class="math display" id="eq:5-14">\[\begin{align}
\prod_{i=1}^n\left\{f(t_i)\right\}^{\delta_i}\left\{S(t_i)\right\}^{1\boldsymbol{-}\delta_i}
\tag{5.14}
\end{align}\]</span></p>
<p>该函数等价于式 <a href="chap5.html#eq:5-13">(5.13)</a> 中的函数,然后可以关于密度函数和生存函数中的未知参数来最大化。</p>
<p>可以通过将式 <a href="chap5.html#eq:5-14">(5.14)</a> 写为以下形式来获得该似然函数的另一种表达</p>
<p><span class="math display">\[\prod_{i=1}^n\left\{\frac{f(t_i)}{S(t_i)}\right\}^{\delta_i}S(t_i)\]</span></p>
<p>因此,根据第 1 章的式 <a href="chap1.html#eq:1-4">(1.4)</a>,这成为</p>
<p><span class="math display" id="eq:5-15">\[\begin{align}
\prod_{{i}=1}^{{n}}\left\{h(t_i)\right\}^{{\delta}_i}S(t_i)
\tag{5.15}
\end{align}\]</span></p>
<p>当概率密度函数具有复杂的形式(通常如此)时,如此形式的似然函数特别有用。然后通过最大化对数似然函数的来得到该似然函数中未知参数的估计。</p>
<div id="sec5-3-1" class="section level3" number="5.3.1">
<h3>
<span class="header-section-number">5.3.1</span> 随机删失数据的似然函数<a class="anchor" aria-label="anchor" href="#sec5-3-1"><i class="fas fa-link"></i></a>
</h3>
<p>本节给出了式 <a href="chap5.html#eq:5-14">(5.14)</a> 中似然函数更仔细的推导,它涉及第 1 章 <a href="chap1.html#sec1-2-1">1.2.1</a> 节中提到的独立删失假设。</p>
<p>假设 <span class="math inline">\(n\)</span> 个个体样本的生存数据是事件时间和右删失观测的混合。用 <span class="math inline">\(t_i\)</span> 表示第 <span class="math inline">\(i\)</span> 个个体的观测时间,<span class="math inline">\(\delta_i\)</span> 为相应的事件指示,<span class="math inline">\(i=1,2,\ldots,n\)</span>。 如果 <span class="math inline">\(t_i\)</span> 是事件时间,则 <span class="math inline">\(\delta_i=1\)</span>,如果时间是删失的,则 <span class="math inline">\(\delta_i=0\)</span>。</p>
<p>与第 <span class="math inline">\(i\)</span> 个个体的事件时间相关的随机变量将由 <span class="math inline">\(T_i\)</span> 表示。假设删失时间为随机的,用 <span class="math inline">\(C_i\)</span> 表示与删失时间相关的变量。那么,值 <span class="math inline">\(t_i\)</span> 是随机变量 <span class="math inline">\(Y_i=\min(T_i,C_i)\)</span> 的观测值。<span class="math inline">\(T_i\)</span> 的密度函数和生存函数分别用 <span class="math inline">\(f_{T_i}(t)\)</span> 和 <span class="math inline">\(S_{T_i}(t)\)</span> 表示。此外,用 <span class="math inline">\(f_{C_i}(t)\)</span>和 <span class="math inline">\(S_{C_i}(t)\)</span> 表示与删失时间 <span class="math inline">\(C_i\)</span> 相关的随机变量的密度和生存函数。</p>
<p>现在,我们分别考虑删失和未删失观测对 <span class="math inline">\((Y_i,\delta_i)\)</span> 的概率分布。首先考虑删失观测,因此 <span class="math inline">\(\delta_i=0\)</span>。<span class="math inline">\(Y_i\)</span> 和 <span class="math inline">\(\delta_i\)</span> 的联合分布为</p>
<p><span class="math display">\[\begin{aligned}\mathrm{P}(Y_i=t,\delta_i=0)=\mathrm{P}(C_i=t,T_i\geqslant t)\end{aligned}\]</span></p>
<p>该联合概率是连续分量和离散分量的混合,但为了简化表示,例如,将 <span class="math inline">\(P(T_i=t)\)</span> 理解为 <span class="math inline">\(T_i\)</span> 的概率密度函数。现在假设事件时间 <span class="math inline">\(T_i\)</span> 的分布与删失时间 <span class="math inline">\(C_i\)</span> 的分布独立。那么</p>
<p><span class="math display">\[\begin{aligned}
\begin{aligned}\mathrm{P}(C_i=t,T_i\geqslant t)\end{aligned}& \begin{aligned}=\text{ P}(C_i=t)\text{ P}(T_i\geqslant t)\end{aligned} \\
&=\left.f_{C_i}(t)S_{T_i}(t)\right.
\end{aligned}\]</span></p>
<p>因此</p>
<p><span class="math display">\[\begin{aligned}\mathrm{P}(Y_i=t,\delta_i=0)=f_{C_i}(t)S_{T_i}(t)\end{aligned}\]</span></p>
<p>类似地,对于未删失观测</p>
<p><span class="math display">\[\begin{aligned}
\mathrm{P}(Y_i=t,\delta_i=1)& \begin{aligned}=\text{ P}(T_i=t,C_i\geqslant t)\end{aligned} \\
&=\text{ P}(T_i=t)\text{ P}(C_i\geqslant t) \\
&=\left.f_{T_i}(t)S_{C_i}(t)\right.
\end{aligned}\]</span></p>
<p>再次假设 <span class="math inline">\(C_i\)</span> 与 <span class="math inline">\(T_i\)</span> 的分布是独立的。把这两个结果放在一起,<span class="math inline">\(n\)</span> 个观测 <span class="math inline">\(t_1,t_2,\ldots,t_n\)</span> 的联合概率或似然为</p>
<p><span class="math display">\[\begin{aligned}\prod_{i=1}^n\{f_{T_i}(t_i)S_{C_i}(t_i)\}^{\delta_i}\{f_{C_i}(t_i)S_{T_i}(t_i)\}^{1{-}\delta_i}\end{aligned}\]</span></p>
<p>可写为</p>
<p><span class="math display">\[\begin{aligned}\prod_{i=1}^nf_{C_i}(t_i)^{1-\delta_i}S_{C_i}(t_i)^{\delta_i}\times\prod_{i=1}^nf_{T_i}(t_i)^{\delta_i}S_{T_i}(t_i)^{1-\delta_i}\end{aligned}\]</span></p>
<p>在独立删失假设下,该表达式中的第一个乘积项将不涉及任何与生存时间分布相关的参数,因此可以视为常数。观测数据的似然与下式成比例</p>
<p><span class="math display">\[\prod_{i=1}^nf_{T_i}(t_i)^{\delta_i}S_{T_i}(t_i)^{1\boldsymbol{-}\delta_i}\]</span></p>
<p>这是式 <a href="chap5.html#eq:5-14">(5.14)</a>。</p>
<p>还可以证明,当研究具有固定的持续时间时,从而到研究结束时没有经历过事件的个体被删失,可以获得相同的似然函数。此处不给出具体细节,但可参阅 Klein and Moeschberger (2005) 或 Lawless (2002).</p>
</div>
</div>
<div id="sec5-4" class="section level2" number="5.4">
<h2>
<span class="header-section-number">5.4</span> 拟合指数和 Weibull 模型<a class="anchor" aria-label="anchor" href="#sec5-4"><i class="fas fa-link"></i></a>
</h2>
<p>我们现在考虑为单个生存数据样本拟合指数分布和 Weibull 分布。</p>
<div id="sec5-4-1" class="section level3" number="5.4.1">
<h3>
<span class="header-section-number">5.4.1</span> 拟合指数分布<a class="anchor" aria-label="anchor" href="#sec5-4-1"><i class="fas fa-link"></i></a>
</h3>
<p>假设 <span class="math inline">\(n\)</span> 个个体的生存时间 <span class="math inline">\(t_1, t_2,...,t_n\)</span> 呈均值为 <span class="math inline">\(\lambda^{-1}\)</span> 的指数分布。进一步假设 <span class="math inline">\(r\)</span> 个个体的生存时间未删失,其余 <span class="math inline">\(n − r\)</span> 个是右删失的。</p>
<p>对于指数分布</p>
<p><span class="math display">\[\begin{aligned}f(t)=\lambda e^{-\lambda t},\quad\quad S(t)=e^{-\lambda t}\end{aligned}\]</span></p>
<p>代入式 <a href="chap5.html#eq:5-14">(5.14)</a>,<span class="math inline">\(n\)</span> 个观测的似然函数由下式给出</p>
<p><span class="math display">\[\begin{aligned}L(\lambda)&=\prod_{i=1}^n\left(\lambda e^{-\lambda t_i}\right)^{\delta_i}\left(e^{-\lambda t_i}\right)^{1-\delta_i}\end{aligned}\]</span></p>
<p>其中,如果第 <span class="math inline">\(i\)</span> 个个体的生存时间删失,则 <span class="math inline">\(\delta_i=0\)</span>,否则为 1. 经过一些简化后,</p>
<p><span class="math display" id="eq:5-16">\[\begin{align}
L(\lambda)&=\prod_{i=1}^n\lambda^{\delta_i}e^{-\lambda t_i}
\tag{5.16}
\end{align}\]</span></p>
<p>相应的对数似然函数为</p>
<p><span class="math display">\[\begin{aligned}\log L(\lambda)=\sum_{i=1}^n\delta_i\log\lambda-\lambda\sum_{i=1}^nt_i\end{aligned}\]</span></p>
<p>由于数据包含 <span class="math inline">\(r\)</span> 次死亡,则 <span class="math inline">\(\sum_{i=1}^n\delta_i=r\)</span>,对数似然函数成为</p>
<p><span class="math display">\[\begin{aligned}\log L(\lambda)&=r\log\lambda-\lambda\sum_{i=1}^nt_i\end{aligned}\]</span></p>
<p>现在我们需要确定使对数似然函数达到最大值的 <span class="math inline">\(\hat\lambda\)</span>。将其关于 <span class="math inline">\(\lambda\)</span> 微分,得到</p>
<p><span class="math display">\[\begin{aligned}\frac{\mathrm{d}\log L(\lambda)}{\mathrm{d}\lambda}&=\frac{r}{\lambda}-\sum_{i=1}^{n}t_i\end{aligned}\]</span></p>
<p>并令导数等于零,得到 <span class="math inline">\(\lambda\)</span> 的最大似然估计</p>
<p><span class="math display" id="eq:5-17">\[\begin{align}
\hat{\lambda}=r/\sum_{i=1}^nt_i
\tag{5.17}
\end{align}\]</span></p>
<p>指数分布的均值为 <span class="math inline">\(\mu = \lambda^{−1}\)</span>,因此 <span class="math inline">\(\mu\)</span> 的最大似然估计为</p>
<p><span class="math display">\[\hat{\mu}=\hat{\lambda}^{-1}=\frac1r\sum_{i=1}^nt_i\]</span></p>
<p><span class="math inline">\(\mu\)</span> 的估计是数据集中 <span class="math inline">\(n\)</span> 个个体的总生存时间除以观测死亡人数。因此,该估计具有直观的吸引力,可以作为删失生存数据中平均寿命的估计。</p>
<p>使用附录 <a href="A.html#A">A</a> 给出的最大似然估计理论的结果,可以从对数似然函数的二阶导数中获得标准误。<span class="math inline">\(\log L(\lambda)\)</span> 的二阶导数给出</p>
<p><span class="math display">\[\begin{aligned}\frac{\mathrm{d}^2\log L(\lambda)}{\mathrm{d}\lambda^2}&=-\frac r{\lambda^2}\end{aligned}\]</span></p>
<p>因此,<span class="math inline">\(\hat \lambda\)</span> 的渐近方差为</p>
<p><span class="math display">\[\begin{aligned}\operatorname{var}\left(\hat{\lambda}\right)=\left\{-\operatorname{E}\left(\frac{\mathrm{d}^2\log L(\lambda)}{\mathrm{d}\lambda^2}\right)\right\}^{-1}=\frac{\lambda^2}r\end{aligned}\]</span></p>
<p>因此,<span class="math inline">\(\hat \lambda\)</span> 的标准误为:</p>
<p><span class="math display" id="eq:5-18">\[\begin{align}
\text{se }(\hat{\lambda})=\hat{\lambda}/√r
\tag{5.18}
\end{align}\]</span></p>
<p>该结果可用于获得平均生存时间的置信区间。具体来说,<span class="math inline">\(\lambda\)</span> 的 <span class="math inline">\(100(1−\alpha)\%\)</span> 置信区间的上下限为:<span class="math inline">\(\hat{\lambda}\pm z_{\alpha/2}\text{se}(\hat{\lambda})\)</span>,其中 <span class="math inline">\(z_{\alpha/2}\)</span> 是标准正态分布的上 <span class="math inline">\(\alpha/2\)</span> 分位点。</p>
<p>在呈现生存分析的结果时,生存函数和风险函数的估计,以及生存时间分布的中位数和其他百分位数是有用的。一旦得到 <span class="math inline">\(\lambda\)</span> 的估计,就可以使用 <a href="chap5.html#sec5-1-1">5.1.1</a> 节中给出的结果来估计所有这些函数。具体来说是,在假设的指数分布下,风险函数估计为 <span class="math inline">\(\hat{h}(t)=\hat{\lambda}\)</span>,而生存函数估计为 <span class="math inline">\(\hat{S}(t)=\exp(-\hat{\lambda}t)\)</span>。此外,第 <span class="math inline">\(p\)</span> 个百分位数估计为</p>
<p><span class="math display" id="eq:5-19">\[\begin{align}
\hat{t}(p)&=\frac{1}{\hat{\lambda}}\log\left(\frac{100}{100-p}\right)
\tag{5.19}
\end{align}\]</span></p>
<p>中位生存时间估计为</p>
<p><span class="math display" id="eq:5-20">\[\begin{align}
\hat{t}(50)=\hat{\lambda}^{-1}\log2
\tag{5.20}
\end{align}\]</span></p>
<p>使用第 2 章式 <a href="chap2.html#eq:2-8">(2.8)</a> 给出的随机变量函数近似方差的结果,可以得到生存时间分布第 <span class="math inline">\(p\)</span> 个百分位数估计的标准误。根据该结果,对 <span class="math inline">\(\hat \lambda\)</span> 的函数 <span class="math inline">\(g(\hat{\lambda})\)</span> 的方差的近似为</p>
<p><span class="math display" id="eq:5-21">\[\begin{align}
\text{var}\left\{g(\hat{\lambda})\right\}\approx\left\{\frac{\text{d}g(\hat{\lambda})}{\text{d}\hat{\lambda}}\right\}^2\text{ var}\left(\hat{\lambda}\right)
\tag{5.21}
\end{align}\]</span></p>
<p>使用该结果,第 <span class="math inline">\(p\)</span> 个百分位数估计的近似方差为</p>
<p><span class="math display">\[\begin{aligned}\operatorname{var}\left\{\hat{t}(p)\right\}&\approx\left\{-\frac{1}{\hat{\lambda}^2}\log\left(\frac{100}{100-p}\right)\right\}^2\operatorname{var}\left(\hat{\lambda}\right)\end{aligned}\]</span></p>
<p>开平方得到</p>
<p><span class="math display">\[\begin{aligned}\text{se}\left\{\hat{t}(p)\right\}&=\frac{1}{\hat{\lambda}^{2}}\log\left(\frac{100}{100-p}\right)\text{ se}\left(\hat{\lambda}\right)\end{aligned}\]</span></p>