3228 lines
No EOL
93 KiB
HTML
3228 lines
No EOL
93 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="generator" content="quarto-1.7.34">
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
|
||
|
||
<title>Slides</title>
|
||
<style>
|
||
code{white-space: pre-wrap;}
|
||
span.smallcaps{font-variant: small-caps;}
|
||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||
div.column{flex: auto; overflow-x: auto;}
|
||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||
ul.task-list{list-style: none;}
|
||
ul.task-list li input[type="checkbox"] {
|
||
width: 0.8em;
|
||
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
||
vertical-align: middle;
|
||
}
|
||
/* CSS for syntax highlighting */
|
||
html { -webkit-text-size-adjust: 100%; }
|
||
pre > code.sourceCode { white-space: pre; position: relative; }
|
||
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
||
pre > code.sourceCode > span:empty { height: 1.2em; }
|
||
.sourceCode { overflow: visible; }
|
||
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
||
div.sourceCode { margin: 1em 0; }
|
||
pre.sourceCode { margin: 0; }
|
||
@media screen {
|
||
div.sourceCode { overflow: auto; }
|
||
}
|
||
@media print {
|
||
pre > code.sourceCode { white-space: pre-wrap; }
|
||
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
||
}
|
||
pre.numberSource code
|
||
{ counter-reset: source-line 0; }
|
||
pre.numberSource code > span
|
||
{ position: relative; left: -4em; counter-increment: source-line; }
|
||
pre.numberSource code > span > a:first-child::before
|
||
{ content: counter(source-line);
|
||
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
||
border: none; display: inline-block;
|
||
-webkit-touch-callout: none; -webkit-user-select: none;
|
||
-khtml-user-select: none; -moz-user-select: none;
|
||
-ms-user-select: none; user-select: none;
|
||
padding: 0 4px; width: 4em;
|
||
}
|
||
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
||
div.sourceCode
|
||
{ }
|
||
@media screen {
|
||
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
||
}
|
||
</style>
|
||
|
||
|
||
<script src="slides_files/libs/clipboard/clipboard.min.js"></script>
|
||
<script src="slides_files/libs/quarto-html/quarto.js" type="module"></script>
|
||
<script src="slides_files/libs/quarto-html/tabsets/tabsets.js" type="module"></script>
|
||
<script src="slides_files/libs/quarto-html/popper.min.js"></script>
|
||
<script src="slides_files/libs/quarto-html/tippy.umd.min.js"></script>
|
||
<script src="slides_files/libs/quarto-html/anchor.min.js"></script>
|
||
<link href="slides_files/libs/quarto-html/tippy.css" rel="stylesheet">
|
||
<link href="slides_files/libs/quarto-html/quarto-syntax-highlighting-c8ad9e5dbd60b7b70b38521ab19b7da4.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
||
<script src="slides_files/libs/bootstrap/bootstrap.min.js"></script>
|
||
<link href="slides_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||
<link href="slides_files/libs/bootstrap/bootstrap-0e7144b51b1311dce330ab5b48d20e8e.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
|
||
|
||
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
|
||
|
||
<script type="text/javascript">
|
||
const typesetMath = (el) => {
|
||
if (window.MathJax) {
|
||
// MathJax Typeset
|
||
window.MathJax.typeset([el]);
|
||
} else if (window.katex) {
|
||
// KaTeX Render
|
||
var mathElements = el.getElementsByClassName("math");
|
||
var macros = [];
|
||
for (var i = 0; i < mathElements.length; i++) {
|
||
var texText = mathElements[i].firstChild;
|
||
if (mathElements[i].tagName == "SPAN") {
|
||
window.katex.render(texText.data, mathElements[i], {
|
||
displayMode: mathElements[i].classList.contains('display'),
|
||
throwOnError: false,
|
||
macros: macros,
|
||
fleqn: false
|
||
});
|
||
}
|
||
}
|
||
}
|
||
}
|
||
window.Quarto = {
|
||
typesetMath
|
||
};
|
||
</script>
|
||
|
||
</head>
|
||
|
||
<body class="fullcontent quarto-light">
|
||
|
||
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
|
||
|
||
<main class="content" id="quarto-document-content">
|
||
|
||
<header id="title-block-header" class="quarto-title-block default">
|
||
<div class="quarto-title">
|
||
<h1 class="title">Slides</h1>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="quarto-title-meta">
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</header>
|
||
|
||
|
||
<section id="introduction-research-question" class="level1" data-number="1">
|
||
<h1 data-number="1"><span class="header-section-number">1</span> Introduction: research question</h1>
|
||
<section id="survival-after-transplantation-m" class="level2" data-number="1.1">
|
||
<h2 data-number="1.1" class="anchored" data-anchor-id="survival-after-transplantation-m"><span class="header-section-number">1.1</span> Survival after transplantation (M)</h2>
|
||
</section>
|
||
<section id="identify-predictors-m" class="level2" data-number="1.2">
|
||
<h2 data-number="1.2" class="anchored" data-anchor-id="identify-predictors-m"><span class="header-section-number">1.2</span> Identify Predictors (M)</h2>
|
||
</section>
|
||
<section id="why-survival-analysis-l" class="level2" data-number="1.3">
|
||
<h2 data-number="1.3" class="anchored" data-anchor-id="why-survival-analysis-l"><span class="header-section-number">1.3</span> Why Survival Analysis (L)</h2>
|
||
<p>Motivation: study the distribution of time to event <span class="math inline">\(T\)</span>.</p>
|
||
<p>Example: time of death after kidney transplant.</p>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div id="dmwvnehjxd" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||
<style>#dmwvnehjxd table {
|
||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
}
|
||
|
||
#dmwvnehjxd thead, #dmwvnehjxd tbody, #dmwvnehjxd tfoot, #dmwvnehjxd tr, #dmwvnehjxd td, #dmwvnehjxd th {
|
||
border-style: none;
|
||
}
|
||
|
||
#dmwvnehjxd p {
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_table {
|
||
display: table;
|
||
border-collapse: collapse;
|
||
line-height: normal;
|
||
margin-left: auto;
|
||
margin-right: auto;
|
||
color: #333333;
|
||
font-size: 16px;
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
background-color: #FFFFFF;
|
||
width: auto;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #A8A8A8;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #A8A8A8;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_caption {
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_title {
|
||
color: #333333;
|
||
font-size: 125%;
|
||
font-weight: initial;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-color: #FFFFFF;
|
||
border-bottom-width: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_subtitle {
|
||
color: #333333;
|
||
font-size: 85%;
|
||
font-weight: initial;
|
||
padding-top: 3px;
|
||
padding-bottom: 5px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-color: #FFFFFF;
|
||
border-top-width: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_heading {
|
||
background-color: #FFFFFF;
|
||
text-align: center;
|
||
border-bottom-color: #FFFFFF;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_bottom_border {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_col_headings {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_col_heading {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 6px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_column_spanner_outer {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
padding-top: 0;
|
||
padding-bottom: 0;
|
||
padding-left: 4px;
|
||
padding-right: 4px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_column_spanner_outer:first-child {
|
||
padding-left: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_column_spanner_outer:last-child {
|
||
padding-right: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_column_spanner {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 5px;
|
||
overflow-x: hidden;
|
||
display: inline-block;
|
||
width: 100%;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_spanner_row {
|
||
border-bottom-style: hidden;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_group_heading {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
text-align: left;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_empty_group_heading {
|
||
padding: 0.5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_from_md > :first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_from_md > :last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
margin: 10px;
|
||
border-top-style: solid;
|
||
border-top-width: 1px;
|
||
border-top-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_stub {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_stub_row_group {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
vertical-align: top;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_row_group_first td {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_row_group_first th {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_first_summary_row {
|
||
border-top-style: solid;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_first_summary_row.thick {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_last_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_grand_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_first_grand_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-style: double;
|
||
border-top-width: 6px;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_last_grand_summary_row_top {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: double;
|
||
border-bottom-width: 6px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_striped {
|
||
background-color: rgba(128, 128, 128, 0.05);
|
||
}
|
||
|
||
#dmwvnehjxd .gt_table_body {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_footnotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_footnote {
|
||
margin: 0px;
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_sourcenotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_sourcenote {
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_left {
|
||
text-align: left;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_center {
|
||
text-align: center;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_right {
|
||
text-align: right;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_font_normal {
|
||
font-weight: normal;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_font_bold {
|
||
font-weight: bold;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_font_italic {
|
||
font-style: italic;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_super {
|
||
font-size: 65%;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_footnote_marks {
|
||
font-size: 75%;
|
||
vertical-align: 0.4em;
|
||
position: initial;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_asterisk {
|
||
font-size: 100%;
|
||
vertical-align: 0;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_indent_1 {
|
||
text-indent: 5px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_indent_2 {
|
||
text-indent: 10px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_indent_3 {
|
||
text-indent: 15px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_indent_4 {
|
||
text-indent: 20px;
|
||
}
|
||
|
||
#dmwvnehjxd .gt_indent_5 {
|
||
text-indent: 25px;
|
||
}
|
||
|
||
#dmwvnehjxd .katex-display {
|
||
display: inline-flex !important;
|
||
margin-bottom: 0.75em !important;
|
||
}
|
||
|
||
#dmwvnehjxd div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
|
||
height: 0px !important;
|
||
}
|
||
</style>
|
||
|
||
<table class="gt_table caption-top table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
|
||
<thead>
|
||
<tr class="gt_col_headings header">
|
||
<th id="id" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">ID</th>
|
||
<th id="transplant" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Transplant</th>
|
||
<th id="death" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Death</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody class="gt_table_body">
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">1</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death">2005</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">2</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death">2009</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">3</td>
|
||
<td class="gt_row gt_center" headers="transplant">2001</td>
|
||
<td class="gt_row gt_center" headers="death">2005</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">4</td>
|
||
<td class="gt_row gt_center" headers="transplant">2003</td>
|
||
<td class="gt_row gt_center" headers="death">2004</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">5</td>
|
||
<td class="gt_row gt_center" headers="transplant">2004</td>
|
||
<td class="gt_row gt_center" headers="death">2016</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<p>We then calculate time to death for each respondents.</p>
|
||
<p>With this, all we need is to fit a linear model <code>t ~ X</code> or <code>log(t) ~ X</code></p>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div id="crsebdgcrl" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||
<style>#crsebdgcrl table {
|
||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
}
|
||
|
||
#crsebdgcrl thead, #crsebdgcrl tbody, #crsebdgcrl tfoot, #crsebdgcrl tr, #crsebdgcrl td, #crsebdgcrl th {
|
||
border-style: none;
|
||
}
|
||
|
||
#crsebdgcrl p {
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_table {
|
||
display: table;
|
||
border-collapse: collapse;
|
||
line-height: normal;
|
||
margin-left: auto;
|
||
margin-right: auto;
|
||
color: #333333;
|
||
font-size: 16px;
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
background-color: #FFFFFF;
|
||
width: auto;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #A8A8A8;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #A8A8A8;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_caption {
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_title {
|
||
color: #333333;
|
||
font-size: 125%;
|
||
font-weight: initial;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-color: #FFFFFF;
|
||
border-bottom-width: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_subtitle {
|
||
color: #333333;
|
||
font-size: 85%;
|
||
font-weight: initial;
|
||
padding-top: 3px;
|
||
padding-bottom: 5px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-color: #FFFFFF;
|
||
border-top-width: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_heading {
|
||
background-color: #FFFFFF;
|
||
text-align: center;
|
||
border-bottom-color: #FFFFFF;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_bottom_border {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_col_headings {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_col_heading {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 6px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#crsebdgcrl .gt_column_spanner_outer {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
padding-top: 0;
|
||
padding-bottom: 0;
|
||
padding-left: 4px;
|
||
padding-right: 4px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_column_spanner_outer:first-child {
|
||
padding-left: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_column_spanner_outer:last-child {
|
||
padding-right: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_column_spanner {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 5px;
|
||
overflow-x: hidden;
|
||
display: inline-block;
|
||
width: 100%;
|
||
}
|
||
|
||
#crsebdgcrl .gt_spanner_row {
|
||
border-bottom-style: hidden;
|
||
}
|
||
|
||
#crsebdgcrl .gt_group_heading {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
text-align: left;
|
||
}
|
||
|
||
#crsebdgcrl .gt_empty_group_heading {
|
||
padding: 0.5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
#crsebdgcrl .gt_from_md > :first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_from_md > :last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
margin: 10px;
|
||
border-top-style: solid;
|
||
border-top-width: 1px;
|
||
border-top-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#crsebdgcrl .gt_stub {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_stub_row_group {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
vertical-align: top;
|
||
}
|
||
|
||
#crsebdgcrl .gt_row_group_first td {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_row_group_first th {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_first_summary_row {
|
||
border-top-style: solid;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_first_summary_row.thick {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_last_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_grand_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_first_grand_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-style: double;
|
||
border-top-width: 6px;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_last_grand_summary_row_top {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: double;
|
||
border-bottom-width: 6px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_striped {
|
||
background-color: rgba(128, 128, 128, 0.05);
|
||
}
|
||
|
||
#crsebdgcrl .gt_table_body {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_footnotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_footnote {
|
||
margin: 0px;
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_sourcenotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#crsebdgcrl .gt_sourcenote {
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_left {
|
||
text-align: left;
|
||
}
|
||
|
||
#crsebdgcrl .gt_center {
|
||
text-align: center;
|
||
}
|
||
|
||
#crsebdgcrl .gt_right {
|
||
text-align: right;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
#crsebdgcrl .gt_font_normal {
|
||
font-weight: normal;
|
||
}
|
||
|
||
#crsebdgcrl .gt_font_bold {
|
||
font-weight: bold;
|
||
}
|
||
|
||
#crsebdgcrl .gt_font_italic {
|
||
font-style: italic;
|
||
}
|
||
|
||
#crsebdgcrl .gt_super {
|
||
font-size: 65%;
|
||
}
|
||
|
||
#crsebdgcrl .gt_footnote_marks {
|
||
font-size: 75%;
|
||
vertical-align: 0.4em;
|
||
position: initial;
|
||
}
|
||
|
||
#crsebdgcrl .gt_asterisk {
|
||
font-size: 100%;
|
||
vertical-align: 0;
|
||
}
|
||
|
||
#crsebdgcrl .gt_indent_1 {
|
||
text-indent: 5px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_indent_2 {
|
||
text-indent: 10px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_indent_3 {
|
||
text-indent: 15px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_indent_4 {
|
||
text-indent: 20px;
|
||
}
|
||
|
||
#crsebdgcrl .gt_indent_5 {
|
||
text-indent: 25px;
|
||
}
|
||
|
||
#crsebdgcrl .katex-display {
|
||
display: inline-flex !important;
|
||
margin-bottom: 0.75em !important;
|
||
}
|
||
|
||
#crsebdgcrl div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
|
||
height: 0px !important;
|
||
}
|
||
</style>
|
||
|
||
<table class="gt_table caption-top table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
|
||
<thead>
|
||
<tr class="gt_col_headings header">
|
||
<th id="id" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">ID</th>
|
||
<th id="transplant" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Transplant</th>
|
||
<th id="death" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Death</th>
|
||
<th id="t" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Time to death</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody class="gt_table_body">
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">1</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death">2005</td>
|
||
<td class="gt_row gt_center" headers="t">5</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">2</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death">2009</td>
|
||
<td class="gt_row gt_center" headers="t">9</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">3</td>
|
||
<td class="gt_row gt_center" headers="transplant">2001</td>
|
||
<td class="gt_row gt_center" headers="death">2005</td>
|
||
<td class="gt_row gt_center" headers="t">4</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">4</td>
|
||
<td class="gt_row gt_center" headers="transplant">2003</td>
|
||
<td class="gt_row gt_center" headers="death">2004</td>
|
||
<td class="gt_row gt_center" headers="t">1</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">5</td>
|
||
<td class="gt_row gt_center" headers="transplant">2004</td>
|
||
<td class="gt_row gt_center" headers="death">2016</td>
|
||
<td class="gt_row gt_center" headers="t">12</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-6-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<p>What if we do not know when exactly some respondents die?</p>
|
||
<p>Scenario 1: the study ends at the year 2008?</p>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div id="jlkzoqmglr" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||
<style>#jlkzoqmglr table {
|
||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
}
|
||
|
||
#jlkzoqmglr thead, #jlkzoqmglr tbody, #jlkzoqmglr tfoot, #jlkzoqmglr tr, #jlkzoqmglr td, #jlkzoqmglr th {
|
||
border-style: none;
|
||
}
|
||
|
||
#jlkzoqmglr p {
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_table {
|
||
display: table;
|
||
border-collapse: collapse;
|
||
line-height: normal;
|
||
margin-left: auto;
|
||
margin-right: auto;
|
||
color: #333333;
|
||
font-size: 16px;
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
background-color: #FFFFFF;
|
||
width: auto;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #A8A8A8;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #A8A8A8;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_caption {
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_title {
|
||
color: #333333;
|
||
font-size: 125%;
|
||
font-weight: initial;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-color: #FFFFFF;
|
||
border-bottom-width: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_subtitle {
|
||
color: #333333;
|
||
font-size: 85%;
|
||
font-weight: initial;
|
||
padding-top: 3px;
|
||
padding-bottom: 5px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-color: #FFFFFF;
|
||
border-top-width: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_heading {
|
||
background-color: #FFFFFF;
|
||
text-align: center;
|
||
border-bottom-color: #FFFFFF;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_bottom_border {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_col_headings {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_col_heading {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 6px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_column_spanner_outer {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
padding-top: 0;
|
||
padding-bottom: 0;
|
||
padding-left: 4px;
|
||
padding-right: 4px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_column_spanner_outer:first-child {
|
||
padding-left: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_column_spanner_outer:last-child {
|
||
padding-right: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_column_spanner {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 5px;
|
||
overflow-x: hidden;
|
||
display: inline-block;
|
||
width: 100%;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_spanner_row {
|
||
border-bottom-style: hidden;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_group_heading {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
text-align: left;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_empty_group_heading {
|
||
padding: 0.5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_from_md > :first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_from_md > :last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
margin: 10px;
|
||
border-top-style: solid;
|
||
border-top-width: 1px;
|
||
border-top-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_stub {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_stub_row_group {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
vertical-align: top;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_row_group_first td {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_row_group_first th {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_first_summary_row {
|
||
border-top-style: solid;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_first_summary_row.thick {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_last_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_grand_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_first_grand_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-style: double;
|
||
border-top-width: 6px;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_last_grand_summary_row_top {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: double;
|
||
border-bottom-width: 6px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_striped {
|
||
background-color: rgba(128, 128, 128, 0.05);
|
||
}
|
||
|
||
#jlkzoqmglr .gt_table_body {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_footnotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_footnote {
|
||
margin: 0px;
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_sourcenotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_sourcenote {
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_left {
|
||
text-align: left;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_center {
|
||
text-align: center;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_right {
|
||
text-align: right;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_font_normal {
|
||
font-weight: normal;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_font_bold {
|
||
font-weight: bold;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_font_italic {
|
||
font-style: italic;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_super {
|
||
font-size: 65%;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_footnote_marks {
|
||
font-size: 75%;
|
||
vertical-align: 0.4em;
|
||
position: initial;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_asterisk {
|
||
font-size: 100%;
|
||
vertical-align: 0;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_indent_1 {
|
||
text-indent: 5px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_indent_2 {
|
||
text-indent: 10px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_indent_3 {
|
||
text-indent: 15px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_indent_4 {
|
||
text-indent: 20px;
|
||
}
|
||
|
||
#jlkzoqmglr .gt_indent_5 {
|
||
text-indent: 25px;
|
||
}
|
||
|
||
#jlkzoqmglr .katex-display {
|
||
display: inline-flex !important;
|
||
margin-bottom: 0.75em !important;
|
||
}
|
||
|
||
#jlkzoqmglr div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
|
||
height: 0px !important;
|
||
}
|
||
</style>
|
||
|
||
<table class="gt_table caption-top table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
|
||
<thead>
|
||
<tr class="gt_col_headings header">
|
||
<th id="id" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">ID</th>
|
||
<th id="transplant" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Transplant</th>
|
||
<th id="death_censored_txt" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Death</th>
|
||
<th id="t_1_txt" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Time to death</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody class="gt_table_body">
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">1</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">2005</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">5</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">2</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">> 2008</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">> 8</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">3</td>
|
||
<td class="gt_row gt_center" headers="transplant">2001</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">2005</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">4</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">4</td>
|
||
<td class="gt_row gt_center" headers="transplant">2003</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">2004</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">1</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">5</td>
|
||
<td class="gt_row gt_center" headers="transplant">2004</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">> 2008</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">> 4</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-9-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-9-2.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p><strong>Right Censoring</strong>: only observe the event (death) if it occurs before a certain time (2008).</p>
|
||
<hr>
|
||
<p>Scenario 2: respondent 3 move away; loss follow up</p>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div id="svjlifowwb" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||
<style>#svjlifowwb table {
|
||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
}
|
||
|
||
#svjlifowwb thead, #svjlifowwb tbody, #svjlifowwb tfoot, #svjlifowwb tr, #svjlifowwb td, #svjlifowwb th {
|
||
border-style: none;
|
||
}
|
||
|
||
#svjlifowwb p {
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_table {
|
||
display: table;
|
||
border-collapse: collapse;
|
||
line-height: normal;
|
||
margin-left: auto;
|
||
margin-right: auto;
|
||
color: #333333;
|
||
font-size: 16px;
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
background-color: #FFFFFF;
|
||
width: auto;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #A8A8A8;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #A8A8A8;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_caption {
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
}
|
||
|
||
#svjlifowwb .gt_title {
|
||
color: #333333;
|
||
font-size: 125%;
|
||
font-weight: initial;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-color: #FFFFFF;
|
||
border-bottom-width: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_subtitle {
|
||
color: #333333;
|
||
font-size: 85%;
|
||
font-weight: initial;
|
||
padding-top: 3px;
|
||
padding-bottom: 5px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-color: #FFFFFF;
|
||
border-top-width: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_heading {
|
||
background-color: #FFFFFF;
|
||
text-align: center;
|
||
border-bottom-color: #FFFFFF;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_bottom_border {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_col_headings {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_col_heading {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 6px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#svjlifowwb .gt_column_spanner_outer {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: normal;
|
||
text-transform: inherit;
|
||
padding-top: 0;
|
||
padding-bottom: 0;
|
||
padding-left: 4px;
|
||
padding-right: 4px;
|
||
}
|
||
|
||
#svjlifowwb .gt_column_spanner_outer:first-child {
|
||
padding-left: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_column_spanner_outer:last-child {
|
||
padding-right: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_column_spanner {
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: bottom;
|
||
padding-top: 5px;
|
||
padding-bottom: 5px;
|
||
overflow-x: hidden;
|
||
display: inline-block;
|
||
width: 100%;
|
||
}
|
||
|
||
#svjlifowwb .gt_spanner_row {
|
||
border-bottom-style: hidden;
|
||
}
|
||
|
||
#svjlifowwb .gt_group_heading {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
text-align: left;
|
||
}
|
||
|
||
#svjlifowwb .gt_empty_group_heading {
|
||
padding: 0.5px;
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
#svjlifowwb .gt_from_md > :first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_from_md > :last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
margin: 10px;
|
||
border-top-style: solid;
|
||
border-top-width: 1px;
|
||
border-top-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 1px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 1px;
|
||
border-right-color: #D3D3D3;
|
||
vertical-align: middle;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
#svjlifowwb .gt_stub {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_stub_row_group {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
font-size: 100%;
|
||
font-weight: initial;
|
||
text-transform: inherit;
|
||
border-right-style: solid;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
vertical-align: top;
|
||
}
|
||
|
||
#svjlifowwb .gt_row_group_first td {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#svjlifowwb .gt_row_group_first th {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#svjlifowwb .gt_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_first_summary_row {
|
||
border-top-style: solid;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_first_summary_row.thick {
|
||
border-top-width: 2px;
|
||
}
|
||
|
||
#svjlifowwb .gt_last_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_grand_summary_row {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
text-transform: inherit;
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_first_grand_summary_row {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-top-style: double;
|
||
border-top-width: 6px;
|
||
border-top-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_last_grand_summary_row_top {
|
||
padding-top: 8px;
|
||
padding-bottom: 8px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
border-bottom-style: double;
|
||
border-bottom-width: 6px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_striped {
|
||
background-color: rgba(128, 128, 128, 0.05);
|
||
}
|
||
|
||
#svjlifowwb .gt_table_body {
|
||
border-top-style: solid;
|
||
border-top-width: 2px;
|
||
border-top-color: #D3D3D3;
|
||
border-bottom-style: solid;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_footnotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_footnote {
|
||
margin: 0px;
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_sourcenotes {
|
||
color: #333333;
|
||
background-color: #FFFFFF;
|
||
border-bottom-style: none;
|
||
border-bottom-width: 2px;
|
||
border-bottom-color: #D3D3D3;
|
||
border-left-style: none;
|
||
border-left-width: 2px;
|
||
border-left-color: #D3D3D3;
|
||
border-right-style: none;
|
||
border-right-width: 2px;
|
||
border-right-color: #D3D3D3;
|
||
}
|
||
|
||
#svjlifowwb .gt_sourcenote {
|
||
font-size: 90%;
|
||
padding-top: 4px;
|
||
padding-bottom: 4px;
|
||
padding-left: 5px;
|
||
padding-right: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_left {
|
||
text-align: left;
|
||
}
|
||
|
||
#svjlifowwb .gt_center {
|
||
text-align: center;
|
||
}
|
||
|
||
#svjlifowwb .gt_right {
|
||
text-align: right;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
#svjlifowwb .gt_font_normal {
|
||
font-weight: normal;
|
||
}
|
||
|
||
#svjlifowwb .gt_font_bold {
|
||
font-weight: bold;
|
||
}
|
||
|
||
#svjlifowwb .gt_font_italic {
|
||
font-style: italic;
|
||
}
|
||
|
||
#svjlifowwb .gt_super {
|
||
font-size: 65%;
|
||
}
|
||
|
||
#svjlifowwb .gt_footnote_marks {
|
||
font-size: 75%;
|
||
vertical-align: 0.4em;
|
||
position: initial;
|
||
}
|
||
|
||
#svjlifowwb .gt_asterisk {
|
||
font-size: 100%;
|
||
vertical-align: 0;
|
||
}
|
||
|
||
#svjlifowwb .gt_indent_1 {
|
||
text-indent: 5px;
|
||
}
|
||
|
||
#svjlifowwb .gt_indent_2 {
|
||
text-indent: 10px;
|
||
}
|
||
|
||
#svjlifowwb .gt_indent_3 {
|
||
text-indent: 15px;
|
||
}
|
||
|
||
#svjlifowwb .gt_indent_4 {
|
||
text-indent: 20px;
|
||
}
|
||
|
||
#svjlifowwb .gt_indent_5 {
|
||
text-indent: 25px;
|
||
}
|
||
|
||
#svjlifowwb .katex-display {
|
||
display: inline-flex !important;
|
||
margin-bottom: 0.75em !important;
|
||
}
|
||
|
||
#svjlifowwb div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
|
||
height: 0px !important;
|
||
}
|
||
</style>
|
||
|
||
<table class="gt_table caption-top table table-sm table-striped small" data-quarto-postprocess="true" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
|
||
<thead>
|
||
<tr class="gt_col_headings header">
|
||
<th id="id" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">ID</th>
|
||
<th id="transplant" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Transplant</th>
|
||
<th id="death_censored_txt" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Death</th>
|
||
<th id="t_1_txt" class="gt_col_heading gt_columns_bottom_border gt_center" data-quarto-table-cell-role="th" scope="col">Time to death</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody class="gt_table_body">
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">1</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">2005</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">5</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">2</td>
|
||
<td class="gt_row gt_center" headers="transplant">2000</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">> 2008</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">> 8</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">3</td>
|
||
<td class="gt_row gt_center" headers="transplant">2001</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">> 2005</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">> 4</td>
|
||
</tr>
|
||
<tr class="even">
|
||
<td class="gt_row gt_center" headers="id">4</td>
|
||
<td class="gt_row gt_center" headers="transplant">2003</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">2004</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">1</td>
|
||
</tr>
|
||
<tr class="odd">
|
||
<td class="gt_row gt_center" headers="id">5</td>
|
||
<td class="gt_row gt_center" headers="transplant">2004</td>
|
||
<td class="gt_row gt_center" headers="death_censored_txt">> 2008</td>
|
||
<td class="gt_row gt_center" headers="t_1_txt">> 4</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-11-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-11-2.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<p>How many patients are right censored?</p>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-12-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="challenges-in-survival-analysis-l" class="level2" data-number="1.4">
|
||
<h2 data-number="1.4" class="anchored" data-anchor-id="challenges-in-survival-analysis-l"><span class="header-section-number">1.4</span> Challenges in Survival Analysis (L)</h2>
|
||
<ul>
|
||
<li><strong>Right Censoring</strong>: only observe the event if it occurs before a certain time.</li>
|
||
<li><strong>Left Censoring</strong>: event has occurred prior to the start of a research
|
||
<ul>
|
||
<li>Follow up every 3 years.</li>
|
||
<li>Event has occurred -> event happened sometime before follow up.</li>
|
||
</ul></li>
|
||
<li><strong>Left Truncation</strong>: delayed entry; respondents are included only if they survived long enough.
|
||
<ul>
|
||
<li>Start follow up with patients 100 days after the transplant</li>
|
||
<li>Patients dies within 100 day wouldn’t be included in the dataset</li>
|
||
</ul></li>
|
||
<li><strong>Right Truncation</strong>: respondents are included only if they have already experienced the event.
|
||
<ul>
|
||
<li>Retrospective analysis from deceased patients between 1990 and 2000.</li>
|
||
<li>Patients not dead before 2000 are not included in the dataset.</li>
|
||
</ul></li>
|
||
</ul>
|
||
</section>
|
||
</section>
|
||
<section id="method-result" class="level1" data-number="2">
|
||
<h1 data-number="2"><span class="header-section-number">2</span> Method & Result</h1>
|
||
<section id="explain-dataset-m" class="level2" data-number="2.1">
|
||
<h2 data-number="2.1" class="anchored" data-anchor-id="explain-dataset-m"><span class="header-section-number">2.1</span> Explain Dataset (M)</h2>
|
||
<div class="callout callout-style-default callout-note callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Things to highlight in figures
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<ul>
|
||
<li><p>sex and recipient age are similar across <code>tx.type</code></p></li>
|
||
<li><p>Living donors have less <code>hla.match</code> then cadaveric donors</p></li>
|
||
<li><p>There is age difference between different <code>tx.type</code></p></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<section id="sex-tx.tpye" class="level3" data-number="2.1.1">
|
||
<h3 data-number="2.1.1" class="anchored" data-anchor-id="sex-tx.tpye"><span class="header-section-number">2.1.1</span> <code>sex</code> ~ <code>tx.tpye</code></h3>
|
||
<div class="callout callout-style-default callout-note callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Note
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<p><code>sex</code> are similar across <code>tx.type</code></p>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-13-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
<section id="table-1-l" class="level2" data-number="2.2">
|
||
<h2 data-number="2.2" class="anchored" data-anchor-id="table-1-l"><span class="header-section-number">2.2</span> Table 1 (L)</h2>
|
||
<section id="hla-match-hla.match" class="level3" data-number="2.2.1">
|
||
<h3 data-number="2.2.1" class="anchored" data-anchor-id="hla-match-hla.match"><span class="header-section-number">2.2.1</span> HLA match <code>hla.match</code></h3>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>
|
||
0 1 2 3 4 5 6 <NA>
|
||
784 1504 1553 3778 1278 365 279 234 </code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-15-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-16-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="callout callout-style-default callout-warning callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Warning
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<p>TODO: change to percentage within each <code>tx.type</code></p>
|
||
</div>
|
||
</div>
|
||
<div class="callout callout-style-default callout-note callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Note
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<p>Living donors have less <code>hla.match</code> then cadaveric donors</p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="donor-age-age.donor" class="level3" data-number="2.2.2">
|
||
<h3 data-number="2.2.2" class="anchored" data-anchor-id="donor-age-age.donor"><span class="header-section-number">2.2.2</span> Donor age <code>age.donor</code></h3>
|
||
<div class="cell">
|
||
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(dat<span class="sc">$</span>age.donor, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 31.29952</code></pre>
|
||
</div>
|
||
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(dat<span class="sc">$</span>age.donor, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 33</code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_count()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-18-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_count()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-19-1.png" class="img-fluid figure-img" width="768"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-20-1.png" class="img-fluid figure-img" width="768"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-21-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_boxplot()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-22-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="callout callout-style-default callout-note callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Note
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<p>There is age difference between different <code>tx.type</code></p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="recipient-age-age.rec" class="level3" data-number="2.2.3">
|
||
<h3 data-number="2.2.3" class="anchored" data-anchor-id="recipient-age-age.rec"><span class="header-section-number">2.2.3</span> Recipient Age <code>age.rec</code></h3>
|
||
<div class="cell">
|
||
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(dat<span class="sc">$</span>age.rec, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 11.64653</code></pre>
|
||
</div>
|
||
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(dat<span class="sc">$</span>age.rec, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 13</code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 9 rows containing non-finite outside the scale range
|
||
(`stat_count()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-24-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_boxplot()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-25-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 9 rows containing non-finite outside the scale range
|
||
(`stat_count()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-26-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 9 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-27-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 2250 rows containing non-finite outside the scale range
|
||
(`stat_boxplot()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-28-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="cold-ischemia-time-cold.isc" class="level3" data-number="2.2.4">
|
||
<h3 data-number="2.2.4" class="anchored" data-anchor-id="cold-ischemia-time-cold.isc"><span class="header-section-number">2.2.4</span> Cold Ischemia Time <code>cold.isc</code></h3>
|
||
<div class="cell">
|
||
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(dat<span class="sc">$</span>cold.isc, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 10.85967</code></pre>
|
||
</div>
|
||
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(dat<span class="sc">$</span>cold.isc, <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>[1] 7</code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 2250 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-30-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 2250 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-31-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 2250 rows containing non-finite outside the scale range
|
||
(`stat_density()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-32-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="transplant-type-tx.type" class="level3" data-number="2.2.5">
|
||
<h3 data-number="2.2.5" class="anchored" data-anchor-id="transplant-type-tx.type"><span class="header-section-number">2.2.5</span> Transplant Type <code>tx.type</code></h3>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>
|
||
Cadaveric Living <NA>
|
||
5148 4627 0 </code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="sourceCode cell-code" id="cb28"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a>dat<span class="sc">$</span>tx.type <span class="sc">|></span> <span class="fu">table</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>
|
||
Cadaveric Living
|
||
5148 4627 </code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-35-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="year-year" class="level3" data-number="2.2.6">
|
||
<h3 data-number="2.2.6" class="anchored" data-anchor-id="year-year"><span class="header-section-number">2.2.6</span> Year <code>year</code></h3>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>
|
||
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002
|
||
728 734 666 736 787 813 789 745 740 842 706 834 655 </code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-37-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-38-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-39-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 9 rows containing non-finite outside the scale range
|
||
(`stat_boxplot()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-40-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stderr">
|
||
<pre><code>Warning: Removed 113 rows containing non-finite outside the scale range
|
||
(`stat_boxplot()`).</code></pre>
|
||
</div>
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-41-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
<section id="kaplan-meier" class="level2" data-number="2.3">
|
||
<h2 data-number="2.3" class="anchored" data-anchor-id="kaplan-meier"><span class="header-section-number">2.3</span> Kaplan-Meier</h2>
|
||
<section id="overall-l" class="level3" data-number="2.3.1">
|
||
<h3 data-number="2.3.1" class="anchored" data-anchor-id="overall-l"><span class="header-section-number">2.3.1</span> Overall (L)</h3>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>Call: survfit(formula = Surv(follow.up, death) ~ 1, data = dat)
|
||
|
||
time n.risk n.event survival std.err lower 95% CI upper 95% CI
|
||
4 4150 359 0.953 0.00252 0.948 0.958
|
||
8 1197 86 0.919 0.00449 0.910 0.928
|
||
12 48 20 0.888 0.00867 0.871 0.905</code></pre>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-43-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="tx.type-m" class="level3" data-number="2.3.2">
|
||
<h3 data-number="2.3.2" class="anchored" data-anchor-id="tx.type-m"><span class="header-section-number">2.3.2</span> <code>tx.type</code> (M)</h3>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-44-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
<section id="cox-model" class="level2" data-number="2.4">
|
||
<h2 data-number="2.4" class="anchored" data-anchor-id="cox-model"><span class="header-section-number">2.4</span> Cox Model</h2>
|
||
<section id="death-distribution" class="level3" data-number="2.4.1">
|
||
<h3 data-number="2.4.1" class="anchored" data-anchor-id="death-distribution"><span class="header-section-number">2.4.1</span> <code>death</code> Distribution (?)</h3>
|
||
<div class="cell">
|
||
<div class="cell-output-display">
|
||
<div>
|
||
<figure class="figure">
|
||
<p><img src="slides_files/figure-html/unnamed-chunk-48-1.png" class="img-fluid figure-img" width="672"></p>
|
||
</figure>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="overall-l-1" class="level3" data-number="2.4.2">
|
||
<h3 data-number="2.4.2" class="anchored" data-anchor-id="overall-l-1"><span class="header-section-number">2.4.2</span> Overall (L)</h3>
|
||
<div class="callout callout-style-default callout-note callout-titled">
|
||
<div class="callout-header d-flex align-content-center">
|
||
<div class="callout-icon-container">
|
||
<i class="callout-icon"></i>
|
||
</div>
|
||
<div class="callout-title-container flex-fill">
|
||
Note
|
||
</div>
|
||
</div>
|
||
<div class="callout-body-container callout-body">
|
||
<p>skip overall, jump directly to <code>tx.type</code></p>
|
||
</div>
|
||
</div>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code># A tibble: 7 × 5
|
||
fu.interval n.censored n.event n.at.risk hazard.rate
|
||
<dbl> <int> <int> <dbl> <dbl>
|
||
1 0.333 830 152 9775 0.0155
|
||
2 0.667 491 37 8793 0.00421
|
||
3 1 613 27 8265 0.00327
|
||
4 2 1164 62 7625 0.00813
|
||
5 3 1143 41 6399 0.00641
|
||
6 4 1053 40 5215 0.00767
|
||
7 5 919 31 4122 0.00752</code></pre>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="tx.type-m-1" class="level3" data-number="2.4.3">
|
||
<h3 data-number="2.4.3" class="anchored" data-anchor-id="tx.type-m-1"><span class="header-section-number">2.4.3</span> <code>tx.type</code> (M)</h3>
|
||
</section>
|
||
<section id="age-continuous-l" class="level3" data-number="2.4.4">
|
||
<h3 data-number="2.4.4" class="anchored" data-anchor-id="age-continuous-l"><span class="header-section-number">2.4.4</span> <code>age</code> (continuous) (L)</h3>
|
||
</section>
|
||
<section id="age-categorical-m" class="level3" data-number="2.4.5">
|
||
<h3 data-number="2.4.5" class="anchored" data-anchor-id="age-categorical-m"><span class="header-section-number">2.4.5</span> <code>age</code> (categorical) (M)</h3>
|
||
</section>
|
||
<section id="full-model-l" class="level3" data-number="2.4.6">
|
||
<h3 data-number="2.4.6" class="anchored" data-anchor-id="full-model-l"><span class="header-section-number">2.4.6</span> Full model (L)</h3>
|
||
<div class="cell">
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>Call:
|
||
coxph(formula = Surv(follow.up, death) ~ hla.match + tx.type,
|
||
data = dat)
|
||
|
||
n= 9541, number of events= 451
|
||
(234 observations deleted due to missingness)
|
||
|
||
coef exp(coef) se(coef) z Pr(>|z|)
|
||
hla.match1 -0.08845 0.91535 0.17308 -0.511 0.60933
|
||
hla.match2 -0.36340 0.69531 0.17919 -2.028 0.04256 *
|
||
hla.match3 -0.50810 0.60164 0.18298 -2.777 0.00549 **
|
||
hla.match4 -0.65410 0.51991 0.22221 -2.944 0.00324 **
|
||
hla.match5 -0.39445 0.67405 0.29410 -1.341 0.17985
|
||
hla.match6 -0.51491 0.59755 0.31489 -1.635 0.10201
|
||
tx.typeLiving 0.39049 1.47771 0.12688 3.078 0.00209 **
|
||
---
|
||
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
|
||
|
||
exp(coef) exp(-coef) lower .95 upper .95
|
||
hla.match1 0.9153 1.0925 0.6520 1.2850
|
||
hla.match2 0.6953 1.4382 0.4894 0.9879
|
||
hla.match3 0.6016 1.6621 0.4203 0.8612
|
||
hla.match4 0.5199 1.9234 0.3363 0.8037
|
||
hla.match5 0.6740 1.4836 0.3787 1.1996
|
||
hla.match6 0.5976 1.6735 0.3224 1.1077
|
||
tx.typeLiving 1.4777 0.6767 1.1524 1.8949
|
||
|
||
Concordance= 0.613 (se = 0.014 )
|
||
Likelihood ratio test= 56.79 on 7 df, p=7e-10
|
||
Wald test = 57.08 on 7 df, p=6e-10
|
||
Score (logrank) test = 59.51 on 7 df, p=2e-10</code></pre>
|
||
</div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>Call:
|
||
coxph(formula = Surv(follow.up, death) ~ hla.match * tx.type,
|
||
data = dat)
|
||
|
||
n= 9541, number of events= 451
|
||
(234 observations deleted due to missingness)
|
||
|
||
coef exp(coef) se(coef) z Pr(>|z|)
|
||
hla.match1 0.8094 2.2467 0.8165 0.991 0.3215
|
||
hla.match2 1.1371 3.1176 0.7530 1.510 0.1311
|
||
hla.match3 0.4217 1.5245 0.7140 0.591 0.5548
|
||
hla.match4 0.1094 1.1156 0.7341 0.149 0.8816
|
||
hla.match5 0.4754 1.6087 0.7820 0.608 0.5432
|
||
hla.match6 0.5836 1.7925 0.8021 0.728 0.4669
|
||
tx.typeLiving 1.3801 3.9752 0.7218 1.912 0.0559 .
|
||
hla.match1:tx.typeLiving -0.9614 0.3823 0.8355 -1.151 0.2498
|
||
hla.match2:tx.typeLiving -1.6578 0.1905 0.7762 -2.136 0.0327 *
|
||
hla.match3:tx.typeLiving -1.0096 0.3644 0.7461 -1.353 0.1760
|
||
hla.match4:tx.typeLiving -0.5175 0.5960 0.7863 -0.658 0.5105
|
||
hla.match5:tx.typeLiving -0.8601 0.4231 0.8805 -0.977 0.3286
|
||
hla.match6:tx.typeLiving -1.3342 0.2634 0.9113 -1.464 0.1432
|
||
---
|
||
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
|
||
|
||
exp(coef) exp(-coef) lower .95 upper .95
|
||
hla.match1 2.2467 0.4451 0.45341 11.1322
|
||
hla.match2 3.1176 0.3208 0.71257 13.6400
|
||
hla.match3 1.5245 0.6559 0.37617 6.1787
|
||
hla.match4 1.1156 0.8964 0.26460 4.7032
|
||
hla.match5 1.6087 0.6216 0.34737 7.4498
|
||
hla.match6 1.7925 0.5579 0.37212 8.6342
|
||
tx.typeLiving 3.9752 0.2516 0.96600 16.3580
|
||
hla.match1:tx.typeLiving 0.3823 2.6155 0.07435 1.9662
|
||
hla.match2:tx.typeLiving 0.1905 5.2480 0.04162 0.8723
|
||
hla.match3:tx.typeLiving 0.3644 2.7444 0.08443 1.5726
|
||
hla.match4:tx.typeLiving 0.5960 1.6778 0.12763 2.7836
|
||
hla.match5:tx.typeLiving 0.4231 2.3635 0.07533 2.3763
|
||
hla.match6:tx.typeLiving 0.2634 3.7971 0.04414 1.5712
|
||
|
||
Concordance= 0.615 (se = 0.014 )
|
||
Likelihood ratio test= 66.78 on 13 df, p=3e-09
|
||
Wald test = 65.9 on 13 df, p=5e-09
|
||
Score (logrank) test = 69.92 on 13 df, p=8e-10</code></pre>
|
||
</div>
|
||
<div class="cell-output cell-output-stdout">
|
||
<pre><code>Analysis of Deviance Table
|
||
Cox model: response is Surv(follow.up, death)
|
||
Model 1: ~ hla.match + tx.type
|
||
Model 2: ~ hla.match * tx.type
|
||
loglik Chisq Df Pr(>|Chi|)
|
||
1 -3848.5
|
||
2 -3843.5 9.9891 6 0.1251</code></pre>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section id="discussion-include-year-or-not" class="level3" data-number="2.4.7">
|
||
<h3 data-number="2.4.7" class="anchored" data-anchor-id="discussion-include-year-or-not"><span class="header-section-number">2.4.7</span> Discussion: include <code>year</code> or not?</h3>
|
||
</section>
|
||
</section>
|
||
<section id="assumption-testing" class="level2" data-number="2.5">
|
||
<h2 data-number="2.5" class="anchored" data-anchor-id="assumption-testing"><span class="header-section-number">2.5</span> Assumption Testing</h2>
|
||
</section>
|
||
</section>
|
||
<section id="conclusion-m-l" class="level1" data-number="3">
|
||
<h1 data-number="3"><span class="header-section-number">3</span> Conclusion (M + L)</h1>
|
||
</section>
|
||
|
||
</main>
|
||
<!-- /main column -->
|
||
<script id="quarto-html-after-body" type="application/javascript">
|
||
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||
const icon = "";
|
||
const anchorJS = new window.AnchorJS();
|
||
anchorJS.options = {
|
||
placement: 'right',
|
||
icon: icon
|
||
};
|
||
anchorJS.add('.anchored');
|
||
const isCodeAnnotation = (el) => {
|
||
for (const clz of el.classList) {
|
||
if (clz.startsWith('code-annotation-')) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
const onCopySuccess = function(e) {
|
||
// button target
|
||
const button = e.trigger;
|
||
// don't keep focus
|
||
button.blur();
|
||
// flash "checked"
|
||
button.classList.add('code-copy-button-checked');
|
||
var currentTitle = button.getAttribute("title");
|
||
button.setAttribute("title", "Copied!");
|
||
let tooltip;
|
||
if (window.bootstrap) {
|
||
button.setAttribute("data-bs-toggle", "tooltip");
|
||
button.setAttribute("data-bs-placement", "left");
|
||
button.setAttribute("data-bs-title", "Copied!");
|
||
tooltip = new bootstrap.Tooltip(button,
|
||
{ trigger: "manual",
|
||
customClass: "code-copy-button-tooltip",
|
||
offset: [0, -8]});
|
||
tooltip.show();
|
||
}
|
||
setTimeout(function() {
|
||
if (tooltip) {
|
||
tooltip.hide();
|
||
button.removeAttribute("data-bs-title");
|
||
button.removeAttribute("data-bs-toggle");
|
||
button.removeAttribute("data-bs-placement");
|
||
}
|
||
button.setAttribute("title", currentTitle);
|
||
button.classList.remove('code-copy-button-checked');
|
||
}, 1000);
|
||
// clear code selection
|
||
e.clearSelection();
|
||
}
|
||
const getTextToCopy = function(trigger) {
|
||
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
||
for (const childEl of codeEl.children) {
|
||
if (isCodeAnnotation(childEl)) {
|
||
childEl.remove();
|
||
}
|
||
}
|
||
return codeEl.innerText;
|
||
}
|
||
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
|
||
text: getTextToCopy
|
||
});
|
||
clipboard.on('success', onCopySuccess);
|
||
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
|
||
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
|
||
text: getTextToCopy,
|
||
container: window.document.getElementById('quarto-embedded-source-code-modal')
|
||
});
|
||
clipboardModal.on('success', onCopySuccess);
|
||
}
|
||
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
|
||
var mailtoRegex = new RegExp(/^mailto:/);
|
||
var filterRegex = new RegExp('/' + window.location.host + '/');
|
||
var isInternal = (href) => {
|
||
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
|
||
}
|
||
// Inspect non-navigation links and adorn them if external
|
||
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
|
||
for (var i=0; i<links.length; i++) {
|
||
const link = links[i];
|
||
if (!isInternal(link.href)) {
|
||
// undo the damage that might have been done by quarto-nav.js in the case of
|
||
// links that we want to consider external
|
||
if (link.dataset.originalHref !== undefined) {
|
||
link.href = link.dataset.originalHref;
|
||
}
|
||
}
|
||
}
|
||
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
|
||
const config = {
|
||
allowHTML: true,
|
||
maxWidth: 500,
|
||
delay: 100,
|
||
arrow: false,
|
||
appendTo: function(el) {
|
||
return el.parentElement;
|
||
},
|
||
interactive: true,
|
||
interactiveBorder: 10,
|
||
theme: 'quarto',
|
||
placement: 'bottom-start',
|
||
};
|
||
if (contentFn) {
|
||
config.content = contentFn;
|
||
}
|
||
if (onTriggerFn) {
|
||
config.onTrigger = onTriggerFn;
|
||
}
|
||
if (onUntriggerFn) {
|
||
config.onUntrigger = onUntriggerFn;
|
||
}
|
||
window.tippy(el, config);
|
||
}
|
||
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
||
for (var i=0; i<noterefs.length; i++) {
|
||
const ref = noterefs[i];
|
||
tippyHover(ref, function() {
|
||
// use id or data attribute instead here
|
||
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
||
try { href = new URL(href).hash; } catch {}
|
||
const id = href.replace(/^#\/?/, "");
|
||
const note = window.document.getElementById(id);
|
||
if (note) {
|
||
return note.innerHTML;
|
||
} else {
|
||
return "";
|
||
}
|
||
});
|
||
}
|
||
const xrefs = window.document.querySelectorAll('a.quarto-xref');
|
||
const processXRef = (id, note) => {
|
||
// Strip column container classes
|
||
const stripColumnClz = (el) => {
|
||
el.classList.remove("page-full", "page-columns");
|
||
if (el.children) {
|
||
for (const child of el.children) {
|
||
stripColumnClz(child);
|
||
}
|
||
}
|
||
}
|
||
stripColumnClz(note)
|
||
if (id === null || id.startsWith('sec-')) {
|
||
// Special case sections, only their first couple elements
|
||
const container = document.createElement("div");
|
||
if (note.children && note.children.length > 2) {
|
||
container.appendChild(note.children[0].cloneNode(true));
|
||
for (let i = 1; i < note.children.length; i++) {
|
||
const child = note.children[i];
|
||
if (child.tagName === "P" && child.innerText === "") {
|
||
continue;
|
||
} else {
|
||
container.appendChild(child.cloneNode(true));
|
||
break;
|
||
}
|
||
}
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(container);
|
||
}
|
||
return container.innerHTML
|
||
} else {
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(note);
|
||
}
|
||
return note.innerHTML;
|
||
}
|
||
} else {
|
||
// Remove any anchor links if they are present
|
||
const anchorLink = note.querySelector('a.anchorjs-link');
|
||
if (anchorLink) {
|
||
anchorLink.remove();
|
||
}
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(note);
|
||
}
|
||
if (note.classList.contains("callout")) {
|
||
return note.outerHTML;
|
||
} else {
|
||
return note.innerHTML;
|
||
}
|
||
}
|
||
}
|
||
for (var i=0; i<xrefs.length; i++) {
|
||
const xref = xrefs[i];
|
||
tippyHover(xref, undefined, function(instance) {
|
||
instance.disable();
|
||
let url = xref.getAttribute('href');
|
||
let hash = undefined;
|
||
if (url.startsWith('#')) {
|
||
hash = url;
|
||
} else {
|
||
try { hash = new URL(url).hash; } catch {}
|
||
}
|
||
if (hash) {
|
||
const id = hash.replace(/^#\/?/, "");
|
||
const note = window.document.getElementById(id);
|
||
if (note !== null) {
|
||
try {
|
||
const html = processXRef(id, note.cloneNode(true));
|
||
instance.setContent(html);
|
||
} finally {
|
||
instance.enable();
|
||
instance.show();
|
||
}
|
||
} else {
|
||
// See if we can fetch this
|
||
fetch(url.split('#')[0])
|
||
.then(res => res.text())
|
||
.then(html => {
|
||
const parser = new DOMParser();
|
||
const htmlDoc = parser.parseFromString(html, "text/html");
|
||
const note = htmlDoc.getElementById(id);
|
||
if (note !== null) {
|
||
const html = processXRef(id, note);
|
||
instance.setContent(html);
|
||
}
|
||
}).finally(() => {
|
||
instance.enable();
|
||
instance.show();
|
||
});
|
||
}
|
||
} else {
|
||
// See if we can fetch a full url (with no hash to target)
|
||
// This is a special case and we should probably do some content thinning / targeting
|
||
fetch(url)
|
||
.then(res => res.text())
|
||
.then(html => {
|
||
const parser = new DOMParser();
|
||
const htmlDoc = parser.parseFromString(html, "text/html");
|
||
const note = htmlDoc.querySelector('main.content');
|
||
if (note !== null) {
|
||
// This should only happen for chapter cross references
|
||
// (since there is no id in the URL)
|
||
// remove the first header
|
||
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
|
||
note.children[0].remove();
|
||
}
|
||
const html = processXRef(null, note);
|
||
instance.setContent(html);
|
||
}
|
||
}).finally(() => {
|
||
instance.enable();
|
||
instance.show();
|
||
});
|
||
}
|
||
}, function(instance) {
|
||
});
|
||
}
|
||
let selectedAnnoteEl;
|
||
const selectorForAnnotation = ( cell, annotation) => {
|
||
let cellAttr = 'data-code-cell="' + cell + '"';
|
||
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
||
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
||
return selector;
|
||
}
|
||
const selectCodeLines = (annoteEl) => {
|
||
const doc = window.document;
|
||
const targetCell = annoteEl.getAttribute("data-target-cell");
|
||
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
||
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
||
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
||
const lineIds = lines.map((line) => {
|
||
return targetCell + "-" + line;
|
||
})
|
||
let top = null;
|
||
let height = null;
|
||
let parent = null;
|
||
if (lineIds.length > 0) {
|
||
//compute the position of the single el (top and bottom and make a div)
|
||
const el = window.document.getElementById(lineIds[0]);
|
||
top = el.offsetTop;
|
||
height = el.offsetHeight;
|
||
parent = el.parentElement.parentElement;
|
||
if (lineIds.length > 1) {
|
||
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
||
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
||
height = bottom - top;
|
||
}
|
||
if (top !== null && height !== null && parent !== null) {
|
||
// cook up a div (if necessary) and position it
|
||
let div = window.document.getElementById("code-annotation-line-highlight");
|
||
if (div === null) {
|
||
div = window.document.createElement("div");
|
||
div.setAttribute("id", "code-annotation-line-highlight");
|
||
div.style.position = 'absolute';
|
||
parent.appendChild(div);
|
||
}
|
||
div.style.top = top - 2 + "px";
|
||
div.style.height = height + 4 + "px";
|
||
div.style.left = 0;
|
||
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
||
if (gutterDiv === null) {
|
||
gutterDiv = window.document.createElement("div");
|
||
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
||
gutterDiv.style.position = 'absolute';
|
||
const codeCell = window.document.getElementById(targetCell);
|
||
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
||
gutter.appendChild(gutterDiv);
|
||
}
|
||
gutterDiv.style.top = top - 2 + "px";
|
||
gutterDiv.style.height = height + 4 + "px";
|
||
}
|
||
selectedAnnoteEl = annoteEl;
|
||
}
|
||
};
|
||
const unselectCodeLines = () => {
|
||
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
||
elementsIds.forEach((elId) => {
|
||
const div = window.document.getElementById(elId);
|
||
if (div) {
|
||
div.remove();
|
||
}
|
||
});
|
||
selectedAnnoteEl = undefined;
|
||
};
|
||
// Handle positioning of the toggle
|
||
window.addEventListener(
|
||
"resize",
|
||
throttle(() => {
|
||
elRect = undefined;
|
||
if (selectedAnnoteEl) {
|
||
selectCodeLines(selectedAnnoteEl);
|
||
}
|
||
}, 10)
|
||
);
|
||
function throttle(fn, ms) {
|
||
let throttle = false;
|
||
let timer;
|
||
return (...args) => {
|
||
if(!throttle) { // first call gets through
|
||
fn.apply(this, args);
|
||
throttle = true;
|
||
} else { // all the others get throttled
|
||
if(timer) clearTimeout(timer); // cancel #2
|
||
timer = setTimeout(() => {
|
||
fn.apply(this, args);
|
||
timer = throttle = false;
|
||
}, ms);
|
||
}
|
||
};
|
||
}
|
||
// Attach click handler to the DT
|
||
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
||
for (const annoteDlNode of annoteDls) {
|
||
annoteDlNode.addEventListener('click', (event) => {
|
||
const clickedEl = event.target;
|
||
if (clickedEl !== selectedAnnoteEl) {
|
||
unselectCodeLines();
|
||
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
||
if (activeEl) {
|
||
activeEl.classList.remove('code-annotation-active');
|
||
}
|
||
selectCodeLines(clickedEl);
|
||
clickedEl.classList.add('code-annotation-active');
|
||
} else {
|
||
// Unselect the line
|
||
unselectCodeLines();
|
||
clickedEl.classList.remove('code-annotation-active');
|
||
}
|
||
});
|
||
}
|
||
const findCites = (el) => {
|
||
const parentEl = el.parentElement;
|
||
if (parentEl) {
|
||
const cites = parentEl.dataset.cites;
|
||
if (cites) {
|
||
return {
|
||
el,
|
||
cites: cites.split(' ')
|
||
};
|
||
} else {
|
||
return findCites(el.parentElement)
|
||
}
|
||
} else {
|
||
return undefined;
|
||
}
|
||
};
|
||
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
||
for (var i=0; i<bibliorefs.length; i++) {
|
||
const ref = bibliorefs[i];
|
||
const citeInfo = findCites(ref);
|
||
if (citeInfo) {
|
||
tippyHover(citeInfo.el, function() {
|
||
var popup = window.document.createElement('div');
|
||
citeInfo.cites.forEach(function(cite) {
|
||
var citeDiv = window.document.createElement('div');
|
||
citeDiv.classList.add('hanging-indent');
|
||
citeDiv.classList.add('csl-entry');
|
||
var biblioDiv = window.document.getElementById('ref-' + cite);
|
||
if (biblioDiv) {
|
||
citeDiv.innerHTML = biblioDiv.innerHTML;
|
||
}
|
||
popup.appendChild(citeDiv);
|
||
});
|
||
return popup.innerHTML;
|
||
});
|
||
}
|
||
}
|
||
});
|
||
</script>
|
||
</div> <!-- /content -->
|
||
|
||
|
||
|
||
|
||
</body></html> |