stRoke/articles/toolbox.html

802 lines
57 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="stRoke">
<title>Toolbox • stRoke</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
<script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Toolbox">
<meta property="og:description" content="stRoke">
<meta property="og:image" content="https://agdamsbo.github.io/stRoke/logo.png">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
<nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
<a class="navbar-brand me-2" href="../index.html">stRoke</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">24.2.1</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse ms-3">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="../reference/index.html">Reference</a>
</li>
<li class="active nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown-articles">Articles</a>
<div class="dropdown-menu" aria-labelledby="dropdown-articles">
<a class="dropdown-item" href="../articles/toolbox.html">Toolbox</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="../news/index.html">Changelog</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" role="search">
<input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off">
</form>
<ul class="navbar-nav">
<li class="nav-item">
<a class="external-link nav-link" href="https://github.com/agdamsbo/stRoke/" aria-label="github">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
</div>
</nav><div class="container template-article">
<div class="row">
<main id="main" class="col-md-9"><div class="page-header">
<img src="../logo.png" class="logo" alt=""><h1>Toolbox</h1>
<h4 data-toc-skip class="date">2024-02-09</h4>
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/stRoke/blob/HEAD/vignettes/toolbox.Rmd" class="external-link"><code>vignettes/toolbox.Rmd</code></a></small>
<div class="d-none name"><code>toolbox.Rmd</code></div>
</div>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://agdamsbo.github.io/stRoke/">stRoke</a></span><span class="op">)</span></span></code></pre></div>
<div class="section level2">
<h2 id="a-toolbox">A toolbox<a class="anchor" aria-label="anchor" href="#a-toolbox"></a>
</h2>
<p>My own toolbox in my small workshop is a mix of some old, worn, well
proven tools and some newcomers. This package should be seen as
something like that.</p>
<p>I have tried to collect tools and functions from other packages that
I use regularly in addition to functions that I have written myself to
fill use cases, that I have not been able to find solutions to
elsewhere.</p>
<p>In documenting and testing the package, I have used <a href="https://platform.openai.com/overview" class="external-link">OpenAIs</a> chatgpt with <a href="https://jameshwade.github.io/gpttools/" class="external-link">gpttools</a>. The chatgpt
is an interesting tool, that is in no way perfect, but it helps with
tedious tasks. Both <code>gpttools</code> and <a href="https://michelnivard.github.io/gptstudio/" class="external-link"><code>gptstudio</code></a>
are interesting implementations in R and RStudio.</p>
<div class="section level3">
<h3 id="cpr-intro">CPR manipulations<a class="anchor" aria-label="anchor" href="#cpr-intro"></a>
</h3>
<p>Note that, if handled, CPR numbers (social security numbers) should
be handled with care as they a considered highly sensitive data.</p>
<p>The CPR number is structured as <em>DDMMYY-XXXX</em>, with the 1st
<em>X</em> designating decade of birth, the last <em>X</em> designate
binary gender (not biological sex) dependent on even/uneven as
female/male, and the last for digits are used in a modulus calculation
to verify the validity of the CPR number. Foreigners and unidentified
persons are given temporary CPR numbers including letters.</p>
<p>More information can be found on <a href="https://cpr.dk" class="external-link">cpr.dk</a>.</p>
<p>Note, that all CPR numbers used in examples are publicly known or
non-organic.</p>
<div class="section level4">
<h4 id="age_calc">age_calc()<a class="anchor" aria-label="anchor" href="#age_calc"></a>
</h4>
<p>The age_calc() function was created as a learning exercise and
functions similarly to <code><a href="https://lubridate.tidyverse.org/reference/time_length.html" class="external-link">lubridate::time_length()</a></code>.</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">age</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/age_calc.html">age_calc</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/as.Date.html" class="external-link">as.Date</a></span><span class="op">(</span><span class="st">"1945-10-23"</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/as.Date.html" class="external-link">as.Date</a></span><span class="op">(</span><span class="st">"2018-09-30"</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co">#&gt; [1] 72.93699</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">trunc</a></span><span class="op">(</span><span class="va">age</span><span class="op">)</span></span>
<span><span class="co">#&gt; [1] 72</span></span></code></pre></div>
</div>
<div class="section level4">
<h4 id="cpr_check">cpr_check()<a class="anchor" aria-label="anchor" href="#cpr_check"></a>
</h4>
<p>Checks validity of CPR numbers according to the <a href="https://cpr.dk/cpr-systemet/opbygning-af-cpr-nummeret" class="external-link">modulus 11
rule</a>. Note that due to limitations in the possible available CPR
numbers, this rule <a href="https://cpr.dk/cpr-systemet/personnumre-uden-kontrolciffer-modulus-11-kontrol" class="external-link">does
not apply to all CPR numbers after 2007</a>.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/cpr_check.html">cpr_check</a></span><span class="op">(</span></span>
<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span></span>
<span> <span class="st">"2310450637"</span>,</span>
<span> <span class="st">"010190-2000"</span>,</span>
<span> <span class="st">"010115-4000"</span>,</span>
<span> <span class="st">"300450-1030"</span>,</span>
<span> <span class="st">"010150-4021"</span>,</span>
<span> <span class="st">"010150-4AA1"</span></span>
<span> <span class="op">)</span></span>
<span><span class="op">)</span></span>
<span><span class="co">#&gt; OBS: as per 2007 not all valid CPR numbers apply to modulus 11 rule.</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; See the vignette 'Toolbox'</span></span>
<span><span class="co">#&gt; Warning in matrix(as.numeric(unlist(strsplit(cpr_short, ""))), nrow = 10): NAs</span></span>
<span><span class="co">#&gt; introduced by coercion</span></span>
<span><span class="co">#&gt; [1] TRUE FALSE FALSE FALSE FALSE NA</span></span></code></pre></div>
<p>Including CPR numbers with letters gives a warning and
<code>NA</code>, as it can not be checked by the modulus 11 function.
Should be used with care, see the message.</p>
</div>
<div class="section level4">
<h4 id="cpr_dob">cpr_dob()<a class="anchor" aria-label="anchor" href="#cpr_dob"></a>
</h4>
<p>Extracts date of birth (DOB) from a CPR number. Accounts for the
decade of birth. <a href="#cpr-intro">See earlier</a>.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/cpr_dob.html">cpr_dob</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span></span>
<span> <span class="st">"2310450637"</span>,</span>
<span> <span class="st">"010190-2000"</span>,</span>
<span> <span class="st">"010115-4000"</span>,</span>
<span> <span class="st">"300450-1030"</span>,</span>
<span> <span class="st">"010150-4021"</span></span>
<span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co">#&gt; [1] "23-10-1945" "01-01-1990" "01-01-2015" "30-04-1950" "01-01-1950"</span></span></code></pre></div>
</div>
<div class="section level4">
<h4 id="cpr_female">cpr_female()<a class="anchor" aria-label="anchor" href="#cpr_female"></a>
</h4>
<p>Gives logical vector of whether female gender from last digit of
CPR.</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/table.html" class="external-link">table</a></span><span class="op">(</span><span class="fu"><a href="../reference/cpr_female.html">cpr_female</a></span><span class="op">(</span><span class="fu">stRoke</span><span class="fu">::</span><span class="va"><a href="../reference/cprs.html">cprs</a></span><span class="op">[</span>, <span class="fl">1</span><span class="op">]</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; FALSE TRUE </span></span>
<span><span class="co">#&gt; 98 102</span></span></code></pre></div>
</div>
</div>
<div class="section level3">
<h3 id="plotting">Plotting<a class="anchor" aria-label="anchor" href="#plotting"></a>
</h3>
<div class="section level4">
<h4 id="ci_plot">ci_plot()<a class="anchor" aria-label="anchor" href="#ci_plot"></a>
</h4>
<p>Plots odds ratios with 95 % confidence intervals. Performs binary
logistic regression for outcome factors with two (2) levels and ordinal
logistic regression for outcome factors with more than two levels. Mind
relevant assumptions.</p>
<p>Outputs ggplot element for further manipulation.</p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">talos</span><span class="op">)</span></span>
<span><span class="va">talos</span><span class="op">[</span>, <span class="st">"mrs_1"</span><span class="op">]</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html" class="external-link">factor</a></span><span class="op">(</span><span class="va">talos</span><span class="op">[</span>, <span class="st">"mrs_1"</span><span class="op">]</span>, ordered <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="fu"><a href="../reference/ci_plot.html">ci_plot</a></span><span class="op">(</span></span>
<span> ds <span class="op">=</span> <span class="va">talos</span>,</span>
<span> x <span class="op">=</span> <span class="st">"rtreat"</span>,</span>
<span> y <span class="op">=</span> <span class="st">"mrs_1"</span>,</span>
<span> vars <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"hypertension"</span>, <span class="st">"diabetes"</span><span class="op">)</span></span>
<span><span class="op">)</span></span>
<span><span class="co">#&gt; Waiting for profiling to be done...</span></span></code></pre></div>
<p><img src="toolbox_files/figure-html/ci_plot-example-1.png" width="700"></p>
</div>
<div class="section level4">
<h4 id="generic_stroke">generic_stroke()<a class="anchor" aria-label="anchor" href="#generic_stroke"></a>
</h4>
<p>For learning purposes. Uses annonymized data from the <a href="https://doi.org/10.1161/STROKEAHA.117.020067" class="external-link">TALOS trial</a> to
output a Table 1 (with <code><a href="https://www.danieldsjoberg.com/gtsummary/reference/tbl_summary.html" class="external-link">gtsummary::tbl_summary()</a></code>), plotting
the so-called grotta-bars based on mRS scores (with
<code><a href="https://rdrr.io/pkg/rankinPlot/man/grottaBar.html" class="external-link">rankinPlot::grottaBar()</a></code>) and a ordinal logistic regression
model plot (with <code><a href="../reference/ci_plot.html">stRoke::ci_plot()</a></code>).</p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/generic_stroke.html">generic_stroke</a></span><span class="op">(</span><span class="fu">stRoke</span><span class="fu">::</span><span class="va"><a href="../reference/talos.html">talos</a></span>,</span>
<span> <span class="st">"rtreat"</span>,</span>
<span> <span class="st">"mrs_6"</span>,</span>
<span> variables <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"hypertension"</span>, <span class="st">"diabetes"</span>, <span class="st">"civil"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co">#&gt; Waiting for profiling to be done...</span></span>
<span><span class="co">#&gt; $`Table 1`</span></span>
<span><span class="co">#&gt; &lt;div id="lypbdxnugv" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;"&gt;</span></span>
<span><span class="co">#&gt; &lt;style&gt;#lypbdxnugv table {</span></span>
<span><span class="co">#&gt; font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';</span></span>
<span><span class="co">#&gt; -webkit-font-smoothing: antialiased;</span></span>
<span><span class="co">#&gt; -moz-osx-font-smoothing: grayscale;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv thead, #lypbdxnugv tbody, #lypbdxnugv tfoot, #lypbdxnugv tr, #lypbdxnugv td, #lypbdxnugv th {</span></span>
<span><span class="co">#&gt; border-style: none;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv p {</span></span>
<span><span class="co">#&gt; margin: 0;</span></span>
<span><span class="co">#&gt; padding: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_table {</span></span>
<span><span class="co">#&gt; display: table;</span></span>
<span><span class="co">#&gt; border-collapse: collapse;</span></span>
<span><span class="co">#&gt; line-height: normal;</span></span>
<span><span class="co">#&gt; margin-left: auto;</span></span>
<span><span class="co">#&gt; margin-right: auto;</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; font-size: 16px;</span></span>
<span><span class="co">#&gt; font-weight: normal;</span></span>
<span><span class="co">#&gt; font-style: normal;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; width: auto;</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; border-top-color: #A8A8A8;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 2px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #A8A8A8;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 2px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_caption {</span></span>
<span><span class="co">#&gt; padding-top: 4px;</span></span>
<span><span class="co">#&gt; padding-bottom: 4px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_title {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; font-size: 125%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; padding-top: 4px;</span></span>
<span><span class="co">#&gt; padding-bottom: 4px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; border-bottom-width: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_subtitle {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; font-size: 85%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; padding-top: 3px;</span></span>
<span><span class="co">#&gt; padding-bottom: 5px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; border-top-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; border-top-width: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_heading {</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; text-align: center;</span></span>
<span><span class="co">#&gt; border-bottom-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 1px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 1px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_bottom_border {</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_col_headings {</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 1px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 1px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_col_heading {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: normal;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 1px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 1px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; vertical-align: bottom;</span></span>
<span><span class="co">#&gt; padding-top: 5px;</span></span>
<span><span class="co">#&gt; padding-bottom: 6px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; overflow-x: hidden;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_column_spanner_outer {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: normal;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; padding-top: 0;</span></span>
<span><span class="co">#&gt; padding-bottom: 0;</span></span>
<span><span class="co">#&gt; padding-left: 4px;</span></span>
<span><span class="co">#&gt; padding-right: 4px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_column_spanner_outer:first-child {</span></span>
<span><span class="co">#&gt; padding-left: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_column_spanner_outer:last-child {</span></span>
<span><span class="co">#&gt; padding-right: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_column_spanner {</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; vertical-align: bottom;</span></span>
<span><span class="co">#&gt; padding-top: 5px;</span></span>
<span><span class="co">#&gt; padding-bottom: 5px;</span></span>
<span><span class="co">#&gt; overflow-x: hidden;</span></span>
<span><span class="co">#&gt; display: inline-block;</span></span>
<span><span class="co">#&gt; width: 100%;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_spanner_row {</span></span>
<span><span class="co">#&gt; border-bottom-style: hidden;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_group_heading {</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 1px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 1px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; vertical-align: middle;</span></span>
<span><span class="co">#&gt; text-align: left;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_empty_group_heading {</span></span>
<span><span class="co">#&gt; padding: 0.5px;</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; vertical-align: middle;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_from_md &gt; :first-child {</span></span>
<span><span class="co">#&gt; margin-top: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_from_md &gt; :last-child {</span></span>
<span><span class="co">#&gt; margin-bottom: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_row {</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; margin: 10px;</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 1px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 1px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 1px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; vertical-align: middle;</span></span>
<span><span class="co">#&gt; overflow-x: hidden;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_stub {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; border-right-style: solid;</span></span>
<span><span class="co">#&gt; border-right-width: 2px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_stub_row_group {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; font-weight: initial;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; border-right-style: solid;</span></span>
<span><span class="co">#&gt; border-right-width: 2px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; vertical-align: top;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_row_group_first td {</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_row_group_first th {</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_summary_row {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_first_summary_row {</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_first_summary_row.thick {</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_last_summary_row {</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_grand_summary_row {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; text-transform: inherit;</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_first_grand_summary_row {</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; border-top-style: double;</span></span>
<span><span class="co">#&gt; border-top-width: 6px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_last_grand_summary_row_top {</span></span>
<span><span class="co">#&gt; padding-top: 8px;</span></span>
<span><span class="co">#&gt; padding-bottom: 8px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; border-bottom-style: double;</span></span>
<span><span class="co">#&gt; border-bottom-width: 6px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_striped {</span></span>
<span><span class="co">#&gt; background-color: rgba(128, 128, 128, 0.05);</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_table_body {</span></span>
<span><span class="co">#&gt; border-top-style: solid;</span></span>
<span><span class="co">#&gt; border-top-width: 2px;</span></span>
<span><span class="co">#&gt; border-top-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-bottom-style: solid;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_footnotes {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; border-bottom-style: none;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 2px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 2px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_footnote {</span></span>
<span><span class="co">#&gt; margin: 0px;</span></span>
<span><span class="co">#&gt; font-size: 90%;</span></span>
<span><span class="co">#&gt; padding-top: 4px;</span></span>
<span><span class="co">#&gt; padding-bottom: 4px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_sourcenotes {</span></span>
<span><span class="co">#&gt; color: #333333;</span></span>
<span><span class="co">#&gt; background-color: #FFFFFF;</span></span>
<span><span class="co">#&gt; border-bottom-style: none;</span></span>
<span><span class="co">#&gt; border-bottom-width: 2px;</span></span>
<span><span class="co">#&gt; border-bottom-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-left-style: none;</span></span>
<span><span class="co">#&gt; border-left-width: 2px;</span></span>
<span><span class="co">#&gt; border-left-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; border-right-style: none;</span></span>
<span><span class="co">#&gt; border-right-width: 2px;</span></span>
<span><span class="co">#&gt; border-right-color: #D3D3D3;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_sourcenote {</span></span>
<span><span class="co">#&gt; font-size: 90%;</span></span>
<span><span class="co">#&gt; padding-top: 4px;</span></span>
<span><span class="co">#&gt; padding-bottom: 4px;</span></span>
<span><span class="co">#&gt; padding-left: 5px;</span></span>
<span><span class="co">#&gt; padding-right: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_left {</span></span>
<span><span class="co">#&gt; text-align: left;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_center {</span></span>
<span><span class="co">#&gt; text-align: center;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_right {</span></span>
<span><span class="co">#&gt; text-align: right;</span></span>
<span><span class="co">#&gt; font-variant-numeric: tabular-nums;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_font_normal {</span></span>
<span><span class="co">#&gt; font-weight: normal;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_font_bold {</span></span>
<span><span class="co">#&gt; font-weight: bold;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_font_italic {</span></span>
<span><span class="co">#&gt; font-style: italic;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_super {</span></span>
<span><span class="co">#&gt; font-size: 65%;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_footnote_marks {</span></span>
<span><span class="co">#&gt; font-size: 75%;</span></span>
<span><span class="co">#&gt; vertical-align: 0.4em;</span></span>
<span><span class="co">#&gt; position: initial;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_asterisk {</span></span>
<span><span class="co">#&gt; font-size: 100%;</span></span>
<span><span class="co">#&gt; vertical-align: 0;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_indent_1 {</span></span>
<span><span class="co">#&gt; text-indent: 5px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_indent_2 {</span></span>
<span><span class="co">#&gt; text-indent: 10px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_indent_3 {</span></span>
<span><span class="co">#&gt; text-indent: 15px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_indent_4 {</span></span>
<span><span class="co">#&gt; text-indent: 20px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; #lypbdxnugv .gt_indent_5 {</span></span>
<span><span class="co">#&gt; text-indent: 25px;</span></span>
<span><span class="co">#&gt; }</span></span>
<span><span class="co">#&gt; &lt;/style&gt;</span></span>
<span><span class="co">#&gt; &lt;table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false"&gt;</span></span>
<span><span class="co">#&gt; &lt;thead&gt;</span></span>
<span><span class="co">#&gt; &lt;tr class="gt_col_headings"&gt;</span></span>
<span><span class="co">#&gt; &lt;th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="&amp;lt;strong&amp;gt;Characteristic&amp;lt;/strong&amp;gt;"&gt;&lt;strong&gt;Characteristic&lt;/strong&gt;&lt;/th&gt;</span></span>
<span><span class="co">#&gt; &lt;th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="&amp;lt;strong&amp;gt;Overall&amp;lt;/strong&amp;gt;, N = 200&amp;lt;span class=&amp;quot;gt_footnote_marks&amp;quot; style=&amp;quot;white-space:nowrap;font-style:italic;font-weight:normal;&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&amp;lt;/span&amp;gt;"&gt;&lt;strong&gt;Overall&lt;/strong&gt;, N = 200&lt;span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt;&lt;/th&gt;</span></span>
<span><span class="co">#&gt; &lt;th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="&amp;lt;strong&amp;gt;Active&amp;lt;/strong&amp;gt;, N = 79&amp;lt;span class=&amp;quot;gt_footnote_marks&amp;quot; style=&amp;quot;white-space:nowrap;font-style:italic;font-weight:normal;&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&amp;lt;/span&amp;gt;"&gt;&lt;strong&gt;Active&lt;/strong&gt;, N = 79&lt;span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt;&lt;/th&gt;</span></span>
<span><span class="co">#&gt; &lt;th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="&amp;lt;strong&amp;gt;Placebo&amp;lt;/strong&amp;gt;, N = 121&amp;lt;span class=&amp;quot;gt_footnote_marks&amp;quot; style=&amp;quot;white-space:nowrap;font-style:italic;font-weight:normal;&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&amp;lt;/span&amp;gt;"&gt;&lt;strong&gt;Placebo&lt;/strong&gt;, N = 121&lt;span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt;&lt;/th&gt;</span></span>
<span><span class="co">#&gt; &lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;/thead&gt;</span></span>
<span><span class="co">#&gt; &lt;tbody class="gt_table_body"&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;&lt;td headers="label" class="gt_row gt_left"&gt;hypertension&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_0" class="gt_row gt_center"&gt;101 (51%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_1" class="gt_row gt_center"&gt;38 (48%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_2" class="gt_row gt_center"&gt;63 (52%)&lt;/td&gt;&lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;&lt;td headers="label" class="gt_row gt_left"&gt;diabetes&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_0" class="gt_row gt_center"&gt;23 (12%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_1" class="gt_row gt_center"&gt;9 (11%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_2" class="gt_row gt_center"&gt;14 (12%)&lt;/td&gt;&lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;&lt;td headers="label" class="gt_row gt_left"&gt;civil&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_0" class="gt_row gt_center"&gt;&lt;br /&gt;&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_1" class="gt_row gt_center"&gt;&lt;br /&gt;&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_2" class="gt_row gt_center"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;&lt;td headers="label" class="gt_row gt_left"&gt;    alone&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_0" class="gt_row gt_center"&gt;59 (30%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_1" class="gt_row gt_center"&gt;22 (28%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_2" class="gt_row gt_center"&gt;37 (31%)&lt;/td&gt;&lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;&lt;td headers="label" class="gt_row gt_left"&gt;    partner&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_0" class="gt_row gt_center"&gt;141 (71%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_1" class="gt_row gt_center"&gt;57 (72%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;td headers="stat_2" class="gt_row gt_center"&gt;84 (69%)&lt;/td&gt;&lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;/tbody&gt;</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; &lt;tfoot class="gt_footnotes"&gt;</span></span>
<span><span class="co">#&gt; &lt;tr&gt;</span></span>
<span><span class="co">#&gt; &lt;td class="gt_footnote" colspan="4"&gt;&lt;span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt; n (%)&lt;/td&gt;</span></span>
<span><span class="co">#&gt; &lt;/tr&gt;</span></span>
<span><span class="co">#&gt; &lt;/tfoot&gt;</span></span>
<span><span class="co">#&gt; &lt;/table&gt;</span></span>
<span><span class="co">#&gt; &lt;/div&gt;</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; $`Figure 1`</span></span></code></pre></div>
<p><img src="toolbox_files/figure-html/generic_stroke-example-1.png" width="700"></p>
<pre><code><span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; $`Figure 2`</span></span></code></pre>
<p><img src="toolbox_files/figure-html/generic_stroke-example-2.png" width="700"></p>
</div>
<div class="section level4">
<h4 id="index_plot">index_plot()<a class="anchor" aria-label="anchor" href="#index_plot"></a>
</h4>
<p>Used for plotting scores from a multi dimensional patient test.</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/index_plot.html">index_plot</a></span><span class="op">(</span><span class="fu">stRoke</span><span class="fu">::</span><span class="va"><a href="../reference/score.html">score</a></span><span class="op">[</span><span class="va">score</span><span class="op">$</span><span class="va">event</span> <span class="op">==</span> <span class="st">"A"</span>, <span class="op">]</span><span class="op">)</span></span></code></pre></div>
<p><img src="toolbox_files/figure-html/index_plot-example-1.png" width="700"></p>
</div>
<div class="section level4">
<h4 id="win_prob">win_prob()<a class="anchor" aria-label="anchor" href="#win_prob"></a>
</h4>
<p>The <code><a href="../reference/win_prob.html">win_prob()</a></code> is an implementation of the Tournament
Method for calculating the probability of winning as suggested by <a href="https://doi.org/10.1161/STROKEAHA.121.037744" class="external-link">Zou et al 2022</a>.
The authors has included a spreadsheet as supplementary materials. This
function aims to mimic that functionality. The function also includes a
<code><a href="https://rdrr.io/r/base/print.html" class="external-link">print()</a></code> extension for nice printing.</p>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/win_prob.html">win_prob</a></span><span class="op">(</span></span>
<span> data <span class="op">=</span> <span class="fu">stRoke</span><span class="fu">::</span><span class="va"><a href="../reference/talos.html">talos</a></span>,</span>
<span> response <span class="op">=</span> <span class="st">"mrs_6"</span>,</span>
<span> group <span class="op">=</span> <span class="st">"rtreat"</span>,</span>
<span> sample.size <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span> print.tables <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span>
<span><span class="co">#&gt; Zou et al's winP (doi: 10.1161/STROKEAHA.121.037744) </span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; Probability of a random observation in Placebo group </span></span>
<span><span class="co">#&gt; will have a higher response score than a random</span></span>
<span><span class="co">#&gt; observation in Active group:</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; winP: 0.400 (0.612, 0.372) p=0.0125</span></span>
<span><span class="co">#&gt; --------------------------------------------</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; The numbers needed to treat (NNT) are: -9</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; --------------------------------------------</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; With Active/Placebo ratio = 1 and beta = 0.2</span></span>
<span><span class="co">#&gt; the sample size needed is: 238</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; --------------------------------------------</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; Results for the Active group:</span></span>
<span><span class="co">#&gt; |mrs_6 | Freq| prop| overall_rank| rank| win_frac|</span></span>
<span><span class="co">#&gt; |:-----|----:|-----:|------------:|----:|--------:|</span></span>
<span><span class="co">#&gt; |0 | 14| 0.177| 175.0| 72.5| 0.847|</span></span>
<span><span class="co">#&gt; |1 | 29| 0.367| 113.5| 51.0| 0.517|</span></span>
<span><span class="co">#&gt; |2 | 22| 0.278| 49.0| 25.5| 0.194|</span></span>
<span><span class="co">#&gt; |3 | 9| 0.114| 15.0| 10.0| 0.041|</span></span>
<span><span class="co">#&gt; |4 | 3| 0.038| 7.0| 4.0| 0.025|</span></span>
<span><span class="co">#&gt; |6 | 2| 0.025| 2.5| 1.5| 0.008|</span></span>
<span><span class="co">#&gt; </span></span>
<span><span class="co">#&gt; Results for the Placebo group:</span></span>
<span><span class="co">#&gt; |mrs_6 | Freq| prop| overall_rank| rank| win_frac|</span></span>
<span><span class="co">#&gt; |:-----|----:|-----:|------------:|-----:|--------:|</span></span>
<span><span class="co">#&gt; |0 | 37| 0.306| 175.0| 103.0| 0.911|</span></span>
<span><span class="co">#&gt; |1 | 43| 0.355| 113.5| 63.0| 0.639|</span></span>
<span><span class="co">#&gt; |2 | 35| 0.289| 49.0| 24.0| 0.316|</span></span>
<span><span class="co">#&gt; |3 | 2| 0.017| 15.0| 5.5| 0.120|</span></span>
<span><span class="co">#&gt; |4 | 2| 0.017| 7.0| 3.5| 0.044|</span></span>
<span><span class="co">#&gt; |6 | 2| 0.017| 2.5| 1.5| 0.013|</span></span></code></pre></div>
</div>
</div>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
</nav></aside>
</div>
<footer><div class="pkgdown-footer-left">
<p></p>
<p>Developed by Andreas Gammelgaard Damsbo.</p>
</div>
<div class="pkgdown-footer-right">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>
</footer>
</div>
</body>
</html>