-
Notifications
You must be signed in to change notification settings - Fork 0
/
vignette.html
1202 lines (1167 loc) · 91.2 KB
/
vignette.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Laura B. Balzer ([email protected])" />
<meta name="date" content="2023-05-30" />
<title>Adaptive Prespecification - Vignette</title>
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
</script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
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;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; }
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.at { color: #7d9029; }
code span.bn { color: #40a070; }
code span.bu { color: #008000; }
code span.cf { color: #007020; font-weight: bold; }
code span.ch { color: #4070a0; }
code span.cn { color: #880000; }
code span.co { color: #60a0b0; font-style: italic; }
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.do { color: #ba2121; font-style: italic; }
code span.dt { color: #902000; }
code span.dv { color: #40a070; }
code span.er { color: #ff0000; font-weight: bold; }
code span.ex { }
code span.fl { color: #40a070; }
code span.fu { color: #06287e; }
code span.im { color: #008000; font-weight: bold; }
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.kw { color: #007020; font-weight: bold; }
code span.op { color: #666666; }
code span.ot { color: #007020; }
code span.pp { color: #bc7a00; }
code span.sc { color: #4070a0; }
code span.ss { color: #bb6688; }
code span.st { color: #4070a0; }
code span.va { color: #19177c; }
code span.vs { color: #4070a0; }
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Adaptive Prespecification - Vignette</h1>
<h4 class="author">Laura B. Balzer (<a href="mailto:[email protected]" class="email">[email protected]</a>)</h4>
<h4 class="date">2023-05-30</h4>
<p>Here we provide worked examples of using Adaptive Prespecification
(APS) for empirical efficiency maximization in randomized trials. From a
pre-specified set, APS is used within TMLE to data-adaptively select the
optimal combination of estimators of the <em>outcome regression</em>
(i.e., conditional expectation of the outcome, given the randomized
intervention and candidate covariates) and of the known <em>propensity
score</em> (i.e., conditional probability of the intervention, given the
candidate covariates) to minimize the cross-validated variance
estimate.</p>
<p>Key methods references include</p>
<ul>
<li>Balzer et al., <a href="https://pubmed.ncbi.nlm.nih.gov/27436797/">Adaptive
pre-specification</a> in randomized trials with and without
pair-matching, <em>Statistics in Medicine</em>, 2016</li>
<li>Balzer et al., <a href="https://pubmed.ncbi.nlm.nih.gov/34939083/">Two-Stage TMLE</a> to
reduce bias and improve efficiency in cluster randomized trials,
<em>Biostatistics</em>, 2021</li>
<li>Balzer et al., <a href="https://arxiv.org/abs/2210.17453">Adaptive
Selection</a> of the Optimal Strategy to Improve Precision and Power in
Randomized Trials, <em>arXiv</em>, 2022</li>
</ul>
<p>Example applications include</p>
<ul>
<li>Havlir et al., <a href="https://pubmed.ncbi.nlm.nih.gov/31314966/">HIV Testing and
Treatment</a> with the Use of a Community Health Approach in Rural
Africa, <em>NEJM</em>, 2019 with corresponding Statistical Analysis Plan
<a href="https://arxiv.org/abs/1808.03231">(SAP)</a></li>
<li>Kakende et al., <a href="https://pubmed.ncbi.nlm.nih.gov/35908553/">A mid-level health
manager intervention</a> to promote uptake of isoniazid preventive
therapy among people with HIV in Uganda: a cluster randomised trial,
<em>LancetHIV</em>, 2022 with corresponding <a href="https://arxiv.org/abs/2111.10467">SAP</a></li>
<li>Hickey et al., <a href="https://pubmed.ncbi.nlm.nih.gov/36342940/">Effect of a one-time
financial incentive</a> on linkage to chronic hypertension care in Kenya
and Uganda: A randomized controlled trial, <em>PLoSOne</em>, 2022
(corresponding SAP included in article’s supplementary materials)
<!-- - Ruel et al., [A multilevel health system intervention](IN PRESS) to improve virological suppression in adolescents and young adults living with HIV in rural Kenya and Uganda (SEARCH-Youth): a cluster randomised trial, *Lancet HIV*, 2023 with correspoonding [SAP](https://arxiv.org/abs/2211.02771) --></li>
</ul>
<div id="example-dataset---actg-study-175" class="section level2">
<h2>Example dataset - ACTG Study 175</h2>
<p>For demonstration, we will use real data from the <a href="https://pubmed.ncbi.nlm.nih.gov/8813038/">AIDS Clinical Trials
Group (ACTG) Study 175</a>. ACTG 175 was an individually randomized
trial to evaluate the impact of monotherapy vs. combination therapy
among persons with HIV. The data are publicly available through the <a href="https://CRAN.R-project.org/package=speff2trial"><code>speff2trial</code>
package</a> by Juraska. For demonstration, we are focusing on adults,
aged 18+ years. After loading the data, we do a bit of pre-processing to
create binary indicators of being “young” (aged 18-30years), having a
baseline CD4 count >350 c/mm3, having a baseline CD8 count >350
c/mm3, and starting on antiretroviral therapy (ART) within 1-52 weeks of
baseline.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"speff2trial"</span>)</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co">#> Loading required package: leaps</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Loading required package: survival</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="co"># help(ACTG175)</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a>data_input <span class="ot"><-</span> ACTG175</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="co"># subset the data aged 18+</span></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a>data_input <span class="ot"><-</span> data_input[data_input<span class="sc">$</span>age <span class="sc">></span><span class="dv">17</span>,]</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co"># create indicators</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>young <span class="ot"><-</span> <span class="fu">as.numeric</span>( data_input<span class="sc">$</span>age <span class="sc"><</span> <span class="dv">30</span>)</span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>cd40bin <span class="ot"><-</span> <span class="fu">as.numeric</span>(data_input<span class="sc">$</span>cd40 <span class="sc">></span> <span class="dv">350</span>)</span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>cd80bin <span class="ot"><-</span> <span class="fu">as.numeric</span>(data_input<span class="sc">$</span>cd80 <span class="sc">></span> <span class="dv">350</span>)</span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>recent <span class="ot"><-</span> <span class="fu">as.numeric</span>(data_input<span class="sc">$</span>strat<span class="sc">==</span><span class="dv">2</span>) </span></code></pre></div>
</div>
<div id="load-in-aps-and-tmle-functions-relevant-libraries-and-specify-key-variables" class="section level2">
<h2>Load in APS and TMLE functions, relevant libraries, and specify key
variables</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># https://github.com/LauraBalzer/AdaptivePrespec/</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">"Stage2_Functions_Meta.R"</span>)</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">"TMLE_Functions_Meta.R"</span>)</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">"Adapt_Functions_Meta.R"</span>)</span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">'ACTG_MakePretty.R'</span>)</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"SuperLearner"</span>)</span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"glmnet"</span>)</span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"earth"</span>)</span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">'knitr'</span>)</span></code></pre></div>
<p>APS is applicable to both individually randomized trials and cluster
randomized trials; therefore, we need to specify the independent unit
with <code>id</code>. Additionally, we need to create a dummy indicator
<code>U</code> equal to 1 for the unadjusted estimator, which is always
included as a candidate. In cluster randomized trials, weights
(<code>alpha</code>) can be included to target effect individual-level
or cluster-level effects; see <a href="https://arxiv.org/abs/2110.09633">Benitez et al. (2021)</a> for
details. In this individually randomized trial, set
<code>alpha=1</code>. Finally, we specify the treatment indicator
<code>A</code>, where <span class="math inline">\(A=1\)</span> for the
intervention and <span class="math inline">\(A=0\)</span> for the
control. We will specify the outcome <code>Y</code> below.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>id <span class="ot"><-</span> data_input<span class="sc">$</span>pidnum <span class="co"># patient id</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>U <span class="ot"><-</span> <span class="dv">1</span> <span class="co"># dummy variable for the unadjusted estimator </span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>alpha <span class="ot"><-</span> <span class="dv">1</span> <span class="co"># NA - weights for cluster randomized trials</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>A <span class="ot"><-</span> data_input<span class="sc">$</span>treat <span class="co"># intervention indicator</span></span></code></pre></div>
</div>
<div id="prespecifing-candidate-adjustment-variables-and-candidate-estimators" class="section level2">
<h2>Prespecifing candidate adjustment variables and candidate
estimators</h2>
<p>As candidate adjustment variables, we consider demographic variables
(e.g., age, gender), measures of disease severity (e.g., Karnofsky
score, being symptomatic), history of ART use, and baseline measures of
CD4 and CD8 counts. We refer to the help file
(<code>help(ACTG175)</code>) for more information</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>all_cand <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"age"</span>, <span class="st">"young"</span>, <span class="st">"wtkg"</span>, <span class="st">"hemo"</span>,</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="st">"karnof"</span>, <span class="st">"oprior"</span>, <span class="st">"preanti"</span>, </span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"race"</span>, <span class="st">"gender"</span>, </span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"str2"</span>, <span class="st">"recent"</span>, <span class="st">"symptom"</span>,</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="st">"cd40"</span>, <span class="st">"cd40bin"</span>, <span class="st">"cd80"</span>, <span class="st">"cd80bin"</span>)</span></code></pre></div>
<p>These characteristics are summarized by arm and overall in the
following Table. Continuous variables are shown as median [Q1, Q2] and
binary variables as N (%).</p>
<table>
<caption>Baseline characteristics of adult (age 18+ years) participants
in the ACTG 175 Study (<a href="https://pubmed.ncbi.nlm.nih.gov/8813038/" class="uri">https://pubmed.ncbi.nlm.nih.gov/8813038/</a>)</caption>
<colgroup>
<col width="45%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
</colgroup>
<thead>
<tr class="header">
<th align="left"></th>
<th align="left">Intervention</th>
<th align="left">Control</th>
<th align="left">Overall</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left"></td>
<td align="left">N=1587</td>
<td align="left">N=526</td>
<td align="left">N=2113</td>
</tr>
<tr class="even">
<td align="left">Age (years)</td>
<td align="left">34 [29,40]</td>
<td align="left">34 [29,40]</td>
<td align="left">34 [29,40]</td>
</tr>
<tr class="odd">
<td align="left">Aged 18-29 years</td>
<td align="left">399 (25%)</td>
<td align="left">137 (26%)</td>
<td align="left">536 (25%)</td>
</tr>
<tr class="even">
<td align="left">Male</td>
<td align="left">1319 (83%)</td>
<td align="left">427 (81%)</td>
<td align="left">1746 (83%)</td>
</tr>
<tr class="odd">
<td align="left">Non-white race</td>
<td align="left">456 (29%)</td>
<td align="left">154 (29%)</td>
<td align="left">610 (29%)</td>
</tr>
<tr class="even">
<td align="left">Weight (kg)</td>
<td align="left">74 [67,82]</td>
<td align="left">75 [68,84]</td>
<td align="left">74 [67,83]</td>
</tr>
<tr class="odd">
<td align="left">Has hemophilia</td>
<td align="left">118 (7%)</td>
<td align="left">37 (7%)</td>
<td align="left">155 (7%)</td>
</tr>
<tr class="even">
<td align="left">Karnofsky score (scale 0-100)</td>
<td align="left">100 [90,100]</td>
<td align="left">100 [90,100]</td>
<td align="left">100 [90,100]</td>
</tr>
<tr class="odd">
<td align="left">Symptomatic</td>
<td align="left">279 (18%)</td>
<td align="left">88 (17%)</td>
<td align="left">367 (17%)</td>
</tr>
<tr class="even">
<td align="left">ART experienced</td>
<td align="left">926 (58%)</td>
<td align="left">307 (58%)</td>
<td align="left">1233 (58%)</td>
</tr>
<tr class="odd">
<td align="left">Time on ART (days)</td>
<td align="left">139 [0,739]</td>
<td align="left">138 [0,731]</td>
<td align="left">139 [0,735]</td>
</tr>
<tr class="even">
<td align="left">Recently started ART (1-52wks prior)</td>
<td align="left">312 (20%)</td>
<td align="left">96 (18%)</td>
<td align="left">408 (19%)</td>
</tr>
<tr class="odd">
<td align="left">Non-zidovudine prior to baseline</td>
<td align="left">31 (2%)</td>
<td align="left">16 (3%)</td>
<td align="left">47 (2%)</td>
</tr>
<tr class="even">
<td align="left">Baseline CD4 count (cells/mm<span class="math inline">\(^3\)</span>)</td>
<td align="left">339 [260,423]</td>
<td align="left">346 [271,422]</td>
<td align="left">340 [263,423]</td>
</tr>
<tr class="odd">
<td align="left">Baseline CD4>350</td>
<td align="left">724 (46%)</td>
<td align="left">252 (48%)</td>
<td align="left">976 (46%)</td>
</tr>
<tr class="even">
<td align="left">Baseline CD8 count (cells/mm<span class="math inline">\(^3\)</span>)</td>
<td align="left">897 [655,1212]</td>
<td align="left">880 [656,1190]</td>
<td align="left">894 [655,1210]</td>
</tr>
<tr class="odd">
<td align="left">Baseline CD48>350</td>
<td align="left">1540 (97%)</td>
<td align="left">520 (99%)</td>
<td align="left">2060 (97%)</td>
</tr>
</tbody>
</table>
<p>We consider two implementations of APS:</p>
<ol style="list-style-type: decimal">
<li><p><a href="https://pubmed.ncbi.nlm.nih.gov/27436797/">“Small
APS”:</a> The candidate estimators of the outcome regression and
propensity score are limited to “working” generalized linear models
(GLMs) with at most one adjustment covariate. This approach is
recommended for small sample size (<span class="math inline">\(N<40\)</span>).</p></li>
<li><p><a href="https://arxiv.org/abs/2210.17453">“Large APS”:</a> The
candidate estimators now consider adjusting for multiple covariates. The
algorithms currently coded are main terms (<code>glm</code>), stepwise
regression (<code>stepwise</code>), LASSO (<code>lasso</code>),
multivariate adaptive regression splines (MARS; <code>mars</code>), and
MARS after screening based on pairwise correlations
(<code>mars.corp</code>). The candidate estimators in the Small APS
implementation (i.e., working GLMs with at most one adjustment
covariate) are also included in the Large APS implementation.</p></li>
</ol>
<p>The <code>get.cand.adj</code> function generates the set of candidate
learners. We input the candidate covariates (<code>all.cand</code>),
estimators of the outcome regression (<code>cand.Qform.fancy</code>),
and estimators of the propensity score (<code>cand.gform.fancy</code>).
Setting <code>cand.Qform.fancy</code> and <code>cand.gform.fancy</code>
to <code>NULL</code> will return working GLMs with at most 1 adjustment
variable.</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Small APS - working GLMs with at most 1 adjustment variable</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>small_aps <span class="ot"><-</span> <span class="fu">get.cand.adj</span>(<span class="at">all.cand =</span> all_cand, <span class="at">cand.Qform.fancy =</span> <span class="cn">NULL</span>, <span class="at">cand.gform.fancy =</span> <span class="cn">NULL</span>)</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="co"># small_aps</span></span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Large APS - considering the candidates in Small APS as well as main terms,</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="co"># stepwise, LASSO, and MARS with and without screening</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>large_aps <span class="ot"><-</span> <span class="fu">get.cand.adj</span>(<span class="at">all.cand =</span> all_cand, </span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.Qform.fancy =</span> <span class="fu">c</span>(<span class="st">"glm"</span>, <span class="st">"stepwise"</span>, <span class="st">"lasso"</span>, <span class="st">"mars"</span>, <span class="st">"mars.corP"</span>), </span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.gform.fancy =</span> <span class="fu">c</span>(<span class="st">"glm"</span>, <span class="st">"stepwise"</span>, <span class="st">"lasso"</span>, <span class="st">"mars"</span>, <span class="st">"mars.corP"</span>))</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="co"># large_aps</span></span></code></pre></div>
</div>
<div id="demonstration-with-a-continuous-outcome" class="section level1">
<h1>Demonstration with a continuous outcome</h1>
<p>We first demonstrate implementation with a continuous outcome: CD4
count at 20 +/- 5 weeks and for estimation of the effect on the
difference scale (i.e., ATE).</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">1</span>)</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>Y <span class="ot"><-</span> data_input<span class="sc">$</span>cd420</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>goal <span class="ot"><-</span> <span class="st">'RD'</span> <span class="co"># effect estimates on the difference scale</span></span></code></pre></div>
<div id="unadjusted-estimator" class="section level2">
<h2>Unadjusted estimator</h2>
<p>For comparison, we first consider the unadjusted estimator.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>unadj <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal=</span>goal, <span class="at">data.input=</span>data_input, <span class="at">do.data.adapt=</span>F)</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>unadj</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.0819 375.8667 390.2972 3.681325 336.7129 325.5124 347.9135 5.714671</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 46.36899 33.04561 59.69236 6.797766 9.027686e-12 NA NA 1 1</span></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 glm 1 glm</span></span></code></pre></div>
<p>The <code>Stage2</code> returns point estimates, 95% confidence
intervals (CIs), and standard error estimates arm-specific endpoints
(denoted <code>Txt</code> for intervention and <code>Con</code> for
control) as well as the intervention effect on the inputted scale. The
p-value for null hypothesis testing is also generated, and
<code>reject</code> indicates if the relevant null hypothesis was
rejected at the selected significance level.</p>
<p>Additional output used for simulation studies when we know the true
value of the effect (<code>psi</code>) include <code>bias</code> and
<code>cover</code> (indicating the 95%CI include the true value).
Finally, <code>QAdj</code> and <code>Qform</code> indicate the selection
of the adjustment variables and their form for the outcome regression,
while <code>gAdj</code> and <code>gform</code> indicate the selection of
the adjustment variables and their form for the propensity score.</p>
<p>Here, <code>QAdj=gAdj=1</code> and <code>Qform=gform=glm</code>
indicate adjusting for the dummy variable <span class="math inline">\(U\)</span> as a main term in a working regression;
this is equivalent to the unadusted estimator.</p>
</div>
<div id="fixed-regression" class="section level2">
<h2>Fixed regression</h2>
<p>Also for comparison, we consider a TMLE with fixed adjustment for
<code>age</code> in the outcome regression and for <code>gender</code>
in the propensity score.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>fixed <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal =</span> goal, <span class="at">data.input =</span> data_input, </span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="at">do.data.adapt =</span> F, </span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> <span class="at">QAdj=</span><span class="st">'age'</span>, <span class="at">Qform=</span><span class="st">'glm'</span>, </span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a> <span class="at">gAdj=</span><span class="st">'gender'</span>, <span class="at">gform=</span><span class="st">'glm'</span>)</span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a>fixed</span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.1852 375.9749 390.3956 3.678814 336.4212 325.2867 347.5556 5.680947</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 46.76407 33.49889 60.02925 6.768075 4.86335e-12 NA NA 1 -99</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 glm -99 glm</span></span></code></pre></div>
<p>The output will return <code>QAdj=-99</code> and
<code>gAdj=-99</code> if fixed adjustment is being used.</p>
</div>
<div id="small-sample-aps-in-tmle" class="section level2">
<h2>Small sample APS in TMLE</h2>
<p>We now consider the small sample implementation of APS in TMLE. We
now set <code>do.data.adapt=T</code>, specify the number of folds in
cross-validation (<code>V</code>), as well as the candidate adjustment
variables and estimators:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>small_tmle <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal =</span> goal, <span class="at">data.input =</span> data_input, </span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="at">do.data.adapt =</span> <span class="cn">TRUE</span>, <span class="at">V =</span> <span class="dv">5</span>, </span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.QAdj =</span> small_aps<span class="sc">$</span>cand.QAdj, <span class="at">cand.Qform =</span> small_aps<span class="sc">$</span>cand.Qform,</span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.gAdj =</span> small_aps<span class="sc">$</span>cand.gAdj, <span class="at">cand.gform =</span> small_aps<span class="sc">$</span>cand.gform)</span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a>small_tmle</span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.6668 377.7603 389.5733 3.013588 335.1638 326.5275 343.8001 4.406357</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 48.50295 38.04003 58.96588 5.338324 1.029372e-19 NA NA 1 14</span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 glm 14 glm</span></span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a><span class="co"># selection for outcome regression</span></span>
<span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a>small_aps<span class="sc">$</span>cand.QAdj[small_tmle<span class="sc">$</span>QAdj]</span>
<span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a><span class="co">#> [[1]]</span></span>
<span id="cb10-15"><a href="#cb10-15" aria-hidden="true" tabindex="-1"></a><span class="co">#> [1] "cd40"</span></span>
<span id="cb10-16"><a href="#cb10-16" aria-hidden="true" tabindex="-1"></a><span class="co"># selection for pscore</span></span>
<span id="cb10-17"><a href="#cb10-17" aria-hidden="true" tabindex="-1"></a>small_aps<span class="sc">$</span>cand.gAdj[small_tmle<span class="sc">$</span>gAdj]</span>
<span id="cb10-18"><a href="#cb10-18" aria-hidden="true" tabindex="-1"></a><span class="co">#> [[1]]</span></span>
<span id="cb10-19"><a href="#cb10-19" aria-hidden="true" tabindex="-1"></a><span class="co">#> [1] "cd40"</span></span></code></pre></div>
<p>The outcome at baseline <code>cd40</code> was selected for adjustment
in both the outcome regression and propensity score. Let’s examine the
added benefit of collaborative estimation of the propensity score by
setting <code>gAdj=NULL</code> and <code>gform=glm</code>. This will
generate a TMLE only adjusting in the outcome regression. For
demonstration, we will use the same approach for estimating the outcome
regression that was selected previously.</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>small_tmle_Qonly <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal =</span> goal, <span class="at">data.input =</span> data_input, </span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># do.data.adapt = F, V = 5, </span></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a> <span class="at">QAdj=</span> <span class="fu">unlist</span>(small_aps<span class="sc">$</span>cand.QAdj[small_tmle<span class="sc">$</span>QAdj]), </span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a> <span class="at">Qform=</span>small_tmle<span class="sc">$</span>Qform,</span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="at">gAdj=</span><span class="cn">NULL</span>, <span class="at">gform=</span><span class="st">'glm'</span>)</span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a><span class="co"># Note: we could alternatively hardcode this by setting</span></span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a><span class="co"># QAdj= 'cd40', Qform='glm', </span></span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a>small_tmle_Qonly</span>
<span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb11-11"><a href="#cb11-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.6348 377.74 389.5296 3.007583 335.2535 326.5603 343.9468 4.435422</span></span>
<span id="cb11-12"><a href="#cb11-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb11-13"><a href="#cb11-13" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 48.38125 37.87787 58.88463 5.358967 1.746894e-19 NA NA 1 -99</span></span>
<span id="cb11-14"><a href="#cb11-14" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb11-15"><a href="#cb11-15" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 glm -99 glm</span></span></code></pre></div>
</div>
<div id="large-sample-aps-in-tmle" class="section level2">
<h2>Large sample APS in TMLE</h2>
<p>We now consider the large sample implementation of APS in TMLE.</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>large_tmle <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal =</span> goal, <span class="at">data.input =</span> data_input, </span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="at">do.data.adapt =</span> <span class="cn">TRUE</span>, <span class="at">V =</span> <span class="dv">5</span>, </span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.QAdj =</span> large_aps<span class="sc">$</span>cand.QAdj, <span class="at">cand.Qform =</span> large_aps<span class="sc">$</span>cand.Qform,</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> <span class="at">cand.gAdj =</span> large_aps<span class="sc">$</span>cand.gAdj, <span class="at">cand.gform =</span> large_aps<span class="sc">$</span>cand.gform)</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a>large_tmle</span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.4612 377.9106 389.0118 2.831992 335.6739 327.582 343.7657 4.128561</span></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 47.78731 37.97472 57.5999 5.006515 1.36075e-21 NA NA 1 21</span></span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 mars 14 glm</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a><span class="co"># selection for outcome regression</span></span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a>large_aps<span class="sc">$</span>cand.QAdj[large_tmle<span class="sc">$</span>QAdj]</span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a><span class="co">#> [[1]]</span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a><span class="co">#> [1] "age" "young" "wtkg" "hemo" "karnof" "oprior" "preanti"</span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a><span class="co">#> [8] "race" "gender" "str2" "recent" "symptom" "cd40" "cd40bin"</span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a><span class="co">#> [15] "cd80" "cd80bin"</span></span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a><span class="co"># selection for pscore</span></span>
<span id="cb12-19"><a href="#cb12-19" aria-hidden="true" tabindex="-1"></a>large_aps<span class="sc">$</span>cand.gAdj[large_tmle<span class="sc">$</span>gAdj]</span>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a><span class="co">#> [[1]]</span></span>
<span id="cb12-21"><a href="#cb12-21" aria-hidden="true" tabindex="-1"></a><span class="co">#> [1] "cd40"</span></span></code></pre></div>
<p>In the large sample implementation, the outcome regression was
estimated with MARS, and, as before, the propensity score was estimated
with working GLM adjusting for <code>cd40</code>. Let’s examine the
added benefit of adaptive adjustment in the propensity score by setting
<code>gAdj=NULL</code> and <code>gform=glm</code>. This will generate a
TMLE only adjusting in the outcome regression, which was previously
selected through our adaptive approach.</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>large_tmle_Qonly <span class="ot"><-</span> <span class="fu">Stage2</span>(<span class="at">goal =</span> goal, <span class="at">data.input =</span> data_input, </span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># do.data.adapt = F, V = 5, </span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> <span class="at">QAdj=</span> <span class="fu">unlist</span>(large_aps<span class="sc">$</span>cand.QAdj[large_tmle<span class="sc">$</span>QAdj]), </span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> <span class="at">Qform=</span>large_tmle<span class="sc">$</span>Qform, </span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> <span class="at">gAdj=</span><span class="cn">NULL</span>, <span class="at">gform=</span><span class="st">'glm'</span>)</span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a>large_tmle_Qonly</span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Txt.est Txt.CI.lo Txt.CI.hi Txt.se Con.est Con.CI.lo Con.CI.hi Con.se</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 383.4432 377.9023 388.9842 2.827077 335.7242 327.5862 343.8623 4.152139</span></span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> psi est CI.lo CI.hi se pval bias cover reject QAdj</span></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 NA 47.71903 37.87372 57.56434 5.023209 2.104734e-21 NA NA 1 -99</span></span>
<span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> Qform gAdj gform</span></span>
<span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 mars -99 glm</span></span></code></pre></div>
</div>
<div id="compact-comparison-of-results" class="section level2">
<h2>Compact comparison of results</h2>
<p>Comparative results with a <strong>continous outcome</strong> for
arm-specific outcomes (95%CI) and the intervention effect (95%CI).</p>
<ul>
<li><p><code>Rel.Var.</code> is the estimated variance of a given
approach to that of the unadjusted approach.</p></li>
<li><p><code>Savings</code> is the estimated reduction in sample size
from using an adjusted approach, assuming negligible bias.</p></li>
<li><p><code>Out.Reg</code> is the fixed or adaptively selected
estimator for the outcome regression.</p></li>
<li><p><code>PScore</code> is the fixed or adaptively selected estimator
for the propensity score.</p></li>
<li><p><code>Small TMLE</code> and <code>Large TMLE</code> refer to
using APS only to select of the outcome regression estimator in the
small-trial and large-trial implementation, respectively.</p></li>
<li><p><code>Small CTMLE</code> and <code>Large CTMLE</code> refer to
using APS for selection of the outcome regression estimator and
<strong>collaborative</strong> selection of the known propensity score
estimator in the small-trial and large-trial implementation,
respectively.’</p></li>
</ul>
<table style="width:100%;">
<colgroup>
<col width="11%" />
<col width="19%" />
<col width="19%" />
<col width="17%" />
<col width="8%" />
<col width="7%" />
<col width="8%" />
<col width="6%" />
</colgroup>
<thead>
<tr class="header">
<th align="left"></th>
<th align="left">Intervention</th>
<th align="left">Control</th>
<th align="left">Effect</th>
<th align="left">Rel.Var.</th>
<th align="left">Savings</th>
<th align="left">Out.Reg.</th>
<th align="left">PScore</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Unadjusted</td>
<td align="left">383.1 (375.9, 390.3)</td>
<td align="left">336.7 (325.5, 347.9)</td>
<td align="left">46.4 (33.0, 59.7)</td>
<td align="left">1.000</td>
<td align="left">0%</td>
<td align="left">Unadj.</td>
<td align="left">Unadj.</td>
</tr>
<tr class="even">
<td align="left">Static</td>
<td align="left">383.2 (376.0, 390.4)</td>
<td align="left">336.4 (325.3, 347.6)</td>
<td align="left">46.8 (33.5, 60.0)</td>
<td align="left">0.991</td>
<td align="left">0.9%</td>
<td align="left">Fixed</td>
<td align="left">Fixed</td>
</tr>
<tr class="odd">
<td align="left">Small TMLE</td>
<td align="left">383.6 (377.7, 389.5)</td>
<td align="left">335.3 (326.6, 343.9)</td>
<td align="left">48.4 (37.9, 58.9)</td>
<td align="left">0.621</td>
<td align="left">37.9%</td>
<td align="left">GLM</td>
<td align="left">Unadj.</td>
</tr>
<tr class="even">
<td align="left">Small CTMLE</td>
<td align="left">383.7 (377.8, 389.6)</td>
<td align="left">335.2 (326.5, 343.8)</td>
<td align="left">48.5 (38.0, 59.0)</td>
<td align="left">0.617</td>
<td align="left">38.3%</td>
<td align="left">GLM</td>
<td align="left">GLM</td>
</tr>
<tr class="odd">
<td align="left">Large TMLE</td>
<td align="left">383.4 (377.9, 389.0)</td>
<td align="left">335.7 (327.6, 343.9)</td>
<td align="left">47.7 (37.9, 57.6)</td>
<td align="left">0.546</td>
<td align="left">45.4%</td>
<td align="left">MARS</td>
<td align="left">Unadj.</td>
</tr>
<tr class="even">
<td align="left">Large CTMLE</td>
<td align="left">383.5 (377.9, 389.0)</td>
<td align="left">335.7 (327.6, 343.8)</td>
<td align="left">47.8 (38.0, 57.6)</td>
<td align="left">0.542</td>
<td align="left">45.8%</td>
<td align="left">MARS</td>
<td align="left">GLM</td>
</tr>
</tbody>
</table>
</div>
<div id="subgroup-analyses" class="section level2">
<h2>Subgroup analyses</h2>
<p>For demonstration with smaller sample sizes, as seen in subgroup
analyses, we now examine effects defined within strata defined by
baseline age group (18-30 years vs. 31+ years) and gender.</p>
<p>See <code>aps_wrapper()</code> function within
<code>MakePretty_App.R</code> for the wrapper function used to generate
estimates from the algorithms under consideration.</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>this.label <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">'Older women'</span>, <span class="st">'Younger women'</span>, <span class="st">'Older men'</span>,<span class="st">'Younger men'</span>)</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>age.indicator <span class="ot"><-</span> <span class="fu">c</span>(<span class="dv">0</span>,<span class="dv">1</span>,<span class="dv">0</span>,<span class="dv">1</span>)</span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a>gender.indicator <span class="ot"><-</span> <span class="fu">c</span>(<span class="dv">0</span>,<span class="dv">0</span>,<span class="dv">1</span>,<span class="dv">1</span>)</span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">1</span>)</span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a>CONT <span class="ot"><-</span> <span class="cn">NULL</span></span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span>(j <span class="cf">in</span> <span class="dv">1</span><span class="sc">:</span><span class="fu">length</span>(this.label)){</span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a> data_sub <span class="ot"><-</span> data_input[data_input<span class="sc">$</span>gender<span class="sc">==</span>gender.indicator[j] <span class="sc">&</span> </span>
<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a> data_input<span class="sc">$</span>young<span class="sc">==</span>age.indicator[j],]</span>
<span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a> est_sub <span class="ot"><-</span> <span class="fu">aps_wrapper</span>(<span class="at">goal=</span>goal, <span class="at">data_input=</span>data_sub, </span>
<span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a> <span class="at">small_aps=</span>small_aps, <span class="at">large_aps=</span>large_aps)</span>
<span id="cb14-11"><a href="#cb14-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">print</span>(<span class="fu">kable</span>(est_sub<span class="sc">$</span>compact, <span class="at">caption=</span><span class="fu">paste0</span>(<span class="st">'Subgroup results for '</span>, this.label[j],</span>
<span id="cb14-12"><a href="#cb14-12" aria-hidden="true" tabindex="-1"></a> <span class="st">' (N='</span>, <span class="fu">nrow</span>(data_sub), <span class="st">')'</span>) ) )</span>
<span id="cb14-13"><a href="#cb14-13" aria-hidden="true" tabindex="-1"></a> CONT <span class="ot"><-</span> <span class="fu">rbind</span>(CONT, <span class="fu">cbind</span>(<span class="at">group=</span><span class="fu">c</span>(this.label[j], <span class="fu">paste0</span>( <span class="st">'(N='</span>,<span class="fu">nrow</span>(data_sub),<span class="st">')'</span>),</span>
<span id="cb14-14"><a href="#cb14-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">rep</span>(<span class="st">''</span>, <span class="fu">nrow</span>(est_sub<span class="sc">$</span>compact)<span class="sc">-</span><span class="dv">2</span>)), </span>
<span id="cb14-15"><a href="#cb14-15" aria-hidden="true" tabindex="-1"></a> <span class="at">est=</span><span class="fu">rownames</span>(est_sub<span class="sc">$</span>est),</span>
<span id="cb14-16"><a href="#cb14-16" aria-hidden="true" tabindex="-1"></a> est_sub<span class="sc">$</span>compact))</span>
<span id="cb14-17"><a href="#cb14-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-18"><a href="#cb14-18" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb14-19"><a href="#cb14-19" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-20"><a href="#cb14-20" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-21"><a href="#cb14-21" aria-hidden="true" tabindex="-1"></a><span class="co">#> Table: Subgroup results for Older women (N=258)</span></span>
<span id="cb14-22"><a href="#cb14-22" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-23"><a href="#cb14-23" aria-hidden="true" tabindex="-1"></a><span class="co">#> | |Intervention |Control |Effect |Rel.Var. |Savings |Out.Reg. |PScore |</span></span>
<span id="cb14-24"><a href="#cb14-24" aria-hidden="true" tabindex="-1"></a><span class="co">#> |:-----------|:--------------------|:--------------------|:-----------------|:--------|:-------|:--------|:------|</span></span>
<span id="cb14-25"><a href="#cb14-25" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Unadjusted |389.9 (368.8, 411.0) |336.3 (308.2, 364.4) |53.6 (18.4, 88.7) |1.000 |0% |Unadj. |Unadj. |</span></span>
<span id="cb14-26"><a href="#cb14-26" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Static |389.8 (368.8, 410.8) |336.5 (308.8, 364.3) |53.3 (18.5, 88.1) |0.979 |2.1% |Fixed |Fixed |</span></span>
<span id="cb14-27"><a href="#cb14-27" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small TMLE |392.2 (374.5, 409.8) |329.7 (305.6, 353.9) |62.5 (32.5, 92.4) |0.723 |27.7% |GLM |Unadj. |</span></span>
<span id="cb14-28"><a href="#cb14-28" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small CTMLE |392.7 (375.0, 410.4) |328.3 (305.3, 351.3) |64.3 (35.3, 93.4) |0.682 |31.8% |GLM |GLM |</span></span>
<span id="cb14-29"><a href="#cb14-29" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large TMLE |392.2 (374.5, 409.8) |329.7 (305.6, 353.9) |62.5 (32.5, 92.4) |0.723 |27.7% |GLM |Unadj. |</span></span>
<span id="cb14-30"><a href="#cb14-30" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large CTMLE |392.7 (375.0, 410.4) |328.3 (305.3, 351.3) |64.3 (35.3, 93.4) |0.682 |31.8% |GLM |GLM |</span></span>
<span id="cb14-31"><a href="#cb14-31" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-32"><a href="#cb14-32" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-33"><a href="#cb14-33" aria-hidden="true" tabindex="-1"></a><span class="co">#> Table: Subgroup results for Younger women (N=109)</span></span>
<span id="cb14-34"><a href="#cb14-34" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-35"><a href="#cb14-35" aria-hidden="true" tabindex="-1"></a><span class="co">#> | |Intervention |Control |Effect |Rel.Var. |Savings |Out.Reg. |PScore |</span></span>
<span id="cb14-36"><a href="#cb14-36" aria-hidden="true" tabindex="-1"></a><span class="co">#> |:-----------|:--------------------|:--------------------|:-------------------|:--------|:-------|:--------|:------|</span></span>
<span id="cb14-37"><a href="#cb14-37" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Unadjusted |379.1 (346.8, 411.3) |392.7 (333.0, 452.3) |-13.6 (-81.4, 54.2) |1.000 |0% |Unadj. |Unadj. |</span></span>
<span id="cb14-38"><a href="#cb14-38" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Static |378.9 (346.8, 411.1) |392.9 (333.1, 452.7) |-14.0 (-81.8, 53.9) |1.002 |-0.2% |Fixed |Fixed |</span></span>
<span id="cb14-39"><a href="#cb14-39" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small TMLE |393.0 (369.5, 416.6) |363.4 (324.5, 402.3) |29.6 (-15.8, 75.1) |0.449 |55.1% |GLM |Unadj. |</span></span>
<span id="cb14-40"><a href="#cb14-40" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small CTMLE |395.4 (370.7, 420.2) |358.2 (324.1, 392.3) |37.3 (-4.9, 79.4) |0.386 |61.4% |GLM |GLM |</span></span>
<span id="cb14-41"><a href="#cb14-41" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large TMLE |393.0 (369.5, 416.6) |363.4 (324.5, 402.3) |29.6 (-15.8, 75.1) |0.449 |55.1% |GLM |Unadj. |</span></span>
<span id="cb14-42"><a href="#cb14-42" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large CTMLE |395.4 (370.7, 420.2) |358.2 (324.1, 392.3) |37.3 (-4.9, 79.4) |0.386 |61.4% |GLM |GLM |</span></span>
<span id="cb14-43"><a href="#cb14-43" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-44"><a href="#cb14-44" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-45"><a href="#cb14-45" aria-hidden="true" tabindex="-1"></a><span class="co">#> Table: Subgroup results for Older men (N=1319)</span></span>
<span id="cb14-46"><a href="#cb14-46" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-47"><a href="#cb14-47" aria-hidden="true" tabindex="-1"></a><span class="co">#> | |Intervention |Control |Effect |Rel.Var. |Savings |Out.Reg. |PScore |</span></span>
<span id="cb14-48"><a href="#cb14-48" aria-hidden="true" tabindex="-1"></a><span class="co">#> |:-----------|:--------------------|:--------------------|:-----------------|:--------|:-------|:--------|:------|</span></span>
<span id="cb14-49"><a href="#cb14-49" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Unadjusted |378.7 (369.8, 387.6) |327.9 (314.0, 341.8) |50.8 (34.3, 67.4) |1.000 |0% |Unadj. |Unadj. |</span></span>
<span id="cb14-50"><a href="#cb14-50" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Static |378.7 (369.8, 387.6) |327.9 (314.0, 341.9) |50.8 (34.2, 67.3) |0.999 |0.1% |Fixed |Fixed |</span></span>
<span id="cb14-51"><a href="#cb14-51" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small TMLE |378.6 (371.1, 386.1) |328.4 (317.5, 339.2) |50.2 (37.0, 63.4) |0.637 |36.3% |GLM |Unadj. |</span></span>
<span id="cb14-52"><a href="#cb14-52" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small CTMLE |378.6 (371.1, 386.1) |328.3 (317.5, 339.2) |50.3 (37.1, 63.4) |0.636 |36.4% |GLM |GLM |</span></span>
<span id="cb14-53"><a href="#cb14-53" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large TMLE |378.2 (371.1, 385.4) |329.4 (318.9, 339.9) |48.9 (36.2, 61.6) |0.591 |40.9% |LASSO |Unadj. |</span></span>
<span id="cb14-54"><a href="#cb14-54" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large CTMLE |378.2 (371.1, 385.4) |329.4 (318.9, 339.9) |48.9 (36.2, 61.6) |0.591 |40.9% |LASSO |GLM |</span></span>
<span id="cb14-55"><a href="#cb14-55" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-56"><a href="#cb14-56" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-57"><a href="#cb14-57" aria-hidden="true" tabindex="-1"></a><span class="co">#> Table: Subgroup results for Younger men (N=427)</span></span>
<span id="cb14-58"><a href="#cb14-58" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-59"><a href="#cb14-59" aria-hidden="true" tabindex="-1"></a><span class="co">#> | |Intervention |Control |Effect |Rel.Var. |Savings |Out.Reg. |PScore |</span></span>
<span id="cb14-60"><a href="#cb14-60" aria-hidden="true" tabindex="-1"></a><span class="co">#> |:-----------|:--------------------|:--------------------|:-----------------|:--------|:-------|:--------|:------|</span></span>
<span id="cb14-61"><a href="#cb14-61" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Unadjusted |393.2 (376.3, 410.2) |345.9 (321.5, 370.2) |47.4 (17.7, 77.1) |1.000 |0% |Unadj. |Unadj. |</span></span>
<span id="cb14-62"><a href="#cb14-62" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Static |392.9 (376.0, 409.8) |346.8 (322.5, 371.0) |46.2 (16.6, 75.8) |0.994 |0.6% |Fixed |Fixed |</span></span>
<span id="cb14-63"><a href="#cb14-63" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small TMLE |392.0 (379.3, 404.7) |350.0 (330.9, 369.1) |42.0 (19.1, 65.0) |0.599 |40.1% |GLM |Unadj. |</span></span>
<span id="cb14-64"><a href="#cb14-64" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Small CTMLE |391.8 (379.1, 404.6) |350.6 (331.5, 369.7) |41.2 (18.3, 64.2) |0.598 |40.2% |GLM |GLM |</span></span>
<span id="cb14-65"><a href="#cb14-65" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large TMLE |392.9 (380.6, 405.1) |347.3 (329.3, 365.3) |45.6 (23.9, 67.4) |0.538 |46.2% |Main |Unadj. |</span></span>
<span id="cb14-66"><a href="#cb14-66" aria-hidden="true" tabindex="-1"></a><span class="co">#> |Large CTMLE |392.7 (380.4, 405.0) |347.7 (329.9, 365.6) |45.0 (23.3, 66.7) |0.534 |46.6% |Main |GLM |</span></span></code></pre></div>
</div>
</div>
<div id="demonstration-with-a-binary-outcome" class="section level1">
<h1>Demonstration with a binary outcome</h1>
<p>We now consider binary outcome that CD4 count at 20 week window is
>350. For demonstration, we now do effect estimation on the relative
scale (i.e., arithmetic risk ratio).</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">1</span>)</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>data_input<span class="sc">$</span>Y <span class="ot"><-</span> <span class="fu">as.numeric</span>(data_input<span class="sc">$</span>cd420 <span class="sc">></span> <span class="dv">350</span>)</span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a>goal <span class="ot"><-</span> <span class="st">'aRR'</span> <span class="co"># relative effects</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a>est_bin <span class="ot"><-</span> <span class="fu">aps_wrapper</span>(<span class="at">goal=</span>goal, <span class="at">data_input=</span>data_input, </span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a> <span class="at">small_aps=</span>small_aps, <span class="at">large_aps=</span>large_aps)</span></code></pre></div>
<p>Comparative results with a <strong>binary outcome</strong> for
arm-specific outcomes and intervention effect, overall and for select
subgroups.</p>
<table>
<colgroup>
<col width="12%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
<col width="9%" />
<col width="8%" />
<col width="9%" />
<col width="7%" />
</colgroup>
<thead>
<tr class="header">
<th align="left"></th>
<th align="left">Intervention</th>
<th align="left">Control</th>
<th align="left">Effect</th>
<th align="left">Rel.Var.</th>
<th align="left">Savings</th>
<th align="left">Out.Reg.</th>
<th align="left">PScore</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Unadjusted</td>
<td align="left">0.53 (0.51, 0.56)</td>
<td align="left">0.43 (0.39, 0.48)</td>
<td align="left">1.23 (1.10, 1.37)</td>
<td align="left">1.000</td>
<td align="left">0%</td>
<td align="left">Unadj.</td>
<td align="left">Unadj.</td>
</tr>
<tr class="even">
<td align="left">Static</td>
<td align="left">0.53 (0.51, 0.56)</td>
<td align="left">0.43 (0.39, 0.48)</td>
<td align="left">1.23 (1.11, 1.37)</td>
<td align="left">1.001</td>
<td align="left">-0.1%</td>
<td align="left">Fixed</td>
<td align="left">Fixed</td>
</tr>
<tr class="odd">