-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytic17.html
More file actions
1173 lines (1144 loc) · 108 KB
/
analytic17.html
File metadata and controls
1173 lines (1144 loc) · 108 KB
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 xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.2.335">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>hdPS and its machine learning extensions in residual confounding control - 33 Recoding cycle 10</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
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; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./merge13to17.html" rel="next">
<link href="./analytic15.html" rel="prev">
<link href="./cover.png" rel="icon" type="image/png">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "sidebar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "start",
"type": "textbox",
"limit": 20,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
"search-copy-link-title": "Copy link to search",
"search-hide-matches-text": "Hide additional matches",
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit"
}
}</script>
<link href="site_libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet">
<script src="site_libs/pagedtable-1.1/js/pagedtable.js"></script>
<meta name="twitter:title" content="hdPS and its machine learning extensions in residual confounding control - 33 Recoding cycle 10">
<meta name="twitter:description" content="Creating analytic dataset from 2017-18 cycle">
<meta name="twitter:card" content="summary">
</head>
<body class="nav-sidebar docked">
<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<div class="container-fluid d-flex justify-content-between">
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">33</span> <span class="chapter-title">Recoding cycle 10</span></h1>
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
<i class="bi bi-chevron-right"></i>
</button>
</div>
</nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
<nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">hdPS and its machine learning extensions in residual confounding control</a>
<div class="sidebar-tools-main">
<a href="https://github.com/ehsanx/" title="Source Code" class="sidebar-tool px-1"><i class="bi bi-github"></i></a>
<a href="" title="Share" id="sidebar-tool-dropdown-0" class="sidebar-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-share"></i></a>
<ul class="dropdown-menu" aria-labelledby="sidebar-tool-dropdown-0">
<li>
<a class="dropdown-item sidebar-tools-main-item" href="https://twitter.com/intent/tweet?url=|url|">
<i class="bi bi-bi-twitter pe-1"></i>
Twitter
</a>
</li>
<li>
<a class="dropdown-item sidebar-tools-main-item" href="https://www.facebook.com/sharer/sharer.php?u=|url|">
<i class="bi bi-bi-facebook pe-1"></i>
Facebook
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="mt-2 flex-shrink-0 align-items-center">
<div class="sidebar-search">
<div id="quarto-search" class="" title="Search"></div>
</div>
</div>
<div class="sidebar-menu-container">
<ul class="list-unstyled mt-1">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index.html" class="sidebar-item-text sidebar-link">Background</a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./motivating.html" class="sidebar-item-text sidebar-link">Motivating example</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./data.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">1</span> <span class="chapter-title">Data to Analyze</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./psipw.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span> <span class="chapter-title">Propensity score</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./proxy.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span> <span class="chapter-title">Reducing residual confounding</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./hdps.html" class="sidebar-item-text sidebar-link">High-dimensional Propensity score</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step1.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span> <span class="chapter-title">Step 1: Proxy sources</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span> <span class="chapter-title">Step 2: Empirical</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step3.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span> <span class="chapter-title">Step 3: Recurrence</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step4.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">7</span> <span class="chapter-title">Step 4: Prioritize</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step5.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">8</span> <span class="chapter-title">Step 5: Covariates</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step6.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">9</span> <span class="chapter-title">Step 6: Propensity</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./step7.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">10</span> <span class="chapter-title">Step 7: Association</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./sens.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">11</span> <span class="chapter-title">Sensitivity</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./extension.html" class="sidebar-item-text sidebar-link">Challenges</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./pubmed.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">12</span> <span class="chapter-title">Literature</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./mllogic.html" class="sidebar-item-text sidebar-link">Machine learning</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./mllasso.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">13</span> <span class="chapter-title">Pure ML</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./mlhybrid.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">14</span> <span class="chapter-title">Hybrid ML</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./sl.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">15</span> <span class="chapter-title">Ensemble</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./tmle.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">16</span> <span class="chapter-title">TMLE</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./stat.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">17</span> <span class="chapter-title">Statistical Approaches</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./mlcompare.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">18</span> <span class="chapter-title">Compare results</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./dctmle.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">19</span> <span class="chapter-title">DC-TMLE</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./deep.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">20</span> <span class="chapter-title">Deep Learning</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./extension2.html" class="sidebar-item-text sidebar-link">Extensions in Survival and Longitudinal Analyses</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./hddrs1.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">21</span> <span class="chapter-title">hdDRS with a binary outcome</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./survival.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">22</span> <span class="chapter-title">hdPS with a time-to-event outcome</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./hddrs2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">23</span> <span class="chapter-title">hdDRS with a survival outcome</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./survival2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">24</span> <span class="chapter-title">Application in MS</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./ncc.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">25</span> <span class="chapter-title">Time-dependent exposure</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./prediction.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">26</span> <span class="chapter-title">High-Dimensional Prediction Models</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./guideline.html" class="sidebar-item-text sidebar-link">Guideline</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./report.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">27</span> <span class="chapter-title">Reporting</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./references.html" class="sidebar-item-text sidebar-link">References</a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a href="./NHANES.html" class="sidebar-item-text sidebar-link">Appendix: NHANES</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index13.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">28</span> <span class="chapter-title">Download cycle 8</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index15.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">29</span> <span class="chapter-title">Download cycle 9</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index17.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">30</span> <span class="chapter-title">Download cycle 10</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./analytic13.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">31</span> <span class="chapter-title">Recoding cycle 8</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./analytic15.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">32</span> <span class="chapter-title">Recoding cycle 9</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./analytic17.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">33</span> <span class="chapter-title">Recoding cycle 10</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./merge13to17.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">34</span> <span class="chapter-title">Merge three cycles</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#load-downloaded-dataset" id="toc-load-downloaded-dataset" class="nav-link active" data-scroll-target="#load-downloaded-dataset"><span class="toc-section-number">33.1</span> Load downloaded dataset</a></li>
<li><a href="#recoding" id="toc-recoding" class="nav-link" data-scroll-target="#recoding"><span class="toc-section-number">33.2</span> Recoding</a>
<ul class="collapse">
<li><a href="#id" id="toc-id" class="nav-link" data-scroll-target="#id"><span class="toc-section-number">33.2.1</span> ID</a></li>
<li><a href="#demographic" id="toc-demographic" class="nav-link" data-scroll-target="#demographic"><span class="toc-section-number">33.2.2</span> Demographic</a></li>
<li><a href="#bmi" id="toc-bmi" class="nav-link" data-scroll-target="#bmi"><span class="toc-section-number">33.2.3</span> BMI</a></li>
<li><a href="#diabetes" id="toc-diabetes" class="nav-link" data-scroll-target="#diabetes"><span class="toc-section-number">33.2.4</span> Diabetes</a></li>
<li><a href="#family-history-of-diabetes" id="toc-family-history-of-diabetes" class="nav-link" data-scroll-target="#family-history-of-diabetes"><span class="toc-section-number">33.2.5</span> Family history of diabetes</a></li>
<li><a href="#smoking" id="toc-smoking" class="nav-link" data-scroll-target="#smoking"><span class="toc-section-number">33.2.6</span> Smoking</a></li>
<li><a href="#diet" id="toc-diet" class="nav-link" data-scroll-target="#diet"><span class="toc-section-number">33.2.7</span> Diet</a></li>
<li><a href="#vigorous-physical-activity" id="toc-vigorous-physical-activity" class="nav-link" data-scroll-target="#vigorous-physical-activity"><span class="toc-section-number">33.2.8</span> Vigorous physical activity</a></li>
<li><a href="#access-to-medical-services" id="toc-access-to-medical-services" class="nav-link" data-scroll-target="#access-to-medical-services"><span class="toc-section-number">33.2.9</span> Access to medical services</a></li>
<li><a href="#hypertensionhigh-blood-pressure" id="toc-hypertensionhigh-blood-pressure" class="nav-link" data-scroll-target="#hypertensionhigh-blood-pressure"><span class="toc-section-number">33.2.10</span> Hypertension/high blood pressure</a></li>
<li><a href="#sleep-daily-in-hours" id="toc-sleep-daily-in-hours" class="nav-link" data-scroll-target="#sleep-daily-in-hours"><span class="toc-section-number">33.2.11</span> Sleep (daily in hours)</a></li>
<li><a href="#laboratory-data" id="toc-laboratory-data" class="nav-link" data-scroll-target="#laboratory-data"><span class="toc-section-number">33.2.12</span> Laboratory data</a></li>
<li><a href="#survey-features" id="toc-survey-features" class="nav-link" data-scroll-target="#survey-features"><span class="toc-section-number">33.2.13</span> Survey features</a></li>
<li><a href="#survey-year" id="toc-survey-year" class="nav-link" data-scroll-target="#survey-year"><span class="toc-section-number">33.2.14</span> Survey year</a></li>
<li><a href="#icd-10-cm-codes" id="toc-icd-10-cm-codes" class="nav-link" data-scroll-target="#icd-10-cm-codes"><span class="toc-section-number">33.2.15</span> ICD-10-CM codes</a></li>
</ul></li>
<li><a href="#analytic-data" id="toc-analytic-data" class="nav-link" data-scroll-target="#analytic-data"><span class="toc-section-number">33.3</span> Analytic data</a>
<ul class="collapse">
<li><a href="#full-dataset" id="toc-full-dataset" class="nav-link" data-scroll-target="#full-dataset"><span class="toc-section-number">33.3.1</span> Full dataset</a></li>
<li><a href="#analytic-datset---adults-20-years-of-more" id="toc-analytic-datset---adults-20-years-of-more" class="nav-link" data-scroll-target="#analytic-datset---adults-20-years-of-more"><span class="toc-section-number">33.3.2</span> Analytic datset - adults 20 years of more</a></li>
<li><a href="#save-dataset-for-later-use" id="toc-save-dataset-for-later-use" class="nav-link" data-scroll-target="#save-dataset-for-later-use"><span class="toc-section-number">33.3.3</span> Save dataset for later use</a></li>
</ul></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/ehsanx/edit/main/analytic17.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
</div>
<!-- main -->
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title d-none d-lg-block"><span class="chapter-number">33</span> <span class="chapter-title">Recoding cycle 10</span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<p>Creating analytic dataset from 2017-18 cycle</p>
<section id="load-downloaded-dataset" class="level2" data-number="33.1">
<h2 data-number="33.1" class="anchored" data-anchor-id="load-downloaded-dataset"><span class="header-section-number">33.1</span> Load downloaded dataset</h2>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-1_f560f768372941359a729c9657556479">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">load</span>(<span class="at">file =</span> <span class="st">"data/analytic17.RData"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="recoding" class="level2" data-number="33.2">
<h2 data-number="33.2" class="anchored" data-anchor-id="recoding"><span class="header-section-number">33.2</span> Recoding</h2>
<section id="id" class="level3" data-number="33.2.1">
<h3 data-number="33.2.1" class="anchored" data-anchor-id="id"><span class="header-section-number">33.2.1</span> ID</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-2_2d0b097cfc61ca0a0a5b1874813a4e3e">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>dat2 <span class="ot"><-</span> nhanes17</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>id <span class="ot"><-</span> dat2<span class="sc">$</span>SEQN</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="demographic" class="level3" data-number="33.2.2">
<h3 data-number="33.2.2" class="anchored" data-anchor-id="demographic"><span class="header-section-number">33.2.2</span> Demographic</h3>
<section id="age" class="level4" data-number="33.2.2.1">
<h4 data-number="33.2.2.1" class="anchored" data-anchor-id="age"><span class="header-section-number">33.2.2.1</span> Age</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-3_43f87b738e95eee47fe93a7d62f5d940">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>age <span class="ot"><-</span> dat2<span class="sc">$</span>RIDAGEYR</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>age.cat <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>age, <span class="st">" 0:19 = '<20'; 20:49 = '20-49'; 50:64 = '50-64'; </span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 65:80 = '65+'; else = NA "</span>)</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>age.cat <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>age.cat, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"<20"</span>, <span class="st">"20-49"</span>, <span class="st">"50-64"</span>, <span class="st">"65+"</span>))</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>age.cat, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> <20 20-49 50-64 65+ <NA> </span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3685 2500 1569 1500 0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="sex" class="level4" data-number="33.2.2.2">
<h4 data-number="33.2.2.2" class="anchored" data-anchor-id="sex"><span class="header-section-number">33.2.2.2</span> Sex</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-4_221691a92ecf02a571d5c225723e4ca4">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>sex <span class="ot"><-</span> dat2<span class="sc">$</span>RIAGENDR</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>sex, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> Male Female <NA> </span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 4557 4697 0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="education" class="level4" data-number="33.2.2.3">
<h4 data-number="33.2.2.3" class="anchored" data-anchor-id="education"><span class="header-section-number">33.2.2.3</span> Education</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-5_1585293509a8b30dd8fdd824fc59d069">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>education <span class="ot"><-</span> dat2<span class="sc">$</span>DMDEDUC2</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>education <span class="ot"><-</span> <span class="fu">as.factor</span>(dat2<span class="sc">$</span>education)</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>education <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>education, <span class="at">recodes =</span> <span class="st">" c('College graduate or above') = </span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="st">'College graduate or above'; c('Some college or AA degree', 'High school graduate/GED or equi') = </span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="st">'High school'; c('Less than 9th grade', '9-11th grade (Includes 12th grad') = </span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="st">'Less than high school'; else = NA "</span>)</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>education <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>education, </span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"Less than high school"</span>, <span class="st">"High school"</span>, </span>
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> <span class="st">"College graduate or above"</span>))</span>
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>education, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> Less than high school High school College graduate or above </span></span>
<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a><span class="co">#> 479 1778 1336 </span></span>
<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a><span class="co">#> <NA> </span></span>
<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a><span class="co">#> 5661</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="raceethnicity" class="level4" data-number="33.2.2.4">
<h4 data-number="33.2.2.4" class="anchored" data-anchor-id="raceethnicity"><span class="header-section-number">33.2.2.4</span> Race/ethnicity</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-6_7e917c7febbc12a867746b693769b1f3">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>race <span class="ot"><-</span> dat2<span class="sc">$</span>RIDRETH1</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>race <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>race, <span class="at">recodes =</span> <span class="st">" 'Non-Hispanic White'='White';</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Non-Hispanic Black'='Black'; c('Mexican American',</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Other Hispanic')= 'Hispanic'; else='Others' "</span>)</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>race <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>race, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"White"</span>, <span class="st">"Black"</span>, <span class="st">"Hispanic"</span>, <span class="st">"Others"</span>))</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>race, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> White Black Hispanic Others <NA> </span></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3150 2115 2187 1802 0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="marital-status" class="level4" data-number="33.2.2.5">
<h4 data-number="33.2.2.5" class="anchored" data-anchor-id="marital-status"><span class="header-section-number">33.2.2.5</span> Marital status</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-7_47aba5b0ac28730e3b64a3619eff2a6b">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>marital <span class="ot"><-</span> dat2<span class="sc">$</span>DMDMARTL</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>marital <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>marital, <span class="at">recodes =</span> <span class="st">" 'Never married'='Never married';</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="st">c('Married', 'Living with partner') = 'Married/with partner'; </span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="st"> c('Widowed', 'Divorced', 'Separated')='Other'; else=NA "</span>)</span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>marital <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>marital, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"Never married"</span>, <span class="st">"Married/with partner"</span>,</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="st">"Other"</span>))</span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>marital, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> Never married Married/with partner Other </span></span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1006 3252 1305 </span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> <NA> </span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3691</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="income" class="level4" data-number="33.2.2.6">
<h4 data-number="33.2.2.6" class="anchored" data-anchor-id="income"><span class="header-section-number">33.2.2.6</span> Income</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-8_5248fb8f011870b1cc72078cf539a383">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>income <span class="ot"><-</span> dat2<span class="sc">$</span>INDHHIN2</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>income <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>income, <span class="at">recodes =</span> <span class="st">" c('$ 0 to $ 4,999', '$ 5,000 to $ 9,999',</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="st">'$10,000 to $14,999', '$15,000 to $19,999', 'Under $20,000')='less than $20,000';</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="st"> c('Over $20,000','$20,000 and Over', '$20,000 to $24,999', </span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a><span class="st"> '$25,000 to $34,999', '$35,000 to $44,999', '$45,000 to $54,999', </span></span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a><span class="st"> '$55,000 to $64,999', '$65,000 to $74,999')='$20,000 to $74,999';</span></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a><span class="st"> c('$75,000 to $99,999','$100,000 and Over')='$75,000 and Over'; </span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a><span class="st"> else=NA "</span>)</span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>income <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>income , <span class="at">levels=</span><span class="fu">c</span>(<span class="st">"less than $20,000"</span>, <span class="st">"$20,000 to $74,999"</span>, </span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a> <span class="st">"$75,000 and Over"</span>))</span>
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>income, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a><span class="co">#> less than $20,000 $20,000 to $74,999 $75,000 and Over <NA> </span></span>
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1589 4331 2453 881</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="where-born-citizenship" class="level4" data-number="33.2.2.7">
<h4 data-number="33.2.2.7" class="anchored" data-anchor-id="where-born-citizenship"><span class="header-section-number">33.2.2.7</span> Where born / citizenship</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-9_ffb78a4a74508635a231847bc89cb23a">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>born <span class="ot"><-</span> dat2<span class="sc">$</span>DMDBORN4</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>born <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>born, <span class="at">recodes =</span> <span class="st">" 'Others'='Other place';</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Born in 50 US states or Washington, DC'= 'Born in US'; else=NA"</span>)</span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>born <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>born, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"Born in US"</span>, <span class="st">"Other place"</span>))</span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>born, <span class="at">useNA =</span> <span class="st">"always"</span>) </span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Born in US Other place <NA> </span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 7303 1948 3</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="pregnancy" class="level4" data-number="33.2.2.8">
<h4 data-number="33.2.2.8" class="anchored" data-anchor-id="pregnancy"><span class="header-section-number">33.2.2.8</span> Pregnancy</h4>
<div class="cell">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>pregnancy <span class="ot"><-</span> dat2<span class="sc">$</span>RIDEXPRG</span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>pregnancy <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>pregnancy, </span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="at">recodes =</span> <span class="st">" 'Yes, positive lab pregnancy test' = 'Yes';</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="st"> 'The participant was not pregnant' = 'No'; </span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Cannot ascertain if the particip' = 'inconclusive';</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="st"> else= 'outside of target population' "</span>)</span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>pregnancy, <span class="at">useNA =</span> <span class="st">"always"</span>) </span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> outside of target population <NA> </span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> 9254 0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="bmi" class="level3" data-number="33.2.3">
<h3 data-number="33.2.3" class="anchored" data-anchor-id="bmi"><span class="header-section-number">33.2.3</span> BMI</h3>
<section id="bmi-and-obesity" class="level4" data-number="33.2.3.1">
<h4 data-number="33.2.3.1" class="anchored" data-anchor-id="bmi-and-obesity"><span class="header-section-number">33.2.3.1</span> BMI and Obesity</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-11_eb7a72e3a517adff03955fdcaa5207e5">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>bmi <span class="ot"><-</span> dat2<span class="sc">$</span>BMXBMI</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>bmi)</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 12.30 20.40 25.80 26.58 31.30 86.20 1249</span></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>obese <span class="ot"><-</span> <span class="fu">ifelse</span>(dat2<span class="sc">$</span>BMXBMI <span class="sc">>=</span> <span class="dv">30</span>, <span class="st">"Yes"</span>, <span class="st">"No"</span>)</span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>obese <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>obese, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"No"</span>, <span class="st">"Yes"</span>))</span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>obese, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> 5597 2408 1249</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="diabetes" class="level3" data-number="33.2.4">
<h3 data-number="33.2.4" class="anchored" data-anchor-id="diabetes"><span class="header-section-number">33.2.4</span> Diabetes</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-12_210310142fd6fe6164f2cff5e4d577dd">
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes <span class="ot"><-</span> dat2<span class="sc">$</span>DIQ010</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>diabetes, <span class="st">" 'Yes'='Yes'; c('No','Borderline')='No';</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="st"> else=NA "</span>)</span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Taking insulin now or diabetic pills to lower blood sugar - they have diabetes</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes[dat2<span class="sc">$</span>DIQ050 <span class="sc">==</span> <span class="st">"Yes"</span>] <span class="ot"><-</span> <span class="st">"Yes"</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes[dat2<span class="sc">$</span>DIQ070 <span class="sc">==</span> <span class="st">"Yes"</span>] <span class="ot"><-</span> <span class="st">"Yes"</span></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>diabetes, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> 7927 966 361</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="family-history-of-diabetes" class="level3" data-number="33.2.5">
<h3 data-number="33.2.5" class="anchored" data-anchor-id="family-history-of-diabetes"><span class="header-section-number">33.2.5</span> Family history of diabetes</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-13_56f4112b753ad73a319d99861324bc6e">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>DIQ175A, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Family history Don't know <NA> </span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1143 2 8109</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes.family.history <span class="ot"><-</span> dat2<span class="sc">$</span>DIQ175A</span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes.family.history <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>diabetes.family.history, <span class="st">" 'Family history' = 'Yes'; </span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a><span class="st"> else = 'No' "</span>)</span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes.family.history <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>diabetes.family.history, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"No"</span>, <span class="st">"Yes"</span>))</span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diabetes.family.history[dat2<span class="sc">$</span>DIQ175A<span class="sc">==</span><span class="st">"Don't know"</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>diabetes.family.history, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb13-13"><a href="#cb13-13" aria-hidden="true" tabindex="-1"></a><span class="co">#> 8109 1143 2</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="smoking" class="level3" data-number="33.2.6">
<h3 data-number="33.2.6" class="anchored" data-anchor-id="smoking"><span class="header-section-number">33.2.6</span> Smoking</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-14_d32a30ff019a347375df7e92b4503db7">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>smoking <span class="ot"><-</span> dat2<span class="sc">$</span>SMQ020</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>smoking <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>smoking, <span class="st">" 'Yes' = 'Current smoker'; 'No' = 'Never smoker'; else=NA "</span>)</span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>smoking <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>smoking, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"Never smoker"</span>, <span class="st">"Previous smoker"</span>, <span class="st">"Current smoker"</span>))</span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>smoking[dat2<span class="sc">$</span>SMQ040 <span class="sc">==</span> <span class="st">"Not at all"</span>] <span class="ot"><-</span> <span class="st">"Previous smoker"</span></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>smoking, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Never smoker Previous smoker Current smoker <NA> </span></span>
<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3497 1338 1021 3398</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="diet" class="level3" data-number="33.2.7">
<h3 data-number="33.2.7" class="anchored" data-anchor-id="diet"><span class="header-section-number">33.2.7</span> Diet</h3>
<section id="how-healthy-is-the-diet" class="level4" data-number="33.2.7.1">
<h4 data-number="33.2.7.1" class="anchored" data-anchor-id="how-healthy-is-the-diet"><span class="header-section-number">33.2.7.1</span> How healthy is the diet</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-15_f94fcbc4f30306800a4f2bc15d7ebb2a">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diet.healthy <span class="ot"><-</span> dat2<span class="sc">$</span>DBQ700</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diet.healthy <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>diet.healthy, <span class="at">recodes =</span> <span class="st">" c('Excellent', 'Very good')=</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Very good or excellent'; 'Good'='Good'; c('Fair', 'Poor')=</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Poor or fair'; else = NA "</span>)</span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diet.healthy <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>diet.healthy, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"Poor or fair"</span>, <span class="st">"Good"</span>, </span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a> <span class="st">"Very good or excellent"</span>))</span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>diet.healthy, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb15-9"><a href="#cb15-9" aria-hidden="true" tabindex="-1"></a><span class="co">#> Poor or fair Good Very good or excellent </span></span>
<span id="cb15-10"><a href="#cb15-10" aria-hidden="true" tabindex="-1"></a><span class="co">#> 2036 2411 1712 </span></span>
<span id="cb15-11"><a href="#cb15-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> <NA> </span></span>
<span id="cb15-12"><a href="#cb15-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> 3095</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="vigorous-physical-activity" class="level3" data-number="33.2.8">
<h3 data-number="33.2.8" class="anchored" data-anchor-id="vigorous-physical-activity"><span class="header-section-number">33.2.8</span> Vigorous physical activity</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-16_86ce8511e29008c2ab7f91207e77d9f9">
<div class="sourceCode cell-code" id="cb16"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>physical.activity <span class="ot"><-</span> dat2<span class="sc">$</span>PAQ605</span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>physical.activity <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>physical.activity, <span class="at">recodes =</span> <span class="st">" 'No' = 'No'; </span></span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'Yes' = 'Yes'; else=NA"</span>)</span>
<span id="cb16-4"><a href="#cb16-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>physical.activity <span class="ot"><-</span> <span class="fu">factor</span>(dat2<span class="sc">$</span>physical.activity, <span class="at">levels =</span> <span class="fu">c</span>(<span class="st">"No"</span>, <span class="st">"Yes"</span>))</span>
<span id="cb16-5"><a href="#cb16-5" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>physical.activity, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb16-6"><a href="#cb16-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb16-7"><a href="#cb16-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb16-8"><a href="#cb16-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 4461 1389 3404</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="access-to-medical-services" class="level3" data-number="33.2.9">
<h3 data-number="33.2.9" class="anchored" data-anchor-id="access-to-medical-services"><span class="header-section-number">33.2.9</span> Access to medical services</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-17_b2a85491105abf2e1e4eb3b4f450235e">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>medical.access <span class="ot"><-</span> dat2<span class="sc">$</span>HUQ030</span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>medical.access <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>medical.access, <span class="at">recodes =</span> <span class="st">" c('Yes',</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'There is more than one place')='Yes'; 'There is no place'=</span></span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a><span class="st"> 'No'; else=NA"</span>)</span>
<span id="cb17-5"><a href="#cb17-5" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>medical.access, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb17-6"><a href="#cb17-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb17-7"><a href="#cb17-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb17-8"><a href="#cb17-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1398 7854 2</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="hypertensionhigh-blood-pressure" class="level3" data-number="33.2.10">
<h3 data-number="33.2.10" class="anchored" data-anchor-id="hypertensionhigh-blood-pressure"><span class="header-section-number">33.2.10</span> Hypertension/high blood pressure</h3>
<section id="systolic-bp" class="level4" data-number="33.2.10.1">
<h4 data-number="33.2.10.1" class="anchored" data-anchor-id="systolic-bp"><span class="header-section-number">33.2.10.1</span> Systolic BP</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-18_4859229cf77cbf192f4fc703c3e49e97">
<div class="sourceCode cell-code" id="cb18"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>systolic1 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXSY1</span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>systolic2 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXSY2</span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>systolic3 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXSY3</span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>systolic4 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXSY4</span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-6"><a href="#cb18-6" aria-hidden="true" tabindex="-1"></a>dat2 <span class="ot"><-</span> dat2 <span class="sc">%>%</span> </span>
<span id="cb18-7"><a href="#cb18-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">systolicBP =</span> <span class="fu">rowMeans</span>(dat2[, <span class="fu">c</span>(<span class="st">"systolic1"</span>, <span class="st">"systolic2"</span>, </span>
<span id="cb18-8"><a href="#cb18-8" aria-hidden="true" tabindex="-1"></a> <span class="st">"systolic3"</span>, <span class="st">"systolic4"</span>)], </span>
<span id="cb18-9"><a href="#cb18-9" aria-hidden="true" tabindex="-1"></a> <span class="at">na.rm =</span> <span class="cn">TRUE</span>))</span>
<span id="cb18-10"><a href="#cb18-10" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>systolicBP)</span>
<span id="cb18-11"><a href="#cb18-11" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb18-12"><a href="#cb18-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> 72.67 106.67 118.00 121.68 132.67 238.00 2537</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="diastolic-bp" class="level4" data-number="33.2.10.2">
<h4 data-number="33.2.10.2" class="anchored" data-anchor-id="diastolic-bp"><span class="header-section-number">33.2.10.2</span> Diastolic BP</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-19_3cc6d2407fb281cab5063edd10790c6f">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diastolic1 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXDI1</span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diastolic2 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXDI2</span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diastolic3 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXDI3</span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diastolic4 <span class="ot"><-</span> dat2<span class="sc">$</span>BPXDI4</span>
<span id="cb19-5"><a href="#cb19-5" aria-hidden="true" tabindex="-1"></a>datX <span class="ot"><-</span> dat2[, <span class="fu">c</span>(<span class="st">"diastolic1"</span>, <span class="st">"diastolic2"</span>, </span>
<span id="cb19-6"><a href="#cb19-6" aria-hidden="true" tabindex="-1"></a> <span class="st">"diastolic3"</span>, <span class="st">"diastolic4"</span>)]</span>
<span id="cb19-7"><a href="#cb19-7" aria-hidden="true" tabindex="-1"></a>datX[datX <span class="sc">==</span><span class="dv">0</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb19-8"><a href="#cb19-8" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>diastolicBP <span class="ot"><-</span> <span class="fu">rowMeans</span>(datX[, <span class="fu">c</span>(<span class="st">"diastolic1"</span>, <span class="st">"diastolic2"</span>, </span>
<span id="cb19-9"><a href="#cb19-9" aria-hidden="true" tabindex="-1"></a> <span class="st">"diastolic3"</span>, <span class="st">"diastolic4"</span>)], </span>
<span id="cb19-10"><a href="#cb19-10" aria-hidden="true" tabindex="-1"></a> <span class="at">na.rm =</span> <span class="cn">TRUE</span>)</span>
<span id="cb19-11"><a href="#cb19-11" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>diastolicBP)</span>
<span id="cb19-12"><a href="#cb19-12" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb19-13"><a href="#cb19-13" aria-hidden="true" tabindex="-1"></a><span class="co">#> 8.00 61.33 70.00 69.54 77.33 135.33 2618</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="sleep-daily-in-hours" class="level3" data-number="33.2.11">
<h3 data-number="33.2.11" class="anchored" data-anchor-id="sleep-daily-in-hours"><span class="header-section-number">33.2.11</span> Sleep (daily in hours)</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-20_527e3c6665438db7792f0746a9f9196d">
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>sleep <span class="ot"><-</span> dat2<span class="sc">$</span>SLD012</span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>sleep)</span>
<span id="cb20-3"><a href="#cb20-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 2.000 7.000 8.000 7.659 8.500 14.000 3141</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="laboratory-data" class="level3" data-number="33.2.12">
<h3 data-number="33.2.12" class="anchored" data-anchor-id="laboratory-data"><span class="header-section-number">33.2.12</span> Laboratory data</h3>
<section id="uric-acid-mgdl" class="level4" data-number="33.2.12.1">
<h4 data-number="33.2.12.1" class="anchored" data-anchor-id="uric-acid-mgdl"><span class="header-section-number">33.2.12.1</span> Uric acid (mg/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-21_72be7fbaf64ed3d26c2c65120967c254">
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>uric.acid <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSUA</span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>uric.acid)</span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 0.800 4.300 5.300 5.402 6.300 15.100 3353</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="total-protein-gdl" class="level4" data-number="33.2.12.2">
<h4 data-number="33.2.12.2" class="anchored" data-anchor-id="total-protein-gdl"><span class="header-section-number">33.2.12.2</span> Total protein (g/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-22_a150316e7c6fa6c98cafc30cc0be9d28">
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>protein.total <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSTP</span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>protein.total)</span>
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 5.300 6.900 7.200 7.166 7.400 10.000 3353</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="total-bilirubin-mgdl" class="level4" data-number="33.2.12.3">
<h4 data-number="33.2.12.3" class="anchored" data-anchor-id="total-bilirubin-mgdl"><span class="header-section-number">33.2.12.3</span> Total bilirubin (mg/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-23_2402b74e543da4f9f049922cca968507">
<div class="sourceCode cell-code" id="cb23"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>bilirubin.total <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSTB</span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>bilirubin.total)</span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 0.10 0.30 0.40 0.46 0.60 3.70 3351</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="phosphorus-mgdl" class="level4" data-number="33.2.12.4">
<h4 data-number="33.2.12.4" class="anchored" data-anchor-id="phosphorus-mgdl"><span class="header-section-number">33.2.12.4</span> Phosphorus (mg/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-24_1d91c949a41d23790f02a9d1ae833b14">
<div class="sourceCode cell-code" id="cb24"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>phosphorus <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSPH</span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>phosphorus)</span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1.900 3.300 3.600 3.665 4.000 9.600 3353</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="sodium-mmoll" class="level4" data-number="33.2.12.5">
<h4 data-number="33.2.12.5" class="anchored" data-anchor-id="sodium-mmoll"><span class="header-section-number">33.2.12.5</span> Sodium (mmol/L)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-25_2ad352afe05e394f711f321f697339d8">
<div class="sourceCode cell-code" id="cb25"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>sodium <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSNASI</span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>sodium)</span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 121.0 138.0 140.0 140.3 142.0 151.0 3350</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="potassium-mmoll" class="level4" data-number="33.2.12.6">
<h4 data-number="33.2.12.6" class="anchored" data-anchor-id="potassium-mmoll"><span class="header-section-number">33.2.12.6</span> Potassium (mmol/L)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-26_0828bfa3823134fa040729f08e343950">
<div class="sourceCode cell-code" id="cb26"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>potassium <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSKSI</span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>potassium)</span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 2.800 3.900 4.100 4.094 4.300 6.600 3355</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="globulin-gdl" class="level4" data-number="33.2.12.7">
<h4 data-number="33.2.12.7" class="anchored" data-anchor-id="globulin-gdl"><span class="header-section-number">33.2.12.7</span> Globulin (g/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-27_da3566e4d9669fe86435531a32cb3d6e">
<div class="sourceCode cell-code" id="cb27"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>globulin <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSGB</span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>globulin)</span>
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb27-4"><a href="#cb27-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1.800 2.800 3.100 3.087 3.300 6.000 3353</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="total-calcium-mgdl" class="level4" data-number="33.2.12.8">
<h4 data-number="33.2.12.8" class="anchored" data-anchor-id="total-calcium-mgdl"><span class="header-section-number">33.2.12.8</span> Total calcium (mg/dL)</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-28_7731c5b2cb97da351915ee0b33d05543">
<div class="sourceCode cell-code" id="cb28"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>calcium.total <span class="ot"><-</span> dat2<span class="sc">$</span>LBXSCA</span>
<span id="cb28-2"><a href="#cb28-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>calcium.total)</span>
<span id="cb28-3"><a href="#cb28-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. NA's </span></span>
<span id="cb28-4"><a href="#cb28-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 6.40 9.10 9.30 9.32 9.60 11.70 3353</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="high-cholesterol" class="level4" data-number="33.2.12.9">
<h4 data-number="33.2.12.9" class="anchored" data-anchor-id="high-cholesterol"><span class="header-section-number">33.2.12.9</span> High cholesterol</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-29_67d1ca63df3ab0581e1276536dfa64a3">
<div class="sourceCode cell-code" id="cb29"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>high.cholesterol <span class="ot"><-</span> dat2<span class="sc">$</span>BPQ080</span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>high.cholesterol <span class="ot"><-</span> car<span class="sc">::</span><span class="fu">recode</span>(dat2<span class="sc">$</span>high.cholesterol, <span class="at">recodes =</span> <span class="st">" 'Yes'='Yes';</span></span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 'No'='No'; else = NA"</span>)</span>
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>high.cholesterol, <span class="at">useNA =</span> <span class="st">"always"</span>)</span>
<span id="cb29-5"><a href="#cb29-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb29-6"><a href="#cb29-6" aria-hidden="true" tabindex="-1"></a><span class="co">#> No Yes <NA> </span></span>
<span id="cb29-7"><a href="#cb29-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> 4153 1968 3133</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="survey-features" class="level3" data-number="33.2.13">
<h3 data-number="33.2.13" class="anchored" data-anchor-id="survey-features"><span class="header-section-number">33.2.13</span> Survey features</h3>
<section id="weight" class="level4" data-number="33.2.13.1">
<h4 data-number="33.2.13.1" class="anchored" data-anchor-id="weight"><span class="header-section-number">33.2.13.1</span> Weight</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-30_5c12b27d53889671d7d16903d5ede07d">
<div class="sourceCode cell-code" id="cb30"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>survey.weight <span class="ot"><-</span> dat2<span class="sc">$</span>WTINT2YR</span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>survey.weight)</span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. </span></span>
<span id="cb30-4"><a href="#cb30-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 2571 13074 21099 34671 36923 433085</span></span>
<span id="cb30-5"><a href="#cb30-5" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>survey.weight.mec <span class="ot"><-</span> dat2<span class="sc">$</span>WTMEC2YR</span>
<span id="cb30-6"><a href="#cb30-6" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(dat2<span class="sc">$</span>survey.weight.mec)</span>
<span id="cb30-7"><a href="#cb30-7" aria-hidden="true" tabindex="-1"></a><span class="co">#> Min. 1st Qu. Median Mean 3rd Qu. Max. </span></span>
<span id="cb30-8"><a href="#cb30-8" aria-hidden="true" tabindex="-1"></a><span class="co">#> 0 12347 21060 34671 37562 419763</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="psu" class="level4" data-number="33.2.13.2">
<h4 data-number="33.2.13.2" class="anchored" data-anchor-id="psu"><span class="header-section-number">33.2.13.2</span> PSU</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-31_fb897861460f3d12cd6d42c112f02320">
<div class="sourceCode cell-code" id="cb31"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>psu <span class="ot"><-</span> <span class="fu">as.factor</span>(dat2<span class="sc">$</span>SDMVPSU)</span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>psu)</span>
<span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb31-4"><a href="#cb31-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 1 2 </span></span>
<span id="cb31-5"><a href="#cb31-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 4464 4790</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="strata" class="level4" data-number="33.2.13.3">
<h4 data-number="33.2.13.3" class="anchored" data-anchor-id="strata"><span class="header-section-number">33.2.13.3</span> Strata</h4>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-32_112ceff1f47555161591a59f2f9f0b94">
<div class="sourceCode cell-code" id="cb32"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>strata <span class="ot"><-</span> <span class="fu">as.factor</span>(dat2<span class="sc">$</span>SDMVSTRA)</span>
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>strata)</span>
<span id="cb32-3"><a href="#cb32-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb32-4"><a href="#cb32-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 </span></span>
<span id="cb32-5"><a href="#cb32-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 510 638 695 554 605 653 612 693 735 551 689 609 604 596 510</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="survey-year" class="level3" data-number="33.2.14">
<h3 data-number="33.2.14" class="anchored" data-anchor-id="survey-year"><span class="header-section-number">33.2.14</span> Survey year</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-33_e7d99ccab958d6072d9d67862dfa5cc4">
<div class="sourceCode cell-code" id="cb33"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a>dat2<span class="sc">$</span>year <span class="ot"><-</span> dat2<span class="sc">$</span>SDDSRVYR</span>
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a><span class="fu">table</span>(dat2<span class="sc">$</span>year, <span class="at">useNA =</span> <span class="st">"always"</span>) </span>
<span id="cb33-3"><a href="#cb33-3" aria-hidden="true" tabindex="-1"></a><span class="co">#> </span></span>
<span id="cb33-4"><a href="#cb33-4" aria-hidden="true" tabindex="-1"></a><span class="co">#> NHANES 2017-2018 public release <NA> </span></span>
<span id="cb33-5"><a href="#cb33-5" aria-hidden="true" tabindex="-1"></a><span class="co">#> 9254 0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="icd-10-cm-codes" class="level3" data-number="33.2.15">
<h3 data-number="33.2.15" class="anchored" data-anchor-id="icd-10-cm-codes"><span class="header-section-number">33.2.15</span> ICD-10-CM codes</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-34_6f69cc5bd8aac5cdd5280760a8e686cd">
<div class="sourceCode cell-code" id="cb34"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(rxq12) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"id"</span>, <span class="st">"icd10"</span>)</span>
<span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(rxq22) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"id"</span>, <span class="st">"icd10"</span>)</span>
<span id="cb34-3"><a href="#cb34-3" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(rxq32) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"id"</span>, <span class="st">"icd10"</span>)</span>
<span id="cb34-4"><a href="#cb34-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb34-5"><a href="#cb34-5" aria-hidden="true" tabindex="-1"></a>rx2017 <span class="ot"><-</span> <span class="fu">rbind</span>(rxq12, rxq22, rxq32)</span>
<span id="cb34-6"><a href="#cb34-6" aria-hidden="true" tabindex="-1"></a>rx2017 <span class="ot"><-</span> rx2017[<span class="fu">order</span>(rx2017<span class="sc">$</span>id),]</span>
<span id="cb34-7"><a href="#cb34-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb34-8"><a href="#cb34-8" aria-hidden="true" tabindex="-1"></a>rx2017<span class="sc">$</span>icd10[rx2017<span class="sc">$</span>icd10 <span class="sc">==</span> <span class="st">"Unknown"</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb34-9"><a href="#cb34-9" aria-hidden="true" tabindex="-1"></a>rx2017<span class="sc">$</span>icd10[rx2017<span class="sc">$</span>icd10 <span class="sc">==</span> <span class="st">"Refused"</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb34-10"><a href="#cb34-10" aria-hidden="true" tabindex="-1"></a>rx2017<span class="sc">$</span>icd10[rx2017<span class="sc">$</span>icd10 <span class="sc">==</span> <span class="st">"Don't know"</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb34-11"><a href="#cb34-11" aria-hidden="true" tabindex="-1"></a>rx2017<span class="sc">$</span>icd10[rx2017<span class="sc">$</span>icd10 <span class="sc">==</span> <span class="st">""</span>] <span class="ot"><-</span> <span class="cn">NA</span></span>
<span id="cb34-12"><a href="#cb34-12" aria-hidden="true" tabindex="-1"></a>rx2017<span class="sc">$</span>icd10.new <span class="ot"><-</span> <span class="fu">substr</span>(rx2017<span class="sc">$</span>icd10, <span class="at">start =</span> <span class="dv">1</span>, <span class="at">stop =</span> <span class="dv">3</span>)</span>
<span id="cb34-13"><a href="#cb34-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb34-14"><a href="#cb34-14" aria-hidden="true" tabindex="-1"></a>rx2017 <span class="ot"><-</span> <span class="fu">na.omit</span>(rx2017)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="analytic-data" class="level2" data-number="33.3">
<h2 data-number="33.3" class="anchored" data-anchor-id="analytic-data"><span class="header-section-number">33.3</span> Analytic data</h2>
<section id="full-dataset" class="level3" data-number="33.3.1">
<h3 data-number="33.3.1" class="anchored" data-anchor-id="full-dataset"><span class="header-section-number">33.3.1</span> Full dataset</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-35_624e0cc991aa3904533e9cf6ea09f2b9">
<div class="sourceCode cell-code" id="cb35"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>nhanes17r <span class="ot"><-</span> dat2</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="analytic-datset---adults-20-years-of-more" class="level3" data-number="33.3.2">
<h3 data-number="33.3.2" class="anchored" data-anchor-id="analytic-datset---adults-20-years-of-more"><span class="header-section-number">33.3.2</span> Analytic datset - adults 20 years of more</h3>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-36_180f0d944f15a2d58677a9868629d284">
<div class="sourceCode cell-code" id="cb36"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1"><a href="#cb36-1" aria-hidden="true" tabindex="-1"></a>vars <span class="ot"><-</span> <span class="fu">c</span>(</span>
<span id="cb36-2"><a href="#cb36-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># ID</span></span>
<span id="cb36-3"><a href="#cb36-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"id"</span>,</span>
<span id="cb36-4"><a href="#cb36-4" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-5"><a href="#cb36-5" aria-hidden="true" tabindex="-1"></a> <span class="co"># Demographic</span></span>
<span id="cb36-6"><a href="#cb36-6" aria-hidden="true" tabindex="-1"></a> <span class="st">"age"</span>, <span class="st">"age.cat"</span>, <span class="st">"sex"</span>, <span class="st">"education"</span>, <span class="st">"race"</span>, </span>
<span id="cb36-7"><a href="#cb36-7" aria-hidden="true" tabindex="-1"></a> <span class="st">"marital"</span>, <span class="st">"income"</span>, <span class="st">"born"</span>, <span class="st">"pregnancy"</span>,</span>
<span id="cb36-8"><a href="#cb36-8" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-9"><a href="#cb36-9" aria-hidden="true" tabindex="-1"></a> <span class="co"># obesity</span></span>
<span id="cb36-10"><a href="#cb36-10" aria-hidden="true" tabindex="-1"></a> <span class="st">"obese"</span>, </span>
<span id="cb36-11"><a href="#cb36-11" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-12"><a href="#cb36-12" aria-hidden="true" tabindex="-1"></a> <span class="co"># Diabetes</span></span>
<span id="cb36-13"><a href="#cb36-13" aria-hidden="true" tabindex="-1"></a> <span class="st">"diabetes"</span>, <span class="st">"diabetes.family.history"</span>,</span>
<span id="cb36-14"><a href="#cb36-14" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-15"><a href="#cb36-15" aria-hidden="true" tabindex="-1"></a> <span class="co"># Smoking</span></span>
<span id="cb36-16"><a href="#cb36-16" aria-hidden="true" tabindex="-1"></a> <span class="st">"smoking"</span>, </span>
<span id="cb36-17"><a href="#cb36-17" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-18"><a href="#cb36-18" aria-hidden="true" tabindex="-1"></a> <span class="co"># Diet</span></span>
<span id="cb36-19"><a href="#cb36-19" aria-hidden="true" tabindex="-1"></a> <span class="st">"diet.healthy"</span>, </span>
<span id="cb36-20"><a href="#cb36-20" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb36-21"><a href="#cb36-21" aria-hidden="true" tabindex="-1"></a> <span class="co"># Physical activity</span></span>
<span id="cb36-22"><a href="#cb36-22" aria-hidden="true" tabindex="-1"></a> <span class="st">"physical.activity"</span>, </span>
<span id="cb36-23"><a href="#cb36-23" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-24"><a href="#cb36-24" aria-hidden="true" tabindex="-1"></a> <span class="co"># Access to routine healthcare</span></span>
<span id="cb36-25"><a href="#cb36-25" aria-hidden="true" tabindex="-1"></a> <span class="st">"medical.access"</span>,</span>
<span id="cb36-26"><a href="#cb36-26" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-27"><a href="#cb36-27" aria-hidden="true" tabindex="-1"></a> <span class="co"># Blood pressure and Hypertension</span></span>
<span id="cb36-28"><a href="#cb36-28" aria-hidden="true" tabindex="-1"></a> <span class="st">"systolicBP"</span>, <span class="st">"diastolicBP"</span>, </span>
<span id="cb36-29"><a href="#cb36-29" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-30"><a href="#cb36-30" aria-hidden="true" tabindex="-1"></a> <span class="co"># Sleep </span></span>
<span id="cb36-31"><a href="#cb36-31" aria-hidden="true" tabindex="-1"></a> <span class="st">"sleep"</span>,</span>
<span id="cb36-32"><a href="#cb36-32" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb36-33"><a href="#cb36-33" aria-hidden="true" tabindex="-1"></a> <span class="co"># Laboratory </span></span>
<span id="cb36-34"><a href="#cb36-34" aria-hidden="true" tabindex="-1"></a> <span class="st">"uric.acid"</span>, <span class="st">"protein.total"</span>, <span class="st">"bilirubin.total"</span>, <span class="st">"phosphorus"</span>,</span>
<span id="cb36-35"><a href="#cb36-35" aria-hidden="true" tabindex="-1"></a> <span class="st">"sodium"</span>, <span class="st">"potassium"</span>, <span class="st">"globulin"</span>, <span class="st">"calcium.total"</span>, </span>
<span id="cb36-36"><a href="#cb36-36" aria-hidden="true" tabindex="-1"></a> <span class="st">"high.cholesterol"</span>,</span>
<span id="cb36-37"><a href="#cb36-37" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-38"><a href="#cb36-38" aria-hidden="true" tabindex="-1"></a> <span class="co"># Survey features</span></span>
<span id="cb36-39"><a href="#cb36-39" aria-hidden="true" tabindex="-1"></a> <span class="st">"survey.weight"</span>, <span class="st">"survey.weight.mec"</span>, <span class="st">"psu"</span>, <span class="st">"strata"</span>, </span>
<span id="cb36-40"><a href="#cb36-40" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb36-41"><a href="#cb36-41" aria-hidden="true" tabindex="-1"></a> <span class="co"># Survey year</span></span>
<span id="cb36-42"><a href="#cb36-42" aria-hidden="true" tabindex="-1"></a> <span class="st">"year"</span></span>
<span id="cb36-43"><a href="#cb36-43" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb36-44"><a href="#cb36-44" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb36-45"><a href="#cb36-45" aria-hidden="true" tabindex="-1"></a>nhanes17r.sel <span class="ot"><-</span> nhanes17r[, vars]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell" data-hash="analytic17_cache/html/unnamed-chunk-37_f460d86e45c192373a12b8e57f94f51e">
<div class="sourceCode cell-code" id="cb37"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Adults 20 years of more and not pregnant</span></span>