-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchap5.html
1546 lines (1403 loc) · 227 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 章 标准联合模型的扩展 | 纵向与事件时间数据的联合模型及其在 R 中的应用</title>
<meta name="author" content="Wang Zhen">
<meta name="description" content="本章介绍了第 5 章中介绍的标准联合模型的几个扩展。其中包括纵向和事件结果之间关联结构参数化的几个族,包括外源时依协变量和分层因素(观测的或潜在的),用加速失效时间模型代替相对风险模型,以及多个失效时间与多个纵向响应的联合模型。尽管我们试图全面介绍文献中提出的联合模型的大多数扩展,但我们只详细介绍 R 中目前可用的方法。 5.1 参数化 在上一章介绍的标准联合模型中,假定特定时间点...">
<meta name="generator" content="bookdown 0.38 with bs4_book()">
<meta property="og:title" content="第 5 章 标准联合模型的扩展 | 纵向与事件时间数据的联合模型及其在 R 中的应用">
<meta property="og:type" content="book">
<meta property="og:description" content="本章介绍了第 5 章中介绍的标准联合模型的几个扩展。其中包括纵向和事件结果之间关联结构参数化的几个族,包括外源时依协变量和分层因素(观测的或潜在的),用加速失效时间模型代替相对风险模型,以及多个失效时间与多个纵向响应的联合模型。尽管我们试图全面介绍文献中提出的联合模型的大多数扩展,但我们只详细介绍 R 中目前可用的方法。 5.1 参数化 在上一章介绍的标准联合模型中,假定特定时间点...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="第 5 章 标准联合模型的扩展 | 纵向与事件时间数据的联合模型及其在 R 中的应用">
<meta name="twitter:description" content="本章介绍了第 5 章中介绍的标准联合模型的几个扩展。其中包括纵向和事件结果之间关联结构参数化的几个族,包括外源时依协变量和分层因素(观测的或潜在的),用加速失效时间模型代替相对风险模型,以及多个失效时间与多个纵向响应的联合模型。尽管我们试图全面介绍文献中提出的联合模型的大多数扩展,但我们只详细介绍 R 中目前可用的方法。 5.1 参数化 在上一章介绍的标准联合模型中,假定特定时间点...">
<!-- 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="">纵向与事件时间数据的联合模型及其在 R 中的应用</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="%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> 事件时间数据分析</a></li>
<li><a class="" href="chap4.html"><span class="header-section-number">4</span> 纵向与事件时间数据的联合模型</a></li>
<li><a class="active" href="chap5.html"><span class="header-section-number">5</span> 标准联合模型的扩展</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 class="book-part">附录</li>
<li><a class="" href="A.html"><span class="header-section-number">A</span> R 的简要介绍</a></li>
<li class="book-part">—</li>
<li><a class="" href="bib.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>本章介绍了第 <a href="chap5.html#chap5">5</a> 章中介绍的标准联合模型的几个扩展。其中包括纵向和事件结果之间关联结构参数化的几个族,包括外源时依协变量和分层因素(观测的或潜在的),用加速失效时间模型代替相对风险模型,以及多个失效时间与多个纵向响应的联合模型。尽管我们试图全面介绍文献中提出的联合模型的大多数扩展,但我们只详细介绍 <code>R</code> 中目前可用的方法。</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>在上一章介绍的标准联合模型中,假定特定时间点 <span class="math inline">\(t\)</span> 的事件风险取决于同一时间点纵向标志物的真实水平。标志物的当前水平与风险之间的关联强度由参数 <span class="math inline">\(\alpha\)</span> 捕获。尽管这是一个非常直观且有吸引力的参数化,并且对 <span class="math inline">\(\alpha\)</span> 有清晰的解释,但期望该参数化始终最适合表达两个过程之间的正确关系是不现实的。这是因为,通常情况下,时依协变量比基线协变量更难处理。具体来说,时依协变量函数形式的选择通常需要仔细考虑,它可能会对导出的结果产生重大影响。例如,仅考虑与事件风险相关的时变协变量的当前值,可能会错过纵向标志物与生存结果之间更复杂的关联形式,或导致病因学上错误的结论 (Vacek, 1997). 关于这些问题的更详细的讨论,可参考 Fisher and Lin (1999) 以及 Wolkewitz et al. (2010).</p>
<p>在本节中,我们提出几种替代的参数化,它们以不同方式扩展标准参数化 <a href="chap4.html#eq:4-1">(4.1)</a>。这些不同的参数化可视为以下纵向标志物与事件风险之间的关联结构的一般表述的特殊情况</p>
<p><span class="math display" id="eq:5-1">\[\begin{align}
h_i(t)=h_0(t)\exp\bigl[\gamma^\top w_{i1}+f\{m_i(t-c),b_i,w_{i2};\alpha\}\bigr]
\tag{5.1}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(f(\cdot)\)</span> 是标志物的真实水平 <span class="math inline">\(m_i(\cdot)\)</span>、随机效应 <span class="math inline">\(b_i\)</span> 和额外协变量 <span class="math inline">\(w_{i2}\)</span> 的函数。在该一般公式下,<span class="math inline">\(\alpha\)</span> 可以潜在地表示关联参数的向量,而不是 <a href="chap4.html#eq:4-1">(4.1)</a> 中单纯的标量。</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>标准参数化 <a href="chap4.html#eq:4-1">(4.1)</a> 假定标记物真实水平的效应在目标人群的所有亚组中是相同的。这显然是一个很强的假设,当标志物对于不同的受试者亚组表现不同时,该假设可能不正确。处理这种情况的一个直接扩展是在相对风险模型的线性预测器中包含标志物与感兴趣的基线协变量的交互项,即</p>
<p><span class="math display" id="eq:5-2">\[\begin{align}
h_i(t)=h_0(t)\exp\bigl[\gamma^\top w_{i1}+\alpha^\top\{w_{i2}\times m_i(t)\}\bigr]
\tag{5.2}
\end{align}\]</span></p>
<p>其中,如前所述,<span class="math inline">\(w_{i1}\)</span> 用于适应基线协变量对事件风险的直接效应,<span class="math inline">\(w_{i2}\)</span> 包含交互项,这些交互项扩展了 <span class="math inline">\(m_i(t)\)</span> 在不同亚组中的关联。当 <span class="math inline">\(w_{i2}\)</span> 仅包含常数项,即 <span class="math inline">\(w_{i2}=1\)</span> 时,<a href="chap5.html#eq:5-2">(5.2)</a> 简化为标准参数化 <a href="chap4.html#eq:4-1">(4.1)</a>。</p>
<p>为了说明如何在 <code>R</code> 中拟合这样的联合模型,我们针对 PBC 数据集研究了血清胆红素的真实水平与死亡风险之间的关联强度对于患有和不患有肝肿大的患者是否不同。具体来说,对于纵向结果,我们假定每个患者的血清胆红素水平随时间呈二次演变,并且不同治疗组的患者具有不同的平均效应,从而采用线性混合模型</p>
<p><span class="math display">\[\begin{array}{rcl}y_i(t)&=&\beta_0+\beta_1\mathtt{D}\text{-}\mathtt{pnc}_i+\beta_2t+\beta_3t^2+\beta_4\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t\}+\beta_5\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t^2\}\\&&+b_{i0}+b_{i1}t+b_{i2}t^2+\varepsilon_i(t),\end{array}\]</span></p>
<p>其中 <span class="math inline">\(y_i(t)\)</span> 表示观测血清胆红素水平的对数,并且 <span class="math inline">\(\mathtt{D}\text{-}\mathtt{pnc}_i\)</span> 是 D-青霉胺组的虚拟变量。对于生存部分,我们包括了治疗效应、肝肿大和血清胆红素真实水平的对数,此外,我们允许胆红素与肝肿大和非肝肿大患者的死亡风险之间存在不同的关联强度</p>
<p><span class="math display">\[h_i(t)=h_0(t)\exp\bigl[\gamma_1\mathtt{D}\text{-}\mathtt{pnc}_i+\gamma_2\mathtt{HepMeg}_i+\alpha_1m_i(t)+\alpha_2\bigl\{\mathtt{HepMeg}_i\times m_i(t)\bigr\}\bigr]\]</span></p>
<p>其中 <span class="math inline">\(\mathtt{HepMeg}_i\)</span> 是肝肿大患者的虚拟变量。假定基线风险函数 <span class="math inline">\(h_0(\cdot)\)</span> 是分段常数的。PBC 数据集中患者的纵向信息可在 <code>JM</code> 包中作为数据框 <code>pbc2</code> 获得,生存信息作为数据框 <code>pbc2.id</code> 提供。为了拟合联合模型,正如我们之前所看到的,我们首先需要分别拟合线性混合模型和 Cox 模型以及相应的协变量结构。对于后者,我们只需要包含线性预测器 <span class="math inline">\(\gamma^\top w_{i1}\)</span>,即</p>
<div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb47-1"><a href="chap5.html#cb47-1" tabindex="-1"></a><span class="sc">></span> lmeFit.pbc <span class="ot"><-</span> <span class="fu">lme</span>(<span class="fu">log</span>(serBilir) <span class="sc">~</span> drug <span class="sc">*</span> (year <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">2</span>)),</span>
<span id="cb47-2"><a href="chap5.html#cb47-2" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> year <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">2</span>) <span class="sc">|</span> id, <span class="at">data =</span> pbc2)</span>
<span id="cb47-3"><a href="chap5.html#cb47-3" tabindex="-1"></a><span class="sc">></span> coxFit.pbc <span class="ot"><-</span> <span class="fu">coxph</span>(<span class="fu">Surv</span>(years, status2) <span class="sc">~</span> drug <span class="sc">+</span> hepatomegaly,</span>
<span id="cb47-4"><a href="chap5.html#cb47-4" tabindex="-1"></a> <span class="at">data =</span> pbc2.id, <span class="at">x =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>如 <a href="chap3.html#sec3-3">3.3</a> 节所示,<code>status2</code> 是复合事件(移植或死亡)的指示符。为了将交互部分 <span class="math inline">\(\alpha^\top\{w_{i2}\times m_i(t)\}\)</span> 包含在相应联合模型的线性预测器中,我们利用了 <code>jointModel()</code> 的 <code>interFact</code> 参数。该参数接受一个命名的列表:包含一个名为 <code>value</code> 的组件,该组件提供指定 <span class="math inline">\(W_2\)</span> 设计矩阵形式的 <code>R</code> 公式,以及一个名为 <code>data</code> 的组件,指定要应用该公式的数据框。对于我们的特定示例,我们使用语法<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content="<p>译者注:需拟合较长时间;且结果与原书不同。</p>"><sup>13</sup></a></p>
<div class="sourceCode" id="cb48"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb48-1"><a href="chap5.html#cb48-1" tabindex="-1"></a><span class="sc">></span> jointFit.pbc <span class="ot"><-</span> <span class="fu">jointModel</span>(lmeFit.pbc, coxFit.pbc, <span class="at">timeVar =</span> <span class="st">"year"</span>,</span>
<span id="cb48-2"><a href="chap5.html#cb48-2" tabindex="-1"></a> <span class="at">method =</span> <span class="st">"piecewise-PH-aGH"</span>,</span>
<span id="cb48-3"><a href="chap5.html#cb48-3" tabindex="-1"></a> <span class="at">interFact =</span> <span class="fu">list</span>(<span class="at">value =</span> <span class="sc">~</span> hepatomegaly,</span>
<span id="cb48-4"><a href="chap5.html#cb48-4" tabindex="-1"></a> <span class="at">data =</span> pbc2.id))</span>
<span id="cb48-5"><a href="chap5.html#cb48-5" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit.pbc)</span>
<span id="cb48-6"><a href="chap5.html#cb48-6" tabindex="-1"></a></span>
<span id="cb48-7"><a href="chap5.html#cb48-7" tabindex="-1"></a>. . .</span>
<span id="cb48-8"><a href="chap5.html#cb48-8" tabindex="-1"></a></span>
<span id="cb48-9"><a href="chap5.html#cb48-9" tabindex="-1"></a>Event Process</span>
<span id="cb48-10"><a href="chap5.html#cb48-10" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb48-11"><a href="chap5.html#cb48-11" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="fl">0.0882</span> <span class="fl">0.1677</span> <span class="fl">0.5263</span> <span class="fl">0.5987</span></span>
<span id="cb48-12"><a href="chap5.html#cb48-12" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.2288</span> <span class="fl">0.4112</span> <span class="fl">0.5566</span> <span class="fl">0.5778</span></span>
<span id="cb48-13"><a href="chap5.html#cb48-13" tabindex="-1"></a>Assoct <span class="fl">1.1562</span> <span class="fl">0.1286</span> <span class="fl">8.9900</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb48-14"><a href="chap5.html#cb48-14" tabindex="-1"></a>Assoct<span class="sc">:</span>hepatomegalyYes <span class="fl">0.2353</span> <span class="fl">0.1850</span> <span class="fl">1.2722</span> <span class="fl">0.2033</span></span>
<span id="cb48-15"><a href="chap5.html#cb48-15" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">4.7939</span> <span class="fl">0.3297</span> <span class="sc">-</span><span class="fl">14.5386</span></span>
<span id="cb48-16"><a href="chap5.html#cb48-16" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">4.4271</span> <span class="fl">0.3326</span> <span class="sc">-</span><span class="fl">13.3117</span></span>
<span id="cb48-17"><a href="chap5.html#cb48-17" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">4.3962</span> <span class="fl">0.3543</span> <span class="sc">-</span><span class="fl">12.4092</span></span>
<span id="cb48-18"><a href="chap5.html#cb48-18" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">4.2151</span> <span class="fl">0.3794</span> <span class="sc">-</span><span class="fl">11.1102</span></span>
<span id="cb48-19"><a href="chap5.html#cb48-19" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">4.2400</span> <span class="fl">0.3824</span> <span class="sc">-</span><span class="fl">11.0890</span></span>
<span id="cb48-20"><a href="chap5.html#cb48-20" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">4.0540</span> <span class="fl">0.4018</span> <span class="sc">-</span><span class="fl">10.0905</span></span>
<span id="cb48-21"><a href="chap5.html#cb48-21" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.7</span>) <span class="sc">-</span><span class="fl">4.6011</span> <span class="fl">0.5146</span> <span class="sc">-</span><span class="fl">8.9419</span></span>
<span id="cb48-22"><a href="chap5.html#cb48-22" tabindex="-1"></a>. . .</span></code></pre></div>
<p>我们观察到,血清胆红素确实与死亡风险密切相关。血清胆红素对数的当前值每增加一个单位,无肝肿大患者的风险就会增加为原来的 <span class="math inline">\(\exp(1.1562)=3.2\)</span> 倍 (95%CI: 2.5, 4.1),有肝肿大患者风险就会增加为原来的 <span class="math inline">\(\exp(1.1563+0.2353)=4\)</span> 倍 (95%CI: 3.1, 5.2).</p>
</div>
<div id="sec5-1-2" class="section level3" number="5.1.2">
<h3>
<span class="header-section-number">5.1.2</span> 滞后效应<a class="anchor" aria-label="anchor" href="#sec5-1-2"><i class="fas fa-link"></i></a>
</h3>
<p>在某些情况下,时依协变量的当前值影响事件当前风险的典型假设可能会得到医学上不合逻辑的结论。例如,Cavender et al. (1992) 观察到了这一点,他在一项关于冠状动脉疾病患者的研究中指出,目前的吸烟状态降低了死亡风险(尽管没有统计学意义)。这一令人惊讶的结果背后的原因是,大多数死亡者都是吸烟者,但许多人在去世前的最后一次随访中已经戒烟。因此,许多死亡的患者刚刚戒烟,而一些还活着的患者仍在吸烟,这得到了令人惊讶的结果。</p>
<p>解决这种情况的一种方法是使用时滞 (time-lagged) 协变量。具体来说,我们使用以下相对风险模型的公式</p>
<p><span class="math display" id="eq:5-3">\[\begin{align}
h_i(t)=h_0(t)\exp\bigl[\gamma^\top w_i+\alpha m_i\{\max(t-c,0)\}\bigr]
\tag{5.3}
\end{align}\]</span></p>
<p>它假设时间 <span class="math inline">\(t\)</span> 的风险取决于纵向标志物在时间 <span class="math inline">\(t−c\)</span> 的真实值,其中 <span class="math inline">\(c\)</span> 指定了感兴趣的时间滞后。使用函数 <code>jointModel()</code> 的 <code>lag</code> 参数,可以轻松地将这种滞后效应纳入 <code>R</code> 的联合模型的指定中。例如,我们将联合模型拟合到肝硬化数据集中。对于纵向部分,为了灵活指定特定于受试者的纵向轨迹,我们假定了一个具有自然立方样条曲线效应的线性混合模型,每个治疗组具有不同的平均曲线。此外,为了捕捉每个治疗组随访早期凝血酶原指数的突然变化,我们还包括了一个单独的基线测量指示变量。模型采用以下形式</p>
<p><span class="math display">\[\begin{aligned}
y_i(t) =&\quad m_i(t)+\varepsilon_i(t) \\
=&\quad (\beta_0+b_{i0})+(\beta_1+b_{i1})B_n(t,\lambda_1)+(\beta_2+b_{i2})B_n(t,\lambda_2) \\
&+(\beta_3+b_{i3})B_n(t,\lambda_3)+\beta_4\{B_n(t,\lambda_1)\times\mathtt{Predns}_i\}\\
&+\beta_5\{B_n(t,\lambda_2)\times\mathtt{Predns}_i\}+\beta_6\{B_n(t,\lambda_3)\times\mathtt{Predns}_i\} \\
&+\beta_7\mathtt{Predns}_i+\beta_8\mathtt{T0}_i+\beta_9\{\mathtt{Predns}_i\times\mathtt{T0}_i\}+\varepsilon_i(t),
\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(y_i(t)\)</span> 表示凝血酶原指数,<span class="math inline">\(\{B_n(t,\lambda_k);k=1,2,3\}\)</span> 为时间自然立方样条的 B 样条基矩阵,其中两个内部结分别位于随访时间的 33.3% 和 66.7% 百分位处,<span class="math inline">\(\mathtt{Predns}\)</span> 是泼尼松的指示变量,<span class="math inline">\(\mathtt{T0}\)</span> 是基线时间的指示变量。假定随机效应具有对角协方差阵。凝血酶原指数的纵向响应可在数据框 <code>prothro</code> 中获得;我们使用如下语法来拟合模型</p>
<div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb49-1"><a href="chap5.html#cb49-1" tabindex="-1"></a><span class="sc">></span> prothro<span class="sc">$</span>t0 <span class="ot"><-</span> <span class="fu">as.numeric</span>(prothro<span class="sc">$</span>time <span class="sc">==</span> <span class="dv">0</span>)</span>
<span id="cb49-2"><a href="chap5.html#cb49-2" tabindex="-1"></a><span class="sc">></span> lmeFit.pro <span class="ot"><-</span> <span class="fu">lme</span>(pro <span class="sc">~</span> treat <span class="sc">*</span> (<span class="fu">ns</span>(time, <span class="dv">3</span>) <span class="sc">+</span> t0),</span>
<span id="cb49-3"><a href="chap5.html#cb49-3" tabindex="-1"></a> <span class="at">random =</span> <span class="fu">list</span>(<span class="at">id =</span> <span class="fu">pdDiag</span>(<span class="at">form =</span> <span class="sc">~</span> <span class="fu">ns</span>(time, <span class="dv">3</span>))),</span>
<span id="cb49-4"><a href="chap5.html#cb49-4" tabindex="-1"></a> <span class="at">data =</span> prothro)</span></code></pre></div>
<p>在生存子模型中,我们校正治疗并比较时依凝血酶原指数的两种公式。在第一个公式中,我们假定死亡风险取决于凝血酶原的当前值,而在第二个公式中,我们假定这取决于两年前的凝血酶原值,两个公式分别为</p>
<p><span class="math display">\[\begin{array}{rcl}h_i(t)&=&h_0(t)\exp\{\gamma\mathtt{Predns}_i+\alpha m_i(t)\}\\h_i(t)&=&h_0(t)\exp\bigl[\gamma\mathtt{Predns}_i+\alpha m_i\{\max(t-2,0)\}\bigr]\end{array}\]</span></p>
<p>和之前一样,在拟合联合模型之前,我们首先需要拟合仅包含基线协变量部分的 Cox 模型,在本例中为治疗;相应的语法为</p>
<div class="sourceCode" id="cb50"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb50-1"><a href="chap5.html#cb50-1" tabindex="-1"></a><span class="sc">></span> coxFit.pro <span class="ot"><-</span> <span class="fu">coxph</span>(<span class="fu">Surv</span>(Time, death) <span class="sc">~</span> treat, <span class="at">data =</span> prothros,</span>
<span id="cb50-2"><a href="chap5.html#cb50-2" tabindex="-1"></a> <span class="at">x =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>其中 <code>prothros</code> 是存储了生存信息的数据框。第一个联合模型是通过对 <code>jointModel()</code> 的标准调用来拟合的,正如我们到目前为止所使用的那样<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content="<p>拟合需较长时间。</p>"><sup>14</sup></a></p>
<div class="sourceCode" id="cb51"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb51-1"><a href="chap5.html#cb51-1" tabindex="-1"></a><span class="sc">></span> jointFit.pro <span class="ot"><-</span> <span class="fu">jointModel</span>(lmeFit.pro, coxFit.pro, <span class="at">timeVar =</span> <span class="st">"time"</span>,</span>
<span id="cb51-2"><a href="chap5.html#cb51-2" tabindex="-1"></a> <span class="at">method =</span> <span class="st">"piecewise-PH-aGH"</span>)</span></code></pre></div>
<p>为了拟合第二个联合模型,我们使用参数 <code>lag</code> 来指定感兴趣的滞后。此外,由于与之前调用 <code>jointModel()</code> 的唯一区别是 <code>lag</code> 参数的额外指定,因此我们可以通过使用 <code><a href="https://rdrr.io/r/stats/update.html">update()</a></code> 函数更新之前的拟合来轻松拟合新的联合模型</p>
<div class="sourceCode" id="cb52"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb52-1"><a href="chap5.html#cb52-1" tabindex="-1"></a><span class="sc">></span> jointFit2.pro <span class="ot"><-</span> <span class="fu">update</span>(jointFit.pro, <span class="at">lag =</span> <span class="dv">2</span>)</span></code></pre></div>
<p>我们关注主要感兴趣的参数,即生存子模型 <span class="math inline">\(\gamma\)</span> 和 <span class="math inline">\(\alpha\)</span> 的参数,并比较两种参数化下的渐近 95% 置信区间。</p>
<div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb53-1"><a href="chap5.html#cb53-1" tabindex="-1"></a><span class="sc">></span> <span class="fu">confint</span>(jointFit.pro, <span class="at">parm =</span> <span class="st">"Event"</span>)</span>
<span id="cb53-2"><a href="chap5.html#cb53-2" tabindex="-1"></a> <span class="fl">2.5</span> <span class="sc">% est. 97.5 %</span></span>
<span id="cb53-3"><a href="chap5.html#cb53-3" tabindex="-1"></a>treatprednisone <span class="fl">0.10149968</span> <span class="fl">0.42367775</span> <span class="fl">0.74585581</span></span>
<span id="cb53-4"><a href="chap5.html#cb53-4" tabindex="-1"></a>Assoct <span class="sc">-</span><span class="fl">0.04775799</span> <span class="sc">-</span><span class="fl">0.04059136</span> <span class="sc">-</span><span class="fl">0.03342473</span></span>
<span id="cb53-5"><a href="chap5.html#cb53-5" tabindex="-1"></a></span>
<span id="cb53-6"><a href="chap5.html#cb53-6" tabindex="-1"></a><span class="sc">></span> <span class="fu">confint</span>(jointFit2.pro, <span class="at">parm =</span> <span class="st">"Event"</span>)</span>
<span id="cb53-7"><a href="chap5.html#cb53-7" tabindex="-1"></a> <span class="fl">2.5</span> <span class="sc">% est. 97.5 %</span></span>
<span id="cb53-8"><a href="chap5.html#cb53-8" tabindex="-1"></a>treatprednisone <span class="sc">-</span><span class="fl">0.04759691</span> <span class="fl">0.22698288</span> <span class="fl">0.50156268</span></span>
<span id="cb53-9"><a href="chap5.html#cb53-9" tabindex="-1"></a><span class="fu">Assoct</span>(<span class="at">lag=</span><span class="dv">2</span>) <span class="sc">-</span><span class="fl">0.04638202</span> <span class="sc">-</span><span class="fl">0.03859134</span> <span class="sc">-</span><span class="fl">0.03080066</span></span></code></pre></div>
<p>对于关联参数,我们观察到两种制剂在时依凝血酶原指数方面的差异相对较小。然而,无滞后效应(<span class="math inline">\(c=0\)</span>)的治疗效应大约是滞后两年(<span class="math inline">\(c=2\)</span>)的两倍,尽管在两个参数化下都不显著。为了对这两个模型进行统计上的比较,我们需要使用 <a href="chap4.html#sec4-4">4.4</a> 节介绍的信息准则,因为这两个模型没有嵌套。我们使用 <code><a href="https://rdrr.io/r/stats/anova.html">anova()</a></code> 函数执行此比较,在该函数中,我们使用 <code>test</code> 参数明确指定不希望执行似然比检验。</p>
<div class="sourceCode" id="cb54"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb54-1"><a href="chap5.html#cb54-1" tabindex="-1"></a><span class="sc">></span> <span class="fu">anova</span>(jointFit.pro, jointFit2.pro, <span class="at">test =</span> <span class="cn">FALSE</span>)</span>
<span id="cb54-2"><a href="chap5.html#cb54-2" tabindex="-1"></a> AIC BIC log.Lik df</span>
<span id="cb54-3"><a href="chap5.html#cb54-3" tabindex="-1"></a>jointFit.pro <span class="fl">27918.33</span> <span class="fl">28018.90</span> <span class="sc">-</span><span class="fl">13935.17</span> </span>
<span id="cb54-4"><a href="chap5.html#cb54-4" tabindex="-1"></a>jointFit2.pro <span class="fl">27407.45</span> <span class="fl">27508.01</span> <span class="sc">-</span><span class="fl">13679.72</span> <span class="dv">0</span></span></code></pre></div>
<p>AIC 和 BIC 的结果是一致的,具有滞后时依凝血酶原指数的联合模型比假定该指数的当前值与死亡风险相关的模型具有更好的预测能力。</p>
</div>
<div id="sec5-1-3" class="section level3" number="5.1.3">
<h3>
<span class="header-section-number">5.1.3</span> 时依斜率参数化<a class="anchor" aria-label="anchor" href="#sec5-1-3"><i class="fas fa-link"></i></a>
</h3>
<p>在前面的参数化中,我们假定事件的风险取决于纵向标志物的当前值或先前值。然而,由于对于每个患者,标志物都遵循关于时间的轨迹,因此考虑允许事件风险也取决于该轨迹的其他特征的参数化也是合理的。Ye et al. (2008b) 考虑了这种类型的参数化,他们假定了一个联合模型,其中风险取决于轨迹的当前真实值和时间 <span class="math inline">\(t\)</span> 时真实轨迹的斜率。图 5.1 给出了该参数化的图形表示。更具体地说,相对风险生存子模型采用以下形式</p>
<p><span class="math display" id="eq:5-4">\[\begin{align}
h_i(t)=h_0(t)\exp\bigl\{\gamma^\top w_i+\alpha_1m_i(t)+\alpha_2m_i'(t)\bigr\}
\tag{5.4}
\end{align}\]</span></p>
<p>其中</p>
<p><span class="math display">\[\begin{aligned}m_i'(t)=\frac{d}{dt}m_i(t)=\frac{d}{dt}\{x_i^\top(t)\beta+z_i^\top(t)b_i\}\end{aligned}\]</span></p>
<details><summary><font color="#B95953">图 5.1</font>
</summary><img src="figure/figure%205.1.png#center" style="width:80.0%"></details><p><br>
参数 <span class="math inline">\(\alpha_1\)</span> 的解释与标准参数化 <a href="chap4.html#eq:4-1">(4.1)</a> 中的解释相同。参数 <span class="math inline">\(\alpha_2\)</span> 度量时间 <span class="math inline">\(t\)</span> 时真实纵向轨迹的斜率值与同一时间点事件风险的关联强度,前提是 <span class="math inline">\(m_i(t)\)</span> 保持不变。这种参数化可以捕捉这样的情况,例如,在特定时间点,两名患者显示相似的真实标志物水平,但他们的标志物变化率可能不同。</p>
<p>为了研究 <a href="chap5.html#sec5-1-1">5.1.1</a> 节中介绍的 PBC 数据集参数化的额外值,我们用更新的生存子模型重新拟合了联合模型,该子模型形如</p>
<p><span class="math display">\[h_i(t)=h_0(t)\exp\bigl\{\gamma_1\mathtt{D}\text{-}\mathtt{pnc}_i+\gamma_2\mathtt{HepMeg}_i+\alpha_1m_i(t)+\alpha_2m_i'(t)\bigr\}\]</span></p>
<p>其中我们排除了血清胆红素与肝肿大的交互作用项,并包括了时依斜率。我们首先重新拟合第 <a href="chap5.html#sec5-1-1">5.1.1</a> 节中提出的联合模型,排除交互项,即</p>
<div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb55-1"><a href="chap5.html#cb55-1" tabindex="-1"></a><span class="sc">></span> jointFit2.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit.pbc, <span class="at">interFact =</span> <span class="cn">NULL</span>)</span></code></pre></div>
<p>为了包含时依斜率项,我们使用 <code>jointModel()</code> 的 <code>parameterization</code> 和 <code>derivForm</code> 参数。具体来说,<code>parameterization</code> 参数指定了我们感兴趣的参数化类型,默认为标志物的当前值。这里我们需要当前值和斜率,因此我们指定为选项 <code>"both"</code>。在 <code>derivForm</code> 参数中,我们必须使用 <code>R</code> 的公式接口指定轨迹导数的函数形式。在拟合 PBC 数据的线性混合效应子模型下,<span class="math inline">\(m_i(t)\)</span> 具有以下形式</p>
<p><span class="math display">\[\begin{array}{rcl}m_i(t)&=&\beta_0+\beta_1\mathtt{D}\text{-}\mathtt{pnc}_i+\beta_2t+\beta_3t^2+\beta_4\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t\}+\beta_5\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t^2\}\\&&+b_{i0}+b_{i1}t+b_{i2}t^2,\end{array}\]</span></p>
<p>对 <span class="math inline">\(t\)</span> 求导并化简</p>
<p><span class="math display">\[\begin{aligned}m_i'(t)=\beta_2+2\beta_3t+\beta_4\mathtt{D}\text{-}\mathtt{pnc}_i+2\beta_5\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t\}+b_{i1}+2b_{i2}t\end{aligned}\]</span></p>
<p>为了解释如何调用参数 <code>derivForm</code>,我们首先在混合效应模型结构下重写 <span class="math inline">\(m'_i (t)\)</span>,即</p>
<p><span class="math display">\[\begin{aligned}m'_i(t)=[x_i^{sl}(t)]^\top\beta^{sl}+[z_i^{sl}(t)]^\top b_i^{sl}\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(x_i^{sl}(t)=[1,2t,\mathtt{D}\text{-}\mathtt{pnc}_i,2(t\times\mathtt{D}\text{-}\mathtt{pnc}_i)]\)</span>,<span class="math inline">\(z_i^{sl}(t)=[1,\,2t]\)</span>,<span class="math inline">\(\beta^{sl}=(\beta_2,\beta_3,\beta_3,\beta_4)^\top\)</span> 以及 <span class="math inline">\(b_i^{sl}=(b_{i1},b_{i2})^\top\)</span>。使用该公式,参数 <code>derivForm</code> 被指定为具有四个组件的命名列表,即两个 <code>R</code> 公式,分别命名为 <code>fixed</code> 和 <code>random</code>,分别用于构造 <span class="math inline">\(m'_i (t)\)</span> 定义中的固定效应和随机效应设计矩阵,两个数值向量,分别命名为 <code>indFixed</code> 和 <code>indRandom</code>,指定原始的 <span class="math inline">\(m_i(t)\)</span> 的固定效应参数 <span class="math inline">\(\beta\)</span> 和随机效应 <span class="math inline">\(b_i\)</span> 中的哪些参与 <span class="math inline">\(m'_i (t)\)</span> 的指定。因此,对于我们的示例,<code>derivForm</code> 列表采用以下形式</p>
<div class="sourceCode" id="cb56"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb56-1"><a href="chap5.html#cb56-1" tabindex="-1"></a><span class="sc">></span> dform <span class="ot"><-</span> <span class="fu">list</span>(<span class="at">fixed =</span> <span class="sc">~</span> <span class="fu">I</span>(<span class="dv">2</span><span class="sc">*</span>year) <span class="sc">+</span> drug <span class="sc">+</span> <span class="fu">I</span>(<span class="dv">2</span><span class="sc">*</span>year)<span class="sc">:</span>drug,</span>
<span id="cb56-2"><a href="chap5.html#cb56-2" tabindex="-1"></a> <span class="at">indFixed =</span> <span class="dv">3</span><span class="sc">:</span><span class="dv">6</span>, <span class="at">random =</span> <span class="sc">~</span> <span class="fu">I</span>(<span class="dv">2</span><span class="sc">*</span>year), <span class="at">indRandom =</span> <span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>)</span></code></pre></div>
<p>其中 <code>indFixed = 3:6</code>,因为在上述 <span class="math inline">\(m'_i(t)\)</span> 的定义中,使用了 <span class="math inline">\(m_i(t)\)</span> 的第 3 至第 6 个固定效应参数,对于组件 <code>indRandom</code> 也类似。注意,默认情况下,用于构建设计矩阵的 <code>R</code> 公式包括截距项。相应联合模型的拟合为:</p>
<div class="sourceCode" id="cb57"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb57-1"><a href="chap5.html#cb57-1" tabindex="-1"></a><span class="sc">></span> jointFit3.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit2.pbc, <span class="at">parameterization =</span> <span class="st">"both"</span>,</span>
<span id="cb57-2"><a href="chap5.html#cb57-2" tabindex="-1"></a> <span class="at">derivForm =</span> dform)</span>
<span id="cb57-3"><a href="chap5.html#cb57-3" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit3.pbc)</span>
<span id="cb57-4"><a href="chap5.html#cb57-4" tabindex="-1"></a></span>
<span id="cb57-5"><a href="chap5.html#cb57-5" tabindex="-1"></a>. . .</span>
<span id="cb57-6"><a href="chap5.html#cb57-6" tabindex="-1"></a>Event Process</span>
<span id="cb57-7"><a href="chap5.html#cb57-7" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb57-8"><a href="chap5.html#cb57-8" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="fl">0.1751</span> <span class="fl">0.1972</span> <span class="fl">0.8878</span> <span class="fl">0.3746</span></span>
<span id="cb57-9"><a href="chap5.html#cb57-9" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.6011</span> <span class="fl">0.2103</span> <span class="fl">2.8576</span> <span class="fl">0.0043</span></span>
<span id="cb57-10"><a href="chap5.html#cb57-10" tabindex="-1"></a>Assoct <span class="fl">1.2181</span> <span class="fl">0.1166</span> <span class="fl">10.4507</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb57-11"><a href="chap5.html#cb57-11" tabindex="-1"></a>Assoct.s <span class="fl">2.8505</span> <span class="fl">0.6417</span> <span class="fl">4.4422</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb57-12"><a href="chap5.html#cb57-12" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">6.0564</span> <span class="fl">0.4565</span> <span class="sc">-</span><span class="fl">13.2661</span> </span>
<span id="cb57-13"><a href="chap5.html#cb57-13" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">5.5892</span> <span class="fl">0.4106</span> <span class="sc">-</span><span class="fl">13.6121</span> </span>
<span id="cb57-14"><a href="chap5.html#cb57-14" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">5.6825</span> <span class="fl">0.4242</span> <span class="sc">-</span><span class="fl">13.3956</span> </span>
<span id="cb57-15"><a href="chap5.html#cb57-15" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">5.5677</span> <span class="fl">0.4593</span> <span class="sc">-</span><span class="fl">12.1214</span> </span>
<span id="cb57-16"><a href="chap5.html#cb57-16" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">5.2350</span> <span class="fl">0.4189</span> <span class="sc">-</span><span class="fl">12.4968</span> </span>
<span id="cb57-17"><a href="chap5.html#cb57-17" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">5.0048</span> <span class="fl">0.4557</span> <span class="sc">-</span><span class="fl">10.9823</span> </span>
<span id="cb57-18"><a href="chap5.html#cb57-18" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.7</span>) <span class="sc">-</span><span class="fl">5.0677</span> <span class="fl">0.5328</span> <span class="sc">-</span><span class="fl">9.5108</span> </span>
<span id="cb57-19"><a href="chap5.html#cb57-19" tabindex="-1"></a>. . .</span></code></pre></div>
<p>我们观察到,输出中标记为 <code>Assect.s</code> 的轨迹斜率与死亡风险高度相关。具体来说,对于具有相同对数血清胆红素水平的患者,胆红素轨迹的当前斜率的单位增加的对数风险比为 2.5 (95%CI: 1.4, 3.7). 为了在统计上检验标志物的总体效应,我们可以使用 <code><a href="https://rdrr.io/r/stats/anova.html">anova()</a></code> 函数进行多元 Wald 检验。正如我们在 <a href="chap4.html#sec4-4">4.4</a> 节中所看到的,默认情况下,该函数将为模型中的所有参数提供边际 Wald 检验。在这里,我们重点关注事件过程</p>
<div class="sourceCode" id="cb58"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb58-1"><a href="chap5.html#cb58-1" tabindex="-1"></a><span class="sc">></span> <span class="fu">anova</span>(jointFit3.pbc, <span class="at">process =</span> <span class="st">"Event"</span>)</span>
<span id="cb58-2"><a href="chap5.html#cb58-2" tabindex="-1"></a></span>
<span id="cb58-3"><a href="chap5.html#cb58-3" tabindex="-1"></a>Marginal Wald Tests Table</span>
<span id="cb58-4"><a href="chap5.html#cb58-4" tabindex="-1"></a></span>
<span id="cb58-5"><a href="chap5.html#cb58-5" tabindex="-1"></a>Event Process</span>
<span id="cb58-6"><a href="chap5.html#cb58-6" tabindex="-1"></a> Chisq df <span class="fu">Pr</span>(<span class="sc">></span><span class="er">|</span>Chi<span class="sc">|</span>)</span>
<span id="cb58-7"><a href="chap5.html#cb58-7" tabindex="-1"></a>drug <span class="fl">0.7882</span> <span class="dv">1</span> <span class="fl">0.3746</span></span>
<span id="cb58-8"><a href="chap5.html#cb58-8" tabindex="-1"></a>hepatomegaly <span class="fl">8.1660</span> <span class="dv">1</span> <span class="fl">0.0043</span></span>
<span id="cb58-9"><a href="chap5.html#cb58-9" tabindex="-1"></a><span class="fu">Assoct</span>(all) <span class="fl">141.9891</span> <span class="dv">2</span> <span class="sc"><</span><span class="fl">1e-04</span></span>
<span id="cb58-10"><a href="chap5.html#cb58-10" tabindex="-1"></a>Assoct <span class="fl">109.2181</span> <span class="dv">1</span> <span class="sc"><</span><span class="fl">1e-04</span></span>
<span id="cb58-11"><a href="chap5.html#cb58-11" tabindex="-1"></a>Assoct.s <span class="fl">19.7330</span> <span class="dv">1</span> <span class="sc"><</span><span class="fl">1e-04</span></span></code></pre></div>
<p>与条目 <code>Assoct(all)</code> 相关的 <span class="math inline">\(p\)</span> 值对应于在模型 <a href="chap5.html#eq:5-4">(5.4)</a> 下检验如下的一组假设</p>
<p><span class="math display">\[\begin{aligned}H_0&:\alpha_1=\alpha_2=0\\H_a&:\alpha_1\neq0\quad\text{or}\quad\alpha_2\neq0\end{aligned}\]</span></p>
<p>结果验证了以下假设:对于 PBC 患者,血清胆红素对数的当前值和胆红素轨迹的斜率与复合事件(死亡或移植)的风险高度相关。</p>
</div>
<div id="sec5-1-4" class="section level3" number="5.1.4">
<h3>
<span class="header-section-number">5.1.4</span> 累积效应参数化<a class="anchor" aria-label="anchor" href="#sec5-1-4"><i class="fas fa-link"></i></a>
</h3>
<p>到目前为止,我们看到的所有参数化的一个共同特征是,它们假定特定时间事件的风险仅取决于单个时间点的纵向轨迹的特征。也就是说,根据真实标志物水平 <span class="math inline">\(\mathcal{M}_i(t)=\{m_i(s),0\leq s<t\}\)</span> 的整个历史,如果像 <a href="chap5.html#sec5-1-2">5.1.2</a> 节那样考虑滞后效应,则时间 <span class="math inline">\(t\)</span> 的风险通常假定取决于同一时间点的标志物水平 <span class="math inline">\(m_i(t)\)</span> 或前一个时间点的标志物水平 <span class="math inline">\(m_i(t − c)\)</span>。然而,一些作者认为,这种假定并不总是现实的,在许多情况下,允许风险依赖于纵向标志物历史的更详细的函数可能会使我们受益 (Sylvestre and Abrahamowicz, 2009; Hauptmann et al., 2000; Vacek, 1997).</p>
<p>允许标志物的整个历史与事件的风险相关联的一种方法是在相对风险子模型的线性预测器中包括纵向轨迹的积分,该积分表示直到时间点 <span class="math inline">\(t\)</span> 的纵向结果的累积效应。图 5.2 给出了该参数的图形表示。更具体地说,生存子模型采用以下形式</p>
<p><span class="math display" id="eq:5-5">\[\begin{align}
h_i(t)=h_0(t)\exp\Bigl\{\gamma^\top w_i+\alpha\int_0^tm_i(s)ds\Bigr\}
\tag{5.5}
\end{align}\]</span></p>
<details><summary><font color="#B95953">图 5.2</font>
</summary><img src="figure/figure%205.2.png#center" style="width:80.0%"></details><p><br>
其中,对于任何特定的时间点 <span class="math inline">\(t\)</span>,<span class="math inline">\(\alpha\)</span> 度量在时间点 <span class="math inline">\(t\)</span> 的事件风险与直到相同时间纵向轨迹下面积之间的关联强度,并且将纵向轨迹下面积视为整个轨迹的适当总结。为了在这种参数化下拟合联合模型,我们可以利用 <code>jointModel()</code> 的 <code>derivForm</code> 参数提供的灵活性来指定要添加到生存子模型线性预测器中的额外标志物项。具体来说,我们没有像 <a href="chap5.html#sec5-1-3">5.1.3</a> 节那样指定 <code>R</code> 公式来定义时依斜率项 <span class="math inline">\(m'_i(t)\)</span>,而是为计算 <span class="math inline">\(m'i(t)\)</span> 积分所需的固定和随机效应部分指定相应的 <code>R</code> 公式。我们继续使用上一节中的 PBC 数据集的同一示例来说明如何实现这一点,现在我们将联合模型与以下形式的生存子模型进行拟合</p>
<p><span class="math display">\[\begin{aligned}h_i(t)=h_0(t)\exp\Bigl\{\gamma_1\mathtt{D}\text{-}\mathtt{pnc}_i+\gamma_2\mathtt{HepMeg}_i+\alpha\int_0^tm_i(s)ds\Bigr\}\end{aligned}\]</span></p>
<p>在 <a href="chap5.html#sec5-1-3">5.1.3</a> 节给出的 <span class="math inline">\(m_i(t)\)</span> 公式下,可以容易地看出其积分具有以下闭式解</p>
<p><span class="math display">\[\begin{aligned}\int_0^tm_i(s)~ds&=\beta_0t+\beta_1\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t\}+\beta_2t^2/2+\beta_3t^3/3\\&\quad+\beta_4\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t^2/2\}+\beta_5\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t^3/3\}+b_{i0}t+b_{i1}t^2/2+b_{i2}t^3/3\end{aligned}\]</span></p>
<p>我们将该式转化为固定和随机效应部分的一对 <code>R</code> 公式。此外,我们还在 <code>indFixed</code> 和 <code>indRandom</code> 组件中指定原始线性混合模型的哪些固定和随机效应参数对应于用于计算 <span class="math inline">\(m_i(t)\)</span> 积分的设计矩阵的列。</p>
<div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb59-1"><a href="chap5.html#cb59-1" tabindex="-1"></a><span class="sc">></span> iform <span class="ot"><-</span> <span class="fu">list</span>(<span class="at">fixed =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> year <span class="sc">+</span> <span class="fu">I</span>(year <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)) <span class="sc">+</span></span>
<span id="cb59-2"><a href="chap5.html#cb59-2" tabindex="-1"></a> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">2</span><span class="sc">/</span><span class="dv">2</span>) <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">3</span><span class="sc">/</span><span class="dv">3</span>) <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">2</span><span class="sc">/</span><span class="dv">2</span> <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)) <span class="sc">+</span></span>
<span id="cb59-3"><a href="chap5.html#cb59-3" tabindex="-1"></a> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">3</span><span class="sc">/</span><span class="dv">3</span> <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)),</span>
<span id="cb59-4"><a href="chap5.html#cb59-4" tabindex="-1"></a> <span class="at">indFixed =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">6</span>,</span>
<span id="cb59-5"><a href="chap5.html#cb59-5" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> year <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">2</span><span class="sc">/</span><span class="dv">2</span>) <span class="sc">+</span> <span class="fu">I</span>(year<span class="sc">^</span><span class="dv">3</span><span class="sc">/</span><span class="dv">3</span>),</span>
<span id="cb59-6"><a href="chap5.html#cb59-6" tabindex="-1"></a> <span class="at">indRandom =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>)</span></code></pre></div>
<p>在固定和随机效应部分的公式定义中添加的 <code>-1</code> 用于排除截距项,默认情况下,截距项包含在 <code>R</code> 的设计矩阵的构造中。通过在 <code>derivForm</code> 参数中提供 <code>iform</code> 列表,可以简单地拟合相应的联合模型。此外,<code>parameterization</code> 参数中的选项 <code>"slope"</code> 指定我们只想在生存子模型的线性预测器中包括 <code>derivForm</code> 参数创建的项,而不是当前值的项 <span class="math inline">\(m_i(t)\)</span>。</p>
<div class="sourceCode" id="cb60"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb60-1"><a href="chap5.html#cb60-1" tabindex="-1"></a><span class="sc">></span> jointFit4.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit3.pbc, <span class="at">parameterization =</span> <span class="st">"slope"</span>,</span>
<span id="cb60-2"><a href="chap5.html#cb60-2" tabindex="-1"></a> <span class="at">derivForm =</span> iform)</span>
<span id="cb60-3"><a href="chap5.html#cb60-3" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit4.pbc)</span>
<span id="cb60-4"><a href="chap5.html#cb60-4" tabindex="-1"></a></span>
<span id="cb60-5"><a href="chap5.html#cb60-5" tabindex="-1"></a>. . .</span>
<span id="cb60-6"><a href="chap5.html#cb60-6" tabindex="-1"></a>Event Process</span>
<span id="cb60-7"><a href="chap5.html#cb60-7" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb60-8"><a href="chap5.html#cb60-8" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="fl">0.0471</span> <span class="fl">0.1747</span> <span class="fl">0.2695</span> <span class="fl">0.7876</span></span>
<span id="cb60-9"><a href="chap5.html#cb60-9" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.9624</span> <span class="fl">0.1899</span> <span class="fl">5.0690</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb60-10"><a href="chap5.html#cb60-10" tabindex="-1"></a>Assoct.s <span class="fl">0.1873</span> <span class="fl">0.0208</span> <span class="fl">9.0231</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb60-11"><a href="chap5.html#cb60-11" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">3.5552</span> <span class="fl">0.2360</span> <span class="sc">-</span><span class="fl">15.0635</span> </span>
<span id="cb60-12"><a href="chap5.html#cb60-12" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">3.5649</span> <span class="fl">0.2546</span> <span class="sc">-</span><span class="fl">14.0011</span> </span>
<span id="cb60-13"><a href="chap5.html#cb60-13" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">4.0452</span> <span class="fl">0.3122</span> <span class="sc">-</span><span class="fl">12.9570</span> </span>
<span id="cb60-14"><a href="chap5.html#cb60-14" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">4.1554</span> <span class="fl">0.3712</span> <span class="sc">-</span><span class="fl">11.1931</span> </span>
<span id="cb60-15"><a href="chap5.html#cb60-15" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">4.0360</span> <span class="fl">0.3507</span> <span class="sc">-</span><span class="fl">11.5092</span> </span>
<span id="cb60-16"><a href="chap5.html#cb60-16" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">3.9714</span> <span class="fl">0.4092</span> <span class="sc">-</span><span class="fl">9.7047</span> </span>
<span id="cb60-17"><a href="chap5.html#cb60-17" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.7</span>) <span class="sc">-</span><span class="fl">5.5984</span> <span class="fl">0.6323</span> <span class="sc">-</span><span class="fl">8.8534</span> </span>
<span id="cb60-18"><a href="chap5.html#cb60-18" tabindex="-1"></a>. . .</span></code></pre></div>
<p>与之前的分析相似,我们观察到血清胆红素仍然与死亡风险密切相关。具体来说,对数血清胆红素纵向分布下面积的单位增加对应于死亡风险增加为原来的 1.2 倍。参数化 <a href="chap5.html#eq:5-5">(5.5)</a> 的一个限制是它为标志物的所有过去值设置相同的权重,这在某些情况下可能是不合理的。解决此问题的一个简单扩展是调整被积函数并将 <span class="math inline">\(m_i(t)\)</span> 与适当选择的权重函数相乘,该权重函数在不同的时间点设置不同的权重:</p>
<p><span class="math display" id="eq:5-6">\[\begin{align}
h_i(t)=h_0(t)\exp\Bigl\{\gamma^\top w_i+\alpha\int_0^t\varpi(t-s)m_i(s)ds\Bigr\}
\tag{5.6}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(\varpi(\cdot)\)</span> 表示权重函数。<span class="math inline">\(\varpi(\cdot)\)</span> 的一个理想性质是在过去更远的点上放置更小的权重。具有这种性质的一个可能的函数族是已知参数分布的概率密度函数,如正态、学生 t 和 logistic. 这些密度中的尺度参数以及学生 t 密度中的自由度参数可用于调整较新标志物值与较旧标志物值相比的相对权重。参数化 <a href="chap5.html#eq:5-6">(5.6)</a> 与 Breslow et al. (1983) 和 Thomas (1988) 讨论的加权累积暴露的概念有直接联系。</p>
<p>作为说明,我们更新了 PBC 数据集的累积效应分析,并使用标准正态密度作为权重函数,即 <span class="math inline">\(\varpi(x) = \exp(-x^2/2)/\sqrt{2\pi}\)</span>。通过将正态密度的方差设置为 1,我们实际上假定最近三年<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content='<p>译者注:正态分布的 <span class="math inline">\(3\sigma\)</span> 原则。</p>'><sup>15</sup></a>的血清胆红素历史记录与死亡风险相关。纵向子模型中 <span class="math inline">\(m_i(t)\)</span> 的指定假定固定效应和随机效应部分的时间效应均采用二阶多项式。因此,为了构建加权累积效应,我们需要计算以下形式的积分</p>
<p><span class="math display">\[\begin{aligned}\int_0^ts^j\varpi(t-s)ds=(1/\sqrt{2\pi})\int_0^ts^j\exp\{-(t-s)^2/2\}ds\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(j=0,1,2\)</span>。由于这些积分对于 <span class="math inline">\(j>0\)</span> 没有闭合形式的解,我们将使用 <code>R</code> 中的内置函数 <code><a href="https://rdrr.io/r/stats/integrate.html">integrate()</a></code> 对它们进行数值近似。该函数基于我们之前在生存函数 <a href="chap4.html#eq:4-2">(4.2)</a> 的定义中看到的积分近似的 Gauss-Kronrod 规则。与未加权的分析类似,我们需要为固定效应和随机效应部分定义适当的公式,这些公式将在 <code>jointModel()</code> 的 <code>derivForm</code> 参数中提供。作为初始步骤,我们定义函数 <code>g()</code>,该函数使用 <code><a href="https://rdrr.io/r/stats/integrate.html">integrate()</a></code> 计算所需的积分</p>
<div class="sourceCode" id="cb61"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb61-1"><a href="chap5.html#cb61-1" tabindex="-1"></a><span class="sc">></span> g <span class="ot"><-</span> <span class="cf">function</span> (u, <span class="at">pow =</span> <span class="dv">0</span>) {</span>
<span id="cb61-2"><a href="chap5.html#cb61-2" tabindex="-1"></a> f <span class="ot"><-</span> <span class="cf">function</span> (t)</span>
<span id="cb61-3"><a href="chap5.html#cb61-3" tabindex="-1"></a> <span class="fu">integrate</span>(<span class="cf">function</span> (s) s<span class="sc">^</span>pow <span class="sc">*</span> <span class="fu">dnorm</span>(t <span class="sc">-</span> s), <span class="dv">0</span>, t)<span class="sc">$</span>value</span>
<span id="cb61-4"><a href="chap5.html#cb61-4" tabindex="-1"></a> <span class="fu">sapply</span>(u, f)</span>
<span id="cb61-5"><a href="chap5.html#cb61-5" tabindex="-1"></a>}</span></code></pre></div>
<p>最后一行中的 <code><a href="https://rdrr.io/r/base/lapply.html">sapply()</a></code> 语句用于将 <code>g()</code> 关于其第一个参数向量化,即当 <span class="math inline">\(u\)</span> 是向量时使 <code>g()</code> 起作用。接下来,使用 <code>g()</code> 我们定义权重累积效应的固定部分和随机部分,并拟合相应的联合模型</p>
<div class="sourceCode" id="cb62"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb62-1"><a href="chap5.html#cb62-1" tabindex="-1"></a><span class="sc">></span> iformW <span class="ot"><-</span> <span class="fu">list</span>(<span class="at">fixed =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">g</span>(year)) <span class="sc">+</span></span>
<span id="cb62-2"><a href="chap5.html#cb62-2" tabindex="-1"></a> <span class="fu">I</span>(<span class="fu">g</span>(year) <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)) <span class="sc">+</span></span>
<span id="cb62-3"><a href="chap5.html#cb62-3" tabindex="-1"></a> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">1</span>)) <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">2</span>)) <span class="sc">+</span></span>
<span id="cb62-4"><a href="chap5.html#cb62-4" tabindex="-1"></a> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">1</span>) <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)) <span class="sc">+</span></span>
<span id="cb62-5"><a href="chap5.html#cb62-5" tabindex="-1"></a> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">2</span>) <span class="sc">*</span> (drug <span class="sc">==</span> <span class="st">"D-penicil"</span>)),</span>
<span id="cb62-6"><a href="chap5.html#cb62-6" tabindex="-1"></a> <span class="at">indFixed =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">6</span>,</span>
<span id="cb62-7"><a href="chap5.html#cb62-7" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">g</span>(year)) <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">1</span>)) <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">g</span>(year, <span class="dv">2</span>)),</span>
<span id="cb62-8"><a href="chap5.html#cb62-8" tabindex="-1"></a> <span class="at">indRandom =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>)</span>
<span id="cb62-9"><a href="chap5.html#cb62-9" tabindex="-1"></a><span class="sc">></span> jointFit5.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit3.pbc, <span class="at">parameterization =</span> <span class="st">"slope"</span>,</span>
<span id="cb62-10"><a href="chap5.html#cb62-10" tabindex="-1"></a> <span class="at">derivForm =</span> iformW)</span>
<span id="cb62-11"><a href="chap5.html#cb62-11" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit5.pbc)</span>
<span id="cb62-12"><a href="chap5.html#cb62-12" tabindex="-1"></a></span>
<span id="cb62-13"><a href="chap5.html#cb62-13" tabindex="-1"></a>. . .</span>
<span id="cb62-14"><a href="chap5.html#cb62-14" tabindex="-1"></a>Event Process</span>
<span id="cb62-15"><a href="chap5.html#cb62-15" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb62-16"><a href="chap5.html#cb62-16" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="fl">0.0963</span> <span class="fl">0.1776</span> <span class="fl">0.5422</span> <span class="fl">0.5877</span></span>
<span id="cb62-17"><a href="chap5.html#cb62-17" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.7804</span> <span class="fl">0.1942</span> <span class="fl">4.0184</span> <span class="fl">0.0001</span></span>
<span id="cb62-18"><a href="chap5.html#cb62-18" tabindex="-1"></a>Assoct.s <span class="fl">2.4086</span> <span class="fl">0.1898</span> <span class="fl">12.6880</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb62-19"><a href="chap5.html#cb62-19" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">4.2907</span> <span class="fl">0.2729</span> <span class="sc">-</span><span class="fl">15.7249</span> </span>
<span id="cb62-20"><a href="chap5.html#cb62-20" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">4.4941</span> <span class="fl">0.3026</span> <span class="sc">-</span><span class="fl">14.8518</span> </span>
<span id="cb62-21"><a href="chap5.html#cb62-21" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">4.7226</span> <span class="fl">0.3362</span> <span class="sc">-</span><span class="fl">14.0456</span> </span>
<span id="cb62-22"><a href="chap5.html#cb62-22" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">4.6588</span> <span class="fl">0.3812</span> <span class="sc">-</span><span class="fl">12.2221</span> </span>
<span id="cb62-23"><a href="chap5.html#cb62-23" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">4.3633</span> <span class="fl">0.3471</span> <span class="sc">-</span><span class="fl">12.5697</span> </span>
<span id="cb62-24"><a href="chap5.html#cb62-24" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">4.0054</span> <span class="fl">0.3610</span> <span class="sc">-</span><span class="fl">11.0952</span> </span>
<span id="cb62-25"><a href="chap5.html#cb62-25" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.7</span>) <span class="sc">-</span><span class="fl">4.6692</span> <span class="fl">0.4899</span> <span class="sc">-</span><span class="fl">9.5311</span> </span>
<span id="cb62-26"><a href="chap5.html#cb62-26" tabindex="-1"></a>. . .</span></code></pre></div>
<p>我们观察到,加权累积效应也与死亡风险密切相关,对数血清胆红素轨迹下加权面积的单位增加对应于风险增加为原来的 11.4 倍。表 5.1 说明了在加权累积效应、未加权累积效应和当前值参数化下使用 PBC 数据集拟合的三个联合模型的信息准则的比较。我们观察到,权重函数的包含明显提高了累积效应参数化下的拟合度。然而,对于这个特定的数据集,似乎仅使用风险模型中标志物 <span class="math inline">\(m_i(t)\)</span> 的最新值比使用累积效应提供更好的预测能力。图 5.3 给出了这三个参数化之间的额外比较,它描述了 PBC 数据集中两名患者的风险函数。显然,参数化的选择会对特定受试者的风险函数的形状产生相当大的影响,这表明选择数据不支持的参数化可能会极大地影响模型的拟合。因此,<strong>我们不应该总是仅依赖标准公式 <a href="chap4.html#eq:4-1">(4.1)</a> ,而应该仔细考虑问题并研究不同的参数化及其可能的组合</strong>。</p>
<details><summary><font color="#B95953">表 5.1</font>
</summary><img src="figure/table%205.1.png#center" style="width:80.0%"></details><br><details><summary><font color="#B95953">图 5.3</font>
</summary><img src="figure/figure%205.3.png#center" style="width:80.0%"></details>
</div>
<div id="sec5-1-5" class="section level3" number="5.1.5">
<h3>
<span class="header-section-number">5.1.5</span> 随机效应参数化<a class="anchor" aria-label="anchor" href="#sec5-1-5"><i class="fas fa-link"></i></a>
</h3>
<p>在联合模型中经常使用的另一种类型的参数化在风险模型的线性预测器中仅包括纵向子模型的随机效应,即</p>
<p><span class="math display" id="eq:5-7">\[\begin{align}
h_i(t)=h_0(t)\exp(\gamma^\top w_i+\alpha^\top b_i)
\tag{5.7}
\end{align}\]</span></p>
<p>其中 <span class="math inline">\(\alpha\)</span> 表示关联参数向量,每个参数度量相应随机效应与事件风险之间的关联。当为纵向子模型假定简单的随机截距和随机斜率结构时,这种参数化更有意义,在这种情况下,随机效应表示特定受试者与平均截距和平均斜率的偏差。在此设置下,该参数化假设基线纵向结果(即截距)具有较低/较高水平的患者或纵向轨迹(即斜率)显示出更陡峭的增加/减少的患者更有可能经历该事件(即脱落)。这种解释也促进了在缺失数据框架中使用的联合模型(即共享参数模型)中使用这种参数化 (Pulkstenis et al., 1998; Follmann and Wu, 1995; Wu and Bailey, 1989). 该参数化也与 <a href="chap5.html#sec5-1-3">5.1.3</a> 节中介绍的时依斜率参数化有相似之处。具体来说,在具有随机截距和随机斜率结构的纵向子模型下,即</p>
<p><span class="math display">\[\begin{aligned}y_i(t)=\beta_0+\beta_1t+b_{i0}+b_{i1}t+\varepsilon_i(t)\end{aligned}\]</span></p>
<p><span class="math inline">\(\alpha_1=0\)</span> 的时变斜率参数化 <a href="chap5.html#eq:5-4">(5.4)</a> 下事件过程的相对风险子模型采用以下形式</p>
<p><span class="math display">\[\begin{aligned}h_i(t)=h_0(t)\exp\{\gamma^\top w_i+\alpha_2(\beta_1+b_{i1})\}\end{aligned}\]</span></p>
<p>而相对风险子模型在相同的纵向子模型下,但参数化 <a href="chap5.html#eq:5-7">(5.7)</a> 变成</p>
<p><span class="math display">\[\begin{aligned}h_i(t)=h_0(t)\exp(\gamma^\top w_i+\alpha_1b_{i0}+\alpha_2b_{i1})\end{aligned}\]</span></p>
<p>如果我们在相对风险子模型的后一个公式中设 <span class="math inline">\(\alpha_1 = 0\)</span>,我们观察到该模型还假定风险仅取决于线性混合模型的随机斜率部分。值得注意的是,<span class="math inline">\(\alpha_2\)</span> 在两个参数化中的解释是不同的,因为项 <span class="math inline">\((\beta_1 + b_{i1})\)</span> 表示第 <span class="math inline">\(i\)</span> 个受试者的纵向轨迹的潜在斜率,而项 <span class="math inline">\(b_{i1}\)</span> 表示受试者 <span class="math inline">\(i\)</span> 的斜率与总体均值 <span class="math inline">\(\beta_1\)</span> 的偏差。</p>
<p>参数化 <a href="chap5.html#eq:5-7">(5.7)</a> 的一个计算优势是它与时间无关,因此在生存函数 <a href="chap4.html#eq:4-2">(4.2)</a> 的定义中可得到积分的闭合形式解(在某些基线风险函数下)。这便于计算,因为我们不必在数值上近似这个积分。然而,当假设纵向子模型的特定主题平均结构的复杂公式时,<a href="chap5.html#eq:5-7">(5.7)</a> 的一个重要缺点出现了。具体来说,当多项式或样条曲线用于捕捉非线性的特定于受试者的演变时,随机效应没有直接的解释。例如,在拟合到 PBC 数据集的联合模型中,我们假定了时间效应的二次多项式(见 <a href="chap5.html#sec5-1-1">5.1.1</a> 节),关于特定于受试者的线性斜率 <span class="math inline">\(b_{i1}\)</span> 的解释,不能独立于特定于受试者的二次斜率 <span class="math inline">\(b_{i2}\)</span>。这显然也影响了关联参数 <span class="math inline">\(\alpha\)</span> 的可解释性。由于这一限制,<code>JM</code> 包不显式地将该参数化作为选项包括在内。然而,如上所述,我们可以在简单的随机截距和随机斜率设置下,使用 <a href="chap5.html#sec5-1-3">5.1.3</a> 节的时依斜率参数化来模拟该参数化的一部分。为了说明这一点,我们在假定血清胆红素遵循更简单的线性混合模型(即排除二次时间趋势)的情况下,重新拟合了针对 PBC 数据集的联合模型。</p>
<p><span class="math display">\[y_i(t)=\beta_0+\beta_1\mathtt{D}\text{-}\mathtt{pnc}_i+\beta_2t+\beta_3\{\mathtt{D}\text{-}\mathtt{pnc}_i\times t\}+b_{i0}+b_{i1}t+\varepsilon_i(t)\]</span></p>
<p>以及死亡的相对风险模型,包括特定于患者的斜率作为额外协变量</p>
<p><span class="math display">\[h_i(t)=h_0(t)\exp\{\gamma_1\mathtt{D}\text{-}\mathtt{pnc}_i+\gamma_2\mathtt{HepMeg}_i+\alpha(\beta_2+b_{i1})\}\]</span></p>
<p>在下面相应的 <code>R</code> 语法中,我们首先拟合更简单的线性混合模型,接下来我们定义 <code>derivForm</code> 参数的公式列表,最后通过指定参数化方式(仅在风险模型中包含真实轨迹的斜率)来更新先前拟合的联合模型<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content="<p>译者注:需拟合较长时间;且结果与原书不同。</p>"><sup>16</sup></a></p>
<div class="sourceCode" id="cb63"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb63-1"><a href="chap5.html#cb63-1" tabindex="-1"></a><span class="sc">></span> lmeFit2.pbc <span class="ot"><-</span> <span class="fu">lme</span>(<span class="fu">log</span>(serBilir) <span class="sc">~</span> year <span class="sc">*</span> drug,</span>
<span id="cb63-2"><a href="chap5.html#cb63-2" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> year <span class="sc">|</span> id, <span class="at">data =</span> pbc2)</span>
<span id="cb63-3"><a href="chap5.html#cb63-3" tabindex="-1"></a><span class="sc">></span> dform2 <span class="ot"><-</span> <span class="fu">list</span>(<span class="at">fixed =</span> <span class="sc">~</span> <span class="dv">1</span>, <span class="at">indFixed =</span> <span class="dv">3</span>,</span>
<span id="cb63-4"><a href="chap5.html#cb63-4" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> <span class="dv">1</span>, <span class="at">indRandom =</span> <span class="dv">2</span>)</span>
<span id="cb63-5"><a href="chap5.html#cb63-5" tabindex="-1"></a><span class="sc">></span> jointFit6.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit3.pbc, <span class="at">lmeObject =</span> lmeFit2.pbc,</span>
<span id="cb63-6"><a href="chap5.html#cb63-6" tabindex="-1"></a> <span class="at">parameterization =</span> <span class="st">"slope"</span>, <span class="at">derivForm =</span> dform2)</span>
<span id="cb63-7"><a href="chap5.html#cb63-7" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit6.pbc)</span>
<span id="cb63-8"><a href="chap5.html#cb63-8" tabindex="-1"></a></span>
<span id="cb63-9"><a href="chap5.html#cb63-9" tabindex="-1"></a>. . .</span>
<span id="cb63-10"><a href="chap5.html#cb63-10" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="sc">-</span><span class="fl">0.0680</span> <span class="fl">0.2203</span> <span class="sc">-</span><span class="fl">0.3087</span> <span class="fl">0.7575</span></span>
<span id="cb63-11"><a href="chap5.html#cb63-11" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.8409</span> <span class="fl">0.2022</span> <span class="fl">4.1586</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb63-12"><a href="chap5.html#cb63-12" tabindex="-1"></a>Assoct.s <span class="fl">9.7530</span> <span class="fl">1.1201</span> <span class="fl">8.7070</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb63-13"><a href="chap5.html#cb63-13" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">6.7693</span> <span class="fl">0.5227</span> <span class="sc">-</span><span class="fl">12.9517</span></span>
<span id="cb63-14"><a href="chap5.html#cb63-14" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">5.3977</span> <span class="fl">0.4295</span> <span class="sc">-</span><span class="fl">12.5686</span></span>
<span id="cb63-15"><a href="chap5.html#cb63-15" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">4.9452</span> <span class="fl">0.3959</span> <span class="sc">-</span><span class="fl">12.4926</span></span>
<span id="cb63-16"><a href="chap5.html#cb63-16" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">4.4833</span> <span class="fl">0.3943</span> <span class="sc">-</span><span class="fl">11.3707</span></span>
<span id="cb63-17"><a href="chap5.html#cb63-17" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">4.1852</span> <span class="fl">0.3698</span> <span class="sc">-</span><span class="fl">11.3168</span></span>
<span id="cb63-18"><a href="chap5.html#cb63-18" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">3.5718</span> <span class="fl">0.3652</span> <span class="sc">-</span><span class="fl">9.7797</span></span>
<span id="cb63-19"><a href="chap5.html#cb63-19" tabindex="-1"></a>. . .</span></code></pre></div>
<p>我们观察到,特定于受试者的斜率与瞬时死亡风险密切相关。如图 5.4 所示,斜率系数的较大值是由其较小的变异性来解释的。因此,计算斜率单位增加的风险比是没有意义的,因为这种幅度的增加是不现实的。通过将其与模型 <code>jointFit6.pbc</code> 的标准差估计除以 0.18,可以获得对特定于受试者的斜率更有用的估计。更新后的联合模型拟合使用以下语法生成<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content="<p>译者注:需拟合较长时间;且结果与原书不同。</p>"><sup>17</sup></a></p>
<div class="sourceCode" id="cb64"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb64-1"><a href="chap5.html#cb64-1" tabindex="-1"></a><span class="sc">></span> dform3 <span class="ot"><-</span> <span class="fu">list</span>(<span class="at">fixed =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">rep</span>(<span class="dv">1</span><span class="sc">/</span><span class="fl">0.18</span>, <span class="fu">length</span>(drug))),</span>
<span id="cb64-2"><a href="chap5.html#cb64-2" tabindex="-1"></a> <span class="at">random =</span> <span class="sc">~</span> <span class="sc">-</span><span class="dv">1</span> <span class="sc">+</span> <span class="fu">I</span>(<span class="fu">rep</span>(<span class="dv">1</span><span class="sc">/</span><span class="fl">0.18</span>, <span class="fu">length</span>(drug))),</span>
<span id="cb64-3"><a href="chap5.html#cb64-3" tabindex="-1"></a> <span class="at">indFixed =</span> <span class="dv">3</span>, <span class="at">indRandom =</span> <span class="dv">2</span>)</span>
<span id="cb64-4"><a href="chap5.html#cb64-4" tabindex="-1"></a><span class="sc">></span> jointFit7.pbc <span class="ot"><-</span> <span class="fu">update</span>(jointFit6.pbc, <span class="at">derivForm =</span> dform3)</span>
<span id="cb64-5"><a href="chap5.html#cb64-5" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit7.pbc)</span>
<span id="cb64-6"><a href="chap5.html#cb64-6" tabindex="-1"></a></span>
<span id="cb64-7"><a href="chap5.html#cb64-7" tabindex="-1"></a>. . .</span>
<span id="cb64-8"><a href="chap5.html#cb64-8" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb64-9"><a href="chap5.html#cb64-9" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="sc">-</span><span class="fl">0.0668</span> <span class="fl">0.2207</span> <span class="sc">-</span><span class="fl">0.3028</span> <span class="fl">0.7621</span></span>
<span id="cb64-10"><a href="chap5.html#cb64-10" tabindex="-1"></a>hepatomegalyYes <span class="fl">0.8443</span> <span class="fl">0.2027</span> <span class="fl">4.1655</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb64-11"><a href="chap5.html#cb64-11" tabindex="-1"></a>Assoct.s <span class="fl">1.7617</span> <span class="fl">0.2032</span> <span class="fl">8.6689</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb64-12"><a href="chap5.html#cb64-12" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.1</span>) <span class="sc">-</span><span class="fl">6.7889</span> <span class="fl">0.5261</span> <span class="sc">-</span><span class="fl">12.9051</span></span>
<span id="cb64-13"><a href="chap5.html#cb64-13" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.2</span>) <span class="sc">-</span><span class="fl">5.4148</span> <span class="fl">0.4326</span> <span class="sc">-</span><span class="fl">12.5158</span></span>
<span id="cb64-14"><a href="chap5.html#cb64-14" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.3</span>) <span class="sc">-</span><span class="fl">4.9596</span> <span class="fl">0.3984</span> <span class="sc">-</span><span class="fl">12.4486</span></span>
<span id="cb64-15"><a href="chap5.html#cb64-15" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.4</span>) <span class="sc">-</span><span class="fl">4.4970</span> <span class="fl">0.3966</span> <span class="sc">-</span><span class="fl">11.3394</span></span>
<span id="cb64-16"><a href="chap5.html#cb64-16" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.5</span>) <span class="sc">-</span><span class="fl">4.1969</span> <span class="fl">0.3718</span> <span class="sc">-</span><span class="fl">11.2891</span></span>
<span id="cb64-17"><a href="chap5.html#cb64-17" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.6</span>) <span class="sc">-</span><span class="fl">3.5821</span> <span class="fl">0.3668</span> <span class="sc">-</span><span class="fl">9.7653</span></span>
<span id="cb64-18"><a href="chap5.html#cb64-18" tabindex="-1"></a><span class="fu">log</span>(xi<span class="fl">.7</span>) <span class="sc">-</span><span class="fl">3.8953</span> <span class="fl">0.4711</span> <span class="sc">-</span><span class="fl">8.2684</span></span>
<span id="cb64-19"><a href="chap5.html#cb64-19" tabindex="-1"></a>. . .</span></code></pre></div>
<details><summary><font color="#B95953">图 5.4</font>
</summary><img src="figure/figure%205.4.png#center" style="width:80.0%"></details><p><br>
结果表明,对于接受相同治疗且具有相同肝肿大状态的患者,血清胆红素对数斜率每增加一个标准差,死亡或移植的风险就会增加为原来的 5.82 倍 (95% CI:3.91, 8.67).</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="chap4.html#eq:4-1">(4.1)</a>,相对风险模型可以很容易地扩展到处理外源协变量,如</p>
<p><span class="math display" id="eq:5-8">\[\begin{align}
h_i(t)=h_0(t)\exp\{\gamma^\top w_i(t)+\alpha m_i(t)\}
\tag{5.8}
\end{align}\]</span></p>
<p>其中协变量向量 <span class="math inline">\(w_i(t)\)</span> 现在包含基线和外源时依协变量。此外,<a href="chap5.html#sec5-1">5.1</a> 节的替代参数化可以考虑用于内生协变量,也可以考虑用于外源协变量,例如与基线协变量的交互效应、滞后效应和累积效应,其中对于后者,<a href="chap5.html#eq:5-5">(5.5)</a> 或 <a href="chap5.html#eq:5-6">(5.6)</a> 中的积分被求和代替。具有外源和内生时依协变量的联合模型的估计与仅具有内生协变量的联合模型的估计相同。唯一实际的区别在于生存函数定义中积分的计算,由于计算原因,该函扩展为</p>
<p><span class="math display">\[\begin{aligned}\mathcal{S}_i(t\mid\mathcal{M}_i(t),w_i)&=\exp\biggl(-\int_0^th_i(s)ds\biggr)\\&=\exp\biggl(-\sum_{q=1}^{Q_i}\int_{\Omega_{iq}}h_0(s)\exp\{\gamma^\top w_{iq}(s)+\alpha m_i(s)\}ds\biggr)\end{aligned}\]</span></p>
<p>其中 <span class="math inline">\(\{\Omega_{iq},q=1,\ldots,Q_i\}\)</span> 表示时间区间,在此期间外源时依协变量 <span class="math inline">\(w_i(t)\)</span> 假定为常数。作为说明,我们将联合模型与 PBC 数据集拟合,其中包含复合事件(死亡或移植)更新的相对风险子模型,除了治疗和记录血清胆红素的效应外,还包括的随访期间蜘蛛痣(皮肤血管畸形)的主效应及其与治疗的交互作用。然而,我们应该注意到,事实上,蜘蛛痣的存在是一个内生二元时依协变量,因为它的存在要求患者还活着。这意味着,对于结合血清胆红素和蜘蛛痣的效应的正确分析的联合模型,应该为两种纵向结果分别假定一个适当的混合效应子模型。有关分类内生时变协变量处理的更多信息,请参阅 <a href="chap5.html#sec5-7-2">5.7.2</a> 节。然而,为了便于说明,我们在这里忽略了这一事实,并将蜘蛛痣视为外源协变量。</p>
<p>第一步,我们需要构建一个长格式的数据集,如 <a href="chap3.html#sec3-5">3.5</a> 节所示。</p>
<div class="sourceCode" id="cb65"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb65-1"><a href="chap5.html#cb65-1" tabindex="-1"></a><span class="sc">></span> pbc <span class="ot"><-</span> pbc2[<span class="fu">c</span>(<span class="st">"id"</span>, <span class="st">"serBilir"</span>, <span class="st">"drug"</span>, <span class="st">"year"</span>, <span class="st">"years"</span>,</span>
<span id="cb65-2"><a href="chap5.html#cb65-2" tabindex="-1"></a> <span class="st">"status2"</span>, <span class="st">"spiders"</span>)]</span>
<span id="cb65-3"><a href="chap5.html#cb65-3" tabindex="-1"></a><span class="sc">></span> pbc[pbc<span class="sc">$</span>id <span class="sc">==</span> <span class="st">"3"</span>, ]</span>
<span id="cb65-4"><a href="chap5.html#cb65-4" tabindex="-1"></a></span>
<span id="cb65-5"><a href="chap5.html#cb65-5" tabindex="-1"></a> id serBilir drug year years status2 spiders</span>
<span id="cb65-6"><a href="chap5.html#cb65-6" tabindex="-1"></a><span class="dv">12</span> <span class="dv">3</span> <span class="fl">1.4</span> D<span class="sc">-</span>penicil <span class="fl">0.0000000</span> <span class="fl">2.770781</span> <span class="dv">1</span> No</span>
<span id="cb65-7"><a href="chap5.html#cb65-7" tabindex="-1"></a><span class="dv">13</span> <span class="dv">3</span> <span class="fl">1.1</span> D<span class="sc">-</span>penicil <span class="fl">0.4818749</span> <span class="fl">2.770781</span> <span class="dv">1</span> Yes</span>
<span id="cb65-8"><a href="chap5.html#cb65-8" tabindex="-1"></a><span class="dv">14</span> <span class="dv">3</span> <span class="fl">1.5</span> D<span class="sc">-</span>penicil <span class="fl">0.9966050</span> <span class="fl">2.770781</span> <span class="dv">1</span> No</span>
<span id="cb65-9"><a href="chap5.html#cb65-9" tabindex="-1"></a><span class="dv">15</span> <span class="dv">3</span> <span class="fl">1.8</span> D<span class="sc">-</span>penicil <span class="fl">2.0342788</span> <span class="fl">2.770781</span> <span class="dv">1</span> Yes</span></code></pre></div>
<p>例如,我们观察到,患者 3 有四次随访测量,在此期间,只有第二次和第四次有蜘蛛痣。<code>start</code> 和 <code>stop</code> 变量表示记录蜘蛛痣存在的时间区间的限,如果在相应时间区间结束时发生事件,则 <code>event</code> 变量等于 1,使用以下代码构造:</p>
<div class="sourceCode" id="cb66"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb66-1"><a href="chap5.html#cb66-1" tabindex="-1"></a><span class="sc">></span> pbc<span class="sc">$</span>start <span class="ot"><-</span> pbc<span class="sc">$</span>year</span>
<span id="cb66-2"><a href="chap5.html#cb66-2" tabindex="-1"></a><span class="sc">></span> splitID <span class="ot"><-</span> <span class="fu">split</span>(pbc[<span class="fu">c</span>(<span class="st">"start"</span>, <span class="st">"years"</span>)], pbc<span class="sc">$</span>id)</span>
<span id="cb66-3"><a href="chap5.html#cb66-3" tabindex="-1"></a><span class="sc">></span> pbc<span class="sc">$</span>stop <span class="ot"><-</span> <span class="fu">unlist</span>(<span class="fu">lapply</span>(splitID, </span>
<span id="cb66-4"><a href="chap5.html#cb66-4" tabindex="-1"></a> <span class="cf">function</span> (d) <span class="fu">c</span>(d<span class="sc">$</span>start[<span class="sc">-</span><span class="dv">1</span>], d<span class="sc">$</span>years[<span class="dv">1</span>]) ))</span>
<span id="cb66-5"><a href="chap5.html#cb66-5" tabindex="-1"></a><span class="sc">></span> pbc<span class="sc">$</span>event <span class="ot"><-</span> <span class="fu">with</span>(pbc, <span class="fu">ave</span>(status2, id,</span>
<span id="cb66-6"><a href="chap5.html#cb66-6" tabindex="-1"></a> <span class="at">FUN =</span> <span class="cf">function</span> (x) <span class="fu">c</span>(<span class="fu">rep</span>(<span class="dv">0</span>, <span class="fu">length</span>(x)<span class="sc">-</span><span class="dv">1</span>), x[<span class="dv">1</span>]) ))</span></code></pre></div>
<p>特别是,请记住,在计数过程公式中,我们构建了区间 <span class="math inline">\((\mathtt{start},\mathtt{stop}]\)</span>,附有一个重要的数学约束,即在 <span class="math inline">\(t = \mathtt{stop}\)</span> 时进行的计算利用在该 <code>stop</code> 时间之前已知的协变量数据。这正式刻画了这样一个事实:外源协变量假定为可预测过程(见 <a href="chap3.html#sec3-4">3.4</a> 节)。例如,对于患者 3,我们得到结果</p>
<div class="sourceCode" id="cb67"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb67-1"><a href="chap5.html#cb67-1" tabindex="-1"></a><span class="sc">></span> pbc[pbc<span class="sc">$</span>id <span class="sc">==</span> <span class="st">"3"</span>, ]</span>
<span id="cb67-2"><a href="chap5.html#cb67-2" tabindex="-1"></a></span>
<span id="cb67-3"><a href="chap5.html#cb67-3" tabindex="-1"></a> id serBilir drug year years status2 spiders start stop event</span>
<span id="cb67-4"><a href="chap5.html#cb67-4" tabindex="-1"></a><span class="dv">12</span> <span class="dv">3</span> <span class="fl">1.4</span> D<span class="sc">-</span>penicil <span class="fl">0.0000000</span> <span class="fl">2.770781</span> <span class="dv">1</span> No <span class="fl">0.0000000</span> <span class="fl">0.4818749</span> <span class="dv">0</span></span>
<span id="cb67-5"><a href="chap5.html#cb67-5" tabindex="-1"></a><span class="dv">13</span> <span class="dv">3</span> <span class="fl">1.1</span> D<span class="sc">-</span>penicil <span class="fl">0.4818749</span> <span class="fl">2.770781</span> <span class="dv">1</span> Yes <span class="fl">0.4818749</span> <span class="fl">0.9966050</span> <span class="dv">0</span></span>
<span id="cb67-6"><a href="chap5.html#cb67-6" tabindex="-1"></a><span class="dv">14</span> <span class="dv">3</span> <span class="fl">1.5</span> D<span class="sc">-</span>penicil <span class="fl">0.9966050</span> <span class="fl">2.770781</span> <span class="dv">1</span> No <span class="fl">0.9966050</span> <span class="fl">2.0342788</span> <span class="dv">0</span></span>
<span id="cb67-7"><a href="chap5.html#cb67-7" tabindex="-1"></a><span class="dv">15</span> <span class="dv">3</span> <span class="fl">1.8</span> D<span class="sc">-</span>penicil <span class="fl">2.0342788</span> <span class="fl">2.770781</span> <span class="dv">1</span> Yes <span class="fl">2.0342788</span> <span class="fl">2.7707809</span> <span class="dv">1</span></span></code></pre></div>
<p>为了拟合以蜘蛛痣作为外源时依协变量的联合模型,我们首先需要使用计数过程符号和上面构建的长格式数据来拟合相应的扩展 Cox 模型。此外,由于 <code>jointModel()</code> 需要区分长格式生存数据中患者的测量,因此患者 id 变量应作为 <code>cluster()</code> 组件包含在 <code>coxph()</code> 的 <code>formula</code> 参数的右侧,此外,参数 <code>model</code> 应设置为 <code>TRUE</code>。</p>
<div class="sourceCode" id="cb68"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb68-1"><a href="chap5.html#cb68-1" tabindex="-1"></a><span class="sc">></span> tdCox.pbc <span class="ot"><-</span> <span class="fu">coxph</span>(<span class="fu">Surv</span>(start, stop, event) <span class="sc">~</span> drug <span class="sc">*</span> spiders <span class="sc">+</span> <span class="fu">cluster</span>(id),</span>
<span id="cb68-2"><a href="chap5.html#cb68-2" tabindex="-1"></a> <span class="at">data =</span> pbc, <span class="at">x =</span> <span class="cn">TRUE</span>, <span class="at">model =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>然后,调用 <code>jointModel()</code> 的方式与之前我们看到的示例相同,将拟合的扩展 Cox 模型作为 <code>survObject</code> 参数提供。我们应该提到,同时具有外源和内生时变协变量的联合模型仅在样条近似的基线风险函数下可用,也就是说,对于 <code>jointModel()</code> 的 <code>method</code> 参数,仅 <code>"spline-PH-aGH"</code> 这一选项可用,例如<a class="footnote-ref" tabindex="0" data-toggle="popover" data-content="<p>译者注:需拟合较长时间;且结果与原书不同。</p>"><sup>18</sup></a></p>
<div class="sourceCode" id="cb69"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb69-1"><a href="chap5.html#cb69-1" tabindex="-1"></a><span class="sc">></span> jointFit8.pbc <span class="ot"><-</span> <span class="fu">jointModel</span>(lmeFit.pbc, tdCox.pbc, <span class="at">timeVar =</span> <span class="st">"year"</span>,</span>
<span id="cb69-2"><a href="chap5.html#cb69-2" tabindex="-1"></a> <span class="at">method =</span> <span class="st">"spline-PH-aGH"</span>)</span>
<span id="cb69-3"><a href="chap5.html#cb69-3" tabindex="-1"></a><span class="sc">></span> <span class="fu">summary</span>(jointFit8.pbc)</span>
<span id="cb69-4"><a href="chap5.html#cb69-4" tabindex="-1"></a></span>
<span id="cb69-5"><a href="chap5.html#cb69-5" tabindex="-1"></a>. . .</span>
<span id="cb69-6"><a href="chap5.html#cb69-6" tabindex="-1"></a>Event Process</span>
<span id="cb69-7"><a href="chap5.html#cb69-7" tabindex="-1"></a> Value Std.Err z<span class="sc">-</span>value p<span class="sc">-</span>value</span>
<span id="cb69-8"><a href="chap5.html#cb69-8" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="sc">-</span><span class="fl">0.1382</span> <span class="fl">0.3732</span> <span class="sc">-</span><span class="fl">0.3704</span> <span class="fl">0.7111</span></span>
<span id="cb69-9"><a href="chap5.html#cb69-9" tabindex="-1"></a>spidersYes <span class="fl">0.6112</span> <span class="fl">0.3212</span> <span class="fl">1.9030</span> <span class="fl">0.0570</span></span>
<span id="cb69-10"><a href="chap5.html#cb69-10" tabindex="-1"></a>drugD<span class="sc">-</span>penicil<span class="sc">:</span>spidersYes <span class="fl">0.2494</span> <span class="fl">0.4640</span> <span class="fl">0.5374</span> <span class="fl">0.5910</span></span>
<span id="cb69-11"><a href="chap5.html#cb69-11" tabindex="-1"></a>Assoct <span class="fl">1.2774</span> <span class="fl">0.1297</span> <span class="fl">9.8480</span> <span class="sc"><</span><span class="fl">0.0001</span></span>
<span id="cb69-12"><a href="chap5.html#cb69-12" tabindex="-1"></a>. . .</span></code></pre></div>
<p>分析表明,血清胆红素仍然是最重要的预测因素,而没有足够的证据支持蜘蛛的存在与复合事件的风险有关。联合模型与将血清胆红素和蜘蛛视为外源协变量的扩展的 Cox 模型的比较表明,Cox 模型低估了血清胆红素对数与事件风险之间的关联强度。</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb70-1"><a href="chap5.html#cb70-1" tabindex="-1"></a><span class="sc">></span> tdCox2.pbc <span class="ot"><-</span> <span class="fu">coxph</span>(<span class="fu">Surv</span>(start, stop, event) <span class="sc">~</span> drug <span class="sc">*</span> spiders <span class="sc">+</span></span>
<span id="cb70-2"><a href="chap5.html#cb70-2" tabindex="-1"></a> <span class="fu">log</span>(serBilir), <span class="at">data =</span> pbc)</span>
<span id="cb70-3"><a href="chap5.html#cb70-3" tabindex="-1"></a><span class="sc">></span> tdCox2.pbc</span>
<span id="cb70-4"><a href="chap5.html#cb70-4" tabindex="-1"></a></span>
<span id="cb70-5"><a href="chap5.html#cb70-5" tabindex="-1"></a>Call<span class="sc">:</span></span>
<span id="cb70-6"><a href="chap5.html#cb70-6" tabindex="-1"></a><span class="fu">coxph</span>(<span class="at">formula =</span> <span class="fu">Surv</span>(start, stop, event) <span class="sc">~</span> drug <span class="sc">*</span> spiders <span class="sc">+</span> <span class="fu">log</span>(serBilir),</span>
<span id="cb70-7"><a href="chap5.html#cb70-7" tabindex="-1"></a><span class="at">data =</span> pbc)</span>
<span id="cb70-8"><a href="chap5.html#cb70-8" tabindex="-1"></a> coef <span class="fu">exp</span>(coef) <span class="fu">se</span>(coef) z p</span>
<span id="cb70-9"><a href="chap5.html#cb70-9" tabindex="-1"></a>drugD<span class="sc">-</span>penicil <span class="sc">-</span><span class="fl">0.310</span> <span class="fl">0.734</span> <span class="fl">0.3029</span> <span class="sc">-</span><span class="fl">1.023</span> <span class="fl">0.31</span></span>
<span id="cb70-10"><a href="chap5.html#cb70-10" tabindex="-1"></a>spidersYes <span class="fl">0.419</span> <span class="fl">1.521</span> <span class="fl">0.2681</span> <span class="fl">1.563</span> <span class="fl">0.12</span></span>
<span id="cb70-11"><a href="chap5.html#cb70-11" tabindex="-1"></a><span class="fu">log</span>(serBilir) <span class="fl">1.073</span> <span class="fl">2.924</span> <span class="fl">0.0932</span> <span class="fl">11.514</span> <span class="fl">0.00</span></span>
<span id="cb70-12"><a href="chap5.html#cb70-12" tabindex="-1"></a>drugD<span class="sc">-</span>penicil<span class="sc">:</span>spidersYes <span class="fl">0.294</span> <span class="fl">1.341</span> <span class="fl">0.3890</span> <span class="fl">0.755</span> <span class="fl">0.45</span></span>
<span id="cb70-13"><a href="chap5.html#cb70-13" tabindex="-1"></a>. . .</span></code></pre></div>
<p>特别是,两个模型下血清胆红素对数的风险比的 95% 置信区间表明,Cox 模型的上限仅略大于联合模型的点估计。</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb71-1"><a href="chap5.html#cb71-1" tabindex="-1"></a><span class="sc">></span> <span class="fu">exp</span>(<span class="fu">confint</span>(jointFit8.pbc, <span class="at">parm =</span> <span class="st">"Event"</span>))</span>