@@ -194,10 +194,11 @@ <h1>Installation</h1>
194194<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>devtools<span class="sc">::</span><span class="fu">install_github</span>(<span class="st">"istallworthy/devMSMs"</span>, <span class="at">quiet =</span> <span class="cn">TRUE</span>)</span>
195195<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Warning: `install_github()` was deprecated in devtools 2.5.0.</span></span>
196196<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> ℹ Please use pak::pak("user/repo") instead.</span></span>
197- <span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(devMSMs)</span>
198- <span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a></span>
199- <span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>devtools<span class="sc">::</span><span class="fu">install_github</span>(<span class="st">"istallworthy/devMSMsHelpers"</span>, <span class="at">quiet =</span> <span class="cn">TRUE</span>)</span>
200- <span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(devMSMsHelpers)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
197+ <span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> Installing 31 packages: rappdirs, cli, highr, rlang, base64enc, yaml, xfun, tinytex, knitr, bslib, ps, zoo, viridisLite, cpp11, vctrs, isoband, ggplot2, insight, backports, rstudioapi, rmarkdown, processx, later, cobalt, tables, performance, data.table, checkmate, WeightIt, modelsummary, marginaleffects</span></span>
198+ <span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(devMSMs)</span>
199+ <span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a></span>
200+ <span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a>devtools<span class="sc">::</span><span class="fu">install_github</span>(<span class="st">"istallworthy/devMSMsHelpers"</span>, <span class="at">quiet =</span> <span class="cn">TRUE</span>)</span>
201+ <span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(devMSMsHelpers)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
201202</div>
202203<p>All <em>devMSMs</em> functions have an option to save out objects as ‘.rds’ files. Users can also save out content from print, summary, and plot methods, as illustrated in the sections below. To save, users must supply a path to a home directory (<code>home_dir</code>) when creating their initial MSM object. Users can save to the home directory using the default file labels (and .txt file type) using <code>save.out</code> = TRUE. When saving tables, users have the option to supply their own name and file type (e.g., <code>save.out</code> = “custom_name.png”). Allowable file types are: .png, .html, .pdf, .tex, and .md. All sub-folders referenced by each function are created automatically within the home directory. We recommend saving outputs for future use and provide commented out examples here. When an output is saved out, the function automatically provides a path file to aid the user in reading in that output in the future.</p>
203204<p>Some functions output tables. These are all from the <em>tinytables</em> package and can be further customized (e.g., dimensions, footnotes, captions, combined, etc.) according to the options provided by the package (https://vincentarelbundock.github.io/tinytable/vignettes/tinytable.html).</p>
@@ -1179,31 +1180,31 @@ <h4 class="anchored" data-anchor-id="bart">Bart</h4>
11791180<span id="cb35-9"><a href="#cb35-9" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(weights.bart, </span>
11801181<span id="cb35-10"><a href="#cb35-10" aria-hidden="true" tabindex="-1"></a> <span class="at">i =</span> <span class="dv">1</span>)</span>
11811182<span id="cb35-11"><a href="#cb35-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
1182- <span id="cb35-12"><a href="#cb35-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> For imputation 1 and the `bart` weighting method, the median weight value is 1.24 (SD = 17.54 ; range = 0-585 ).</span></span>
1183+ <span id="cb35-12"><a href="#cb35-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> For imputation 1 and the `bart` weighting method, the median weight value is 1.23 (SD = 15.2 ; range = 0-497 ).</span></span>
11831184<span id="cb35-13"><a href="#cb35-13" aria-hidden="true" tabindex="-1"></a></span>
11841185<span id="cb35-14"><a href="#cb35-14" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(weights.bart[[<span class="dv">1</span>]])[[<span class="dv">1</span>]]</span>
11851186<span id="cb35-15"><a href="#cb35-15" aria-hidden="true" tabindex="-1"></a><span class="co">#> Summary of weights</span></span>
11861187<span id="cb35-16"><a href="#cb35-16" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
11871188<span id="cb35-17"><a href="#cb35-17" aria-hidden="true" tabindex="-1"></a><span class="co">#> - Weight ranges:</span></span>
11881189<span id="cb35-18"><a href="#cb35-18" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
11891190<span id="cb35-19"><a href="#cb35-19" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min Max</span></span>
1190- <span id="cb35-20"><a href="#cb35-20" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 0 |---------------------------| 584.889 </span></span>
1191+ <span id="cb35-20"><a href="#cb35-20" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 0 |---------------------------| 496.897 </span></span>
11911192<span id="cb35-21"><a href="#cb35-21" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
11921193<span id="cb35-22"><a href="#cb35-22" aria-hidden="true" tabindex="-1"></a><span class="co">#> - Units with the 5 most extreme weights:</span></span>
1193- <span id="cb35-23"><a href="#cb35-23" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
1194- <span id="cb35-24"><a href="#cb35-24" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1235 1145 591 475 30</span></span>
1195- <span id="cb35-25"><a href="#cb35-25" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 57.533 70.715 92.712 161.6 584.889 </span></span>
1194+ <span id="cb35-23"><a href="#cb35-23" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
1195+ <span id="cb35-24"><a href="#cb35-24" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1235 1145 591 475 30</span></span>
1196+ <span id="cb35-25"><a href="#cb35-25" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 61.911 75.362 97.366 139.281 496.897 </span></span>
11961197<span id="cb35-26"><a href="#cb35-26" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
11971198<span id="cb35-27"><a href="#cb35-27" aria-hidden="true" tabindex="-1"></a><span class="co">#> - Weight statistics:</span></span>
11981199<span id="cb35-28"><a href="#cb35-28" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
1199- <span id="cb35-29"><a href="#cb35-29" aria-hidden="true" tabindex="-1"></a><span class="co">#> Coef of Var MAD Entropy # Zeros</span></span>
1200- <span id="cb35-30"><a href="#cb35-30" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 6.189 1.02 1.506 0</span></span>
1200+ <span id="cb35-29"><a href="#cb35-29" aria-hidden="true" tabindex="-1"></a><span class="co">#> Coef of Var MAD Entropy # Zeros</span></span>
1201+ <span id="cb35-30"><a href="#cb35-30" aria-hidden="true" tabindex="-1"></a><span class="co">#> all 5.514 1.003 1.407 0</span></span>
12011202<span id="cb35-31"><a href="#cb35-31" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
12021203<span id="cb35-32"><a href="#cb35-32" aria-hidden="true" tabindex="-1"></a><span class="co">#> - Effective Sample Sizes:</span></span>
12031204<span id="cb35-33"><a href="#cb35-33" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
1204- <span id="cb35-34"><a href="#cb35-34" aria-hidden="true" tabindex="-1"></a><span class="co">#> Total</span></span>
1205- <span id="cb35-35"><a href="#cb35-35" aria-hidden="true" tabindex="-1"></a><span class="co">#> Unweighted 1292. </span></span>
1206- <span id="cb35-36"><a href="#cb35-36" aria-hidden="true" tabindex="-1"></a><span class="co">#> Weighted 32.9 </span></span>
1205+ <span id="cb35-34"><a href="#cb35-34" aria-hidden="true" tabindex="-1"></a><span class="co">#> Total</span></span>
1206+ <span id="cb35-35"><a href="#cb35-35" aria-hidden="true" tabindex="-1"></a><span class="co">#> Unweighted 1292. </span></span>
1207+ <span id="cb35-36"><a href="#cb35-36" aria-hidden="true" tabindex="-1"></a><span class="co">#> Weighted 41.17 </span></span>
12071208<span id="cb35-37"><a href="#cb35-37" aria-hidden="true" tabindex="-1"></a></span>
12081209<span id="cb35-38"><a href="#cb35-38" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(weights.bart, </span>
12091210<span id="cb35-39"><a href="#cb35-39" aria-hidden="true" tabindex="-1"></a> <span class="at">i =</span> <span class="dv">1</span>, </span>
@@ -1812,19 +1813,19 @@ <h4 class="anchored" data-anchor-id="super-1">Super</h4>
18121813<span id="cb46-57"><a href="#cb46-57" aria-hidden="true" tabindex="-1"></a></span>
18131814<span id="cb46-58"><a href="#cb46-58" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(balance_stats.bart, </span>
18141815<span id="cb46-59"><a href="#cb46-59" aria-hidden="true" tabindex="-1"></a> <span class="at">save.out =</span> save.out)</span>
1815- <span id="cb46-60"><a href="#cb46-60" aria-hidden="true" tabindex="-1"></a><span class="co">#> USER </span><span class="al">ALERT</span><span class="co">: Averaging across imputed datasets using `bart` weighting method: As shown below, 27 out of 241 (11.2 %) covariates across time points remain imbalanced with a remaining median absolute correlation of 0.14 (max: 0.23 ):</span></span>
1816+ <span id="cb46-60"><a href="#cb46-60" aria-hidden="true" tabindex="-1"></a><span class="co">#> USER </span><span class="al">ALERT</span><span class="co">: Averaging across imputed datasets using `bart` weighting method: As shown below, 29 out of 241 (12.0 %) covariates across time points remain imbalanced with a remaining median absolute correlation of 0.11 (max: 0.21 ):</span></span>
18161817<span id="cb46-61"><a href="#cb46-61" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
18171818<span id="cb46-62"><a href="#cb46-62" aria-hidden="true" tabindex="-1"></a><span class="co">#> | Exposure | Total # of covariates | # of imbalanced covariates |</span></span>
18181819<span id="cb46-63"><a href="#cb46-63" aria-hidden="true" tabindex="-1"></a><span class="co">#> +===========+=======================+============================+</span></span>
1819- <span id="cb46-64"><a href="#cb46-64" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.6 | 28 | 6 |</span></span>
1820+ <span id="cb46-64"><a href="#cb46-64" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.6 | 28 | 5 |</span></span>
18201821<span id="cb46-65"><a href="#cb46-65" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
1821- <span id="cb46-66"><a href="#cb46-66" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.15 | 38 | 11 |</span></span>
1822+ <span id="cb46-66"><a href="#cb46-66" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.15 | 38 | 13 |</span></span>
18221823<span id="cb46-67"><a href="#cb46-67" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
1823- <span id="cb46-68"><a href="#cb46-68" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.24 | 47 | 7 |</span></span>
1824+ <span id="cb46-68"><a href="#cb46-68" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.24 | 47 | 6 |</span></span>
18241825<span id="cb46-69"><a href="#cb46-69" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
18251826<span id="cb46-70"><a href="#cb46-70" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.35 | 59 | 3 |</span></span>
18261827<span id="cb46-71"><a href="#cb46-71" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
1827- <span id="cb46-72"><a href="#cb46-72" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.58 | 69 | 0 |</span></span>
1828+ <span id="cb46-72"><a href="#cb46-72" aria-hidden="true" tabindex="-1"></a><span class="co">#> | ESETA1.58 | 69 | 2 |</span></span>
18281829<span id="cb46-73"><a href="#cb46-73" aria-hidden="true" tabindex="-1"></a><span class="co">#> +-----------+-----------------------+----------------------------+</span></span>
18291830<span id="cb46-74"><a href="#cb46-74" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
18301831<span id="cb46-75"><a href="#cb46-75" aria-hidden="true" tabindex="-1"></a><span class="co">#> Table: Imbalanced Covariates Averaging Across Imputed Datasets using `bart`</span></span>
@@ -1869,7 +1870,7 @@ <h4 class="anchored" data-anchor-id="super-1">Super</h4>
18691870<span id="cb47-16"><a href="#cb47-16" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(weights.bart[[<span class="dv">1</span>]])[[<span class="dv">1</span>]][<span class="dv">6</span>]</span>
18701871<span id="cb47-17"><a href="#cb47-17" aria-hidden="true" tabindex="-1"></a><span class="co">#> $negative.entropy</span></span>
18711872<span id="cb47-18"><a href="#cb47-18" aria-hidden="true" tabindex="-1"></a><span class="co">#> all </span></span>
1872- <span id="cb47-19"><a href="#cb47-19" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1.506331 </span></span>
1873+ <span id="cb47-19"><a href="#cb47-19" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1.407004 </span></span>
18731874<span id="cb47-20"><a href="#cb47-20" aria-hidden="true" tabindex="-1"></a></span>
18741875<span id="cb47-21"><a href="#cb47-21" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(weights.super[[<span class="dv">1</span>]])[[<span class="dv">1</span>]][<span class="dv">6</span>]</span>
18751876<span id="cb47-22"><a href="#cb47-22" aria-hidden="true" tabindex="-1"></a><span class="co">#> $negative.entropy</span></span>
0 commit comments