-
Notifications
You must be signed in to change notification settings - Fork 0
/
sup_mat_COVID-19-vaccines-confer-protection-in-hospitalized-pregnant-and-postpartum-women-with-severe-COVID-19.tex
3324 lines (2926 loc) · 158 KB
/
sup_mat_COVID-19-vaccines-confer-protection-in-hospitalized-pregnant-and-postpartum-women-with-severe-COVID-19.tex
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
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={Documentation of the article `COVID-19 vaccines confer protection in hospitalized pregnant and postpartum women with severe COVID-19'},
pdfauthor={Codes and outputs},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=1in]{geometry}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage{float}
\renewcommand{\contentsname}{Sumário}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
\ifluatex
\usepackage{selnolig} % disable illegal ligatures
\fi
\title{Documentation of the article `COVID-19 vaccines confer protection
in hospitalized pregnant and postpartum women with severe COVID-19'}
\author{Codes and outputs}
\date{Feb 10, 2022}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{1}
\tableofcontents
}
\newpage
\hypertarget{description}{%
\section{Description}\label{description}}
This file presents the documentation of the analysis of article
``COVID-19 vaccines confer protection in hospitalized pregnant and
postpartum women with severe COVID-19''.
\hypertarget{about-the-database-and-r-packages-used}{%
\section{About the database and R packages
used}\label{about-the-database-and-r-packages-used}}
The data are analyzed using the free-software R
(\url{https://www.R-project.org}) in version 4.0.3. Next, we present and
load the libraries used in the data analysis process.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#load packages}
\NormalTok{loadlibrary }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x) \{}
\ControlFlowTok{if}\NormalTok{ (}\SpecialCharTok{!}\FunctionTok{require}\NormalTok{(x, }\AttributeTok{character.only =} \ConstantTok{TRUE}\NormalTok{)) \{}
\FunctionTok{install.packages}\NormalTok{(x, }\AttributeTok{dependencies =}\NormalTok{ T)}
\ControlFlowTok{if}\NormalTok{ (}\SpecialCharTok{!}\FunctionTok{require}\NormalTok{(x, }\AttributeTok{character.only =} \ConstantTok{TRUE}\NormalTok{))}
\FunctionTok{stop}\NormalTok{(}\StringTok{"Package not found"}\NormalTok{)}
\NormalTok{ \}}
\NormalTok{\}}
\NormalTok{packages }\OtherTok{\textless{}{-}}
\FunctionTok{c}\NormalTok{(}
\StringTok{"readr"}\NormalTok{,}
\StringTok{"readxl"}\NormalTok{,}
\StringTok{"janitor"}\NormalTok{,}
\StringTok{"dplyr"}\NormalTok{,}
\StringTok{"forcats"}\NormalTok{,}
\StringTok{"stringr"}\NormalTok{,}
\StringTok{"lubridate"}\NormalTok{,}
\StringTok{"summarytools"}\NormalTok{,}
\StringTok{"magrittr"}\NormalTok{,}
\StringTok{"questionr"}\NormalTok{, }
\StringTok{"knitr"}\NormalTok{,}
\StringTok{"data.table"}\NormalTok{,}
\StringTok{"modelsummary"}\NormalTok{, }
\StringTok{"kableExtra"}\NormalTok{, }
\StringTok{"DescTools"}\NormalTok{, }
\StringTok{"effectsize"}\NormalTok{,}
\StringTok{"WeightIt"}\NormalTok{,}
\StringTok{"MatchIt"}\NormalTok{,}
\StringTok{"ggplot2"}\NormalTok{,}
\StringTok{"ggpubr"}\NormalTok{, }
\StringTok{"naniar"}\NormalTok{,}
\StringTok{"mice"}\NormalTok{,}
\StringTok{"miceafter"}\NormalTok{, }
\StringTok{"VIM"}\NormalTok{,}
\StringTok{"miceadds"}
\NormalTok{ )}
\FunctionTok{lapply}\NormalTok{(packages, loadlibrary)}
\end{Highlighting}
\end{Shaded}
One can see below the functions that will be used in the data analysis.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#functions for summary measures}
\NormalTok{media }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\FunctionTok{mean}\NormalTok{(x, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{mediana }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\FunctionTok{median}\NormalTok{(x, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{DP }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\FunctionTok{sd}\NormalTok{(x, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{minimo }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\NormalTok{ base}\SpecialCharTok{::}\FunctionTok{min}\NormalTok{(x, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{maximo }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\NormalTok{ base}\SpecialCharTok{::}\FunctionTok{max}\NormalTok{(x, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{q25 }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\NormalTok{ stats}\SpecialCharTok{::}\FunctionTok{quantile}\NormalTok{(x, }\AttributeTok{p =} \FloatTok{0.25}\NormalTok{, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{q75 }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\NormalTok{ stats}\SpecialCharTok{::}\FunctionTok{quantile}\NormalTok{(x, }\AttributeTok{p =} \FloatTok{0.75}\NormalTok{, }\AttributeTok{na.rm =} \ConstantTok{TRUE}\NormalTok{)}
\NormalTok{IQR }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\FunctionTok{round}\NormalTok{(}\FunctionTok{q75}\NormalTok{(x) }\SpecialCharTok{{-}} \FunctionTok{q25}\NormalTok{(x), }\DecValTok{2}\NormalTok{)}
\NormalTok{n }\OtherTok{\textless{}{-}} \ControlFlowTok{function}\NormalTok{(x)}
\FunctionTok{sum}\NormalTok{(}\SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(x))}
\end{Highlighting}
\end{Shaded}
This is a retrospective cohort study using the data from the Influenza
Epidemiological Surveillance Information System, SIVEP-Gripe (Sistema de
Informação de Vigilância Epidemiológica da Gripe) database.
The SIVEP-Gripe is a nationwide surveillance database created to monitor
severe acute respiratory infections and data on virus circulation and
respiratory infections in Brazil.
The period analyzed comprises epidemiological data from 2021, with a
database obtained on December 2, 2021 on the website
\url{https://opendatasus.saude.gov.br}. The dataset can be obtained at
\url{https://www.kaggle.com/agatharodrigues/covid19-vaccine-maternal-population}.
It is loaded below:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#loading the datasets}
\CommentTok{\#2021}
\NormalTok{dados }\OtherTok{\textless{}{-}} \FunctionTok{read\_delim}\NormalTok{(}
\StringTok{"INFLUD21{-}29{-}11{-}2021.csv"}\NormalTok{,}
\StringTok{";"}\NormalTok{,}
\AttributeTok{escape\_double =} \ConstantTok{FALSE}\NormalTok{,}
\AttributeTok{locale =} \FunctionTok{locale}\NormalTok{(}\AttributeTok{encoding =} \StringTok{"ISO{-}8859{-}2"}\NormalTok{),}
\AttributeTok{trim\_ws =} \ConstantTok{TRUE}
\NormalTok{)}
\CommentTok{\#Create case year variable}
\NormalTok{dados }\OtherTok{\textless{}{-}}\NormalTok{ dados }\SpecialCharTok{\%\textgreater{}\%}
\NormalTok{ dplyr}\SpecialCharTok{::}\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{dt\_sint =} \FunctionTok{as.Date}\NormalTok{(DT\_SIN\_PRI, }\AttributeTok{format =} \StringTok{"\%d/\%m/\%Y"}\NormalTok{), }\CommentTok{\#date of first symptoms}
\AttributeTok{dt\_nasc =} \FunctionTok{as.Date}\NormalTok{(DT\_NASC, }\AttributeTok{format =} \StringTok{"\%d/\%m/\%Y"}\NormalTok{), }\CommentTok{\#date of birth}
\AttributeTok{dt\_vac\_gripe =} \FunctionTok{as.Date}\NormalTok{(DT\_UT\_DOSE, }\AttributeTok{format =} \StringTok{"\%d/\%m/\%Y"}\NormalTok{), }\CommentTok{\#date of Influenza vaccine}
\AttributeTok{ano =}\NormalTok{ lubridate}\SpecialCharTok{::}\FunctionTok{year}\NormalTok{(dt\_sint), }\CommentTok{\#year of the case}
\NormalTok{ )}
\end{Highlighting}
\end{Shaded}
There are 1625471 observations in the database. To see the dictionary of
variables, access (in Portuguese):
\url{https://opendatasus.saude.gov.br/dataset/ae90fa8f-3e94-467e-a33f-94adbb66edf8/resource/8f571374-c555-4ec0-8e44-00b1e8b11c25/download/dicionario-de-dados-srag-hospitalizado-27.07.2020-final.pdf}
\hypertarget{case-selection-and-data-treatment}{%
\section{Case selection and data
treatment}\label{case-selection-and-data-treatment}}
The first filter is to select cases from May 02, 2021 (18th
epidemiological week of symptoms of 2021) to November 27, 2021
(epidemiological week 47 of 2021).
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#selection of cases from 18th epidemiological week of symptoms (May 2, 2021) }
\CommentTok{\#to November 27, 2021 (week 43 of 2021).}
\NormalTok{sem1 }\OtherTok{\textless{}{-}} \DecValTok{18}
\NormalTok{sem2 }\OtherTok{\textless{}{-}} \DecValTok{47}
\NormalTok{dados1 }\OtherTok{\textless{}{-}}\NormalTok{ dados }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(SEM\_PRI }\SpecialCharTok{\textgreater{}=}\NormalTok{ sem1 }\SpecialCharTok{\&}\NormalTok{ SEM\_PRI }\SpecialCharTok{\textless{}=}\NormalTok{ sem2)}
\end{Highlighting}
\end{Shaded}
There are 756681 observations in the database after selection of valid
years.
The next selection is female:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#filtering F}
\NormalTok{dados2 }\OtherTok{\textless{}{-}} \FunctionTok{filter}\NormalTok{(dados1, CS\_SEXO }\SpecialCharTok{==} \StringTok{"F"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
There are 338892 observations in the database.
Selection of women of childbearing age (10 to 55 years):
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#creating the age variable as the difference between dt\_sint and dt\_nasc.}
\CommentTok{\#In cases without dt\_nasc, we consider}
\CommentTok{\#the NU\_AGE\_N field}
\NormalTok{dados2 }\OtherTok{\textless{}{-}}\NormalTok{ dados2 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{idade =} \FunctionTok{as.period}\NormalTok{(}\FunctionTok{interval}\NormalTok{(}\AttributeTok{start =}\NormalTok{ dt\_nasc, }\AttributeTok{end =}\NormalTok{ dt\_sint))}\SpecialCharTok{$}\NormalTok{year, }
\AttributeTok{age =} \FunctionTok{ifelse}\NormalTok{(}\FunctionTok{is.na}\NormalTok{(idade), NU\_IDADE\_N, idade)}
\NormalTok{ )}
\CommentTok{\#Filtering of cases aged 55 and under}
\NormalTok{dados3 }\OtherTok{\textless{}{-}}\NormalTok{ dados2 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(age }\SpecialCharTok{\textgreater{}} \DecValTok{9} \SpecialCharTok{\&}\NormalTok{ age }\SpecialCharTok{\textless{}=} \DecValTok{55}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
There are 141540 observations in the database.
The next step is to identify pregnant and postpartum people (variable
\texttt{classi\_gesta\_puerp}) and then select only those cases.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Creating the classification variable if pregnant, postpartum and }
\DocumentationTok{\#\#neither pregnant nor postpartum}
\NormalTok{dados3 }\OtherTok{\textless{}{-}}\NormalTok{ dados3 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{classi\_gesta\_puerp =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"1tri"}\NormalTok{,}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"2tri"}\NormalTok{,}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"3tri"}\NormalTok{,}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{4} \SpecialCharTok{\textasciitilde{}} \StringTok{"IG\_ig"}\NormalTok{,}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{5} \SpecialCharTok{\&}
\NormalTok{ PUERPERA }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"puerp"}\NormalTok{,}
\NormalTok{ CS\_GESTANT }\SpecialCharTok{==} \DecValTok{9} \SpecialCharTok{\&}\NormalTok{ PUERPERA }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"puerp"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ )}
\NormalTok{ )}
\FunctionTok{freq}\NormalTok{(dados3}\SpecialCharTok{$}\NormalTok{classi\_gesta\_puerp)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## 1tri 800 0.6 0.6
## 2tri 2110 1.5 1.5
## 3tri 4958 3.5 3.5
## IG_ig 368 0.3 0.3
## no 131497 92.9 92.9
## puerp 1807 1.3 1.3
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#filtering only pregnant and postpartum women}
\NormalTok{dados4 }\OtherTok{\textless{}{-}}\NormalTok{ dados3 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(classi\_gesta\_puerp }\SpecialCharTok{!=} \StringTok{"no"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
There are 10043 observations in the database.
We selected only confirmed cases of COVID-19.
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{dados4 }\OtherTok{\textless{}{-}}\NormalTok{ dados4 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{classi\_fin =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CLASSI\_FIN }\SpecialCharTok{==} \DecValTok{5} \SpecialCharTok{\textasciitilde{}} \StringTok{"covid"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ )}
\NormalTok{ )}
\CommentTok{\#filtering only covid cases }
\NormalTok{dados5 }\OtherTok{\textless{}{-}}\NormalTok{ dados4 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(CLASSI\_FIN }\SpecialCharTok{==} \DecValTok{5}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
There are 5806 observations in the database.
Now let's select the cases of COVID by PCR or antigen, but which are
also not positive for Influenza.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#COVID case diagnosed by PCR}
\NormalTok{dados5 }\OtherTok{\textless{}{-}}\NormalTok{ dados5 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{pcr\_covid\_SN =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ (PCR\_SARS2 }\SpecialCharTok{==} \DecValTok{1}\NormalTok{) }\SpecialCharTok{|}
\NormalTok{ (}
\FunctionTok{str\_detect}\NormalTok{(DS\_PCR\_OUT, }\StringTok{"SARS|COVID|COV|CORONA|CIVID"}\NormalTok{) }
\NormalTok{ ) }\SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ ))}
\CommentTok{\#Influenza case diagnosed by PCR }
\NormalTok{dados5 }\OtherTok{\textless{}{-}}\NormalTok{ dados5 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{pcr\_influenza\_SN =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ (POS\_PCRFLU }\SpecialCharTok{==} \DecValTok{1}\NormalTok{) }\SpecialCharTok{|}
\NormalTok{ (}
\FunctionTok{str\_detect}\NormalTok{(DS\_PCR\_OUT, }\StringTok{"INFLU|INFLUENZA"}\NormalTok{) }
\NormalTok{ ) }\SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ ))}
\FunctionTok{with}\NormalTok{(dados5, }\FunctionTok{table}\NormalTok{(pcr\_influenza\_SN, pcr\_covid\_SN))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## pcr_covid_SN
## pcr_influenza_SN no yes
## no 2806 2999
## yes 1 0
\end{verbatim}
There is no case that is positive for COVID and for Influenza by PCR.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Case of COVID diagnosed by antigen}
\NormalTok{dados5 }\OtherTok{\textless{}{-}}\NormalTok{ dados5 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{antigenio\_covid\_SN =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ (AN\_SARS2 }\SpecialCharTok{==} \DecValTok{1}\NormalTok{) }\SpecialCharTok{|}
\NormalTok{ (}
\FunctionTok{str\_detect}\NormalTok{(DS\_AN\_OUT, }\StringTok{"SARS|COVID|COV|CORONA|CIVID"}\NormalTok{) }
\NormalTok{ ) }\SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ ))}
\CommentTok{\#Influenza case diagnosed by antigen}
\NormalTok{dados5 }\OtherTok{\textless{}{-}}\NormalTok{ dados5 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{antigenio\_influenza\_SN =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ (POS\_AN\_FLU }\SpecialCharTok{==} \DecValTok{1}\NormalTok{) }\SpecialCharTok{|}
\NormalTok{ (}
\FunctionTok{str\_detect}\NormalTok{(DS\_AN\_OUT, }\StringTok{"INFLU|INFLUENZA"}\NormalTok{) }
\NormalTok{ ) }\SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ ))}
\FunctionTok{with}\NormalTok{(dados5, }\FunctionTok{table}\NormalTok{(antigenio\_influenza\_SN, antigenio\_covid\_SN))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## antigenio_covid_SN
## antigenio_influenza_SN no yes
## no 4306 1499
## yes 0 1
\end{verbatim}
There is one positive case for COVID and for Influenza by antigen.
We will now select the cases of COVID confirmed by PCR or antigen.
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(dados5, }\FunctionTok{table}\NormalTok{(pcr\_covid\_SN, antigenio\_covid\_SN))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## antigenio_covid_SN
## pcr_covid_SN no yes
## no 1518 1289
## yes 2788 211
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#filtering only covid cases by PCR or antigen}
\NormalTok{dados6 }\OtherTok{\textless{}{-}}\NormalTok{ dados5 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(pcr\_covid\_SN }\SpecialCharTok{==} \StringTok{"yes"} \SpecialCharTok{|}\NormalTok{ antigenio\_covid\_SN }\SpecialCharTok{==} \StringTok{"yes"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
There are 4288 observations in the database.
Now it's time to remove cases that are also positive for Influenza.
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(dados6, }\FunctionTok{table}\NormalTok{(pcr\_influenza\_SN, antigenio\_influenza\_SN))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## antigenio_influenza_SN
## pcr_influenza_SN no yes
## no 4287 0
## yes 0 1
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#filtering only negative cases of Influenza by PCR or antigen}
\NormalTok{dados7 }\OtherTok{\textless{}{-}}\NormalTok{ dados6 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(pcr\_influenza\_SN }\SpecialCharTok{!=} \StringTok{"yes"} \SpecialCharTok{\&}\NormalTok{ antigenio\_influenza\_SN }\SpecialCharTok{!=} \StringTok{"yes"}\NormalTok{) }
\end{Highlighting}
\end{Shaded}
There are 4287 observations in the database.
We will only select the finalized cases (death or cure). The variable
that indicates the outcome is \texttt{EVOLUCAO}, with the categories:
1-Cure; 2-Death; 3- Death from other causes; 9-Ignored.
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(dados7, }\FunctionTok{freq}\NormalTok{(EVOLUCAO))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## 1 3351 78.2 84.9
## 2 487 11.4 12.3
## 3 8 0.2 0.2
## 9 100 2.3 2.5
## NA 341 8.0 NA
\end{verbatim}
Let's select only the finalized cases:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#filtering only completed cases}
\NormalTok{dados8 }\OtherTok{\textless{}{-}}\NormalTok{ dados7 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{((EVOLUCAO }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{|}\NormalTok{ EVOLUCAO }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{|}\NormalTok{ EVOLUCAO }\SpecialCharTok{==} \DecValTok{3}\NormalTok{) }\SpecialCharTok{\&} \SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(EVOLUCAO))}
\CommentTok{\#creating the evolution variable}
\NormalTok{dados8 }\OtherTok{\textless{}{-}}\NormalTok{ dados8 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{death =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ EVOLUCAO }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"cure"}\NormalTok{, }
\NormalTok{ EVOLUCAO }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"death"}\NormalTok{,}
\NormalTok{ EVOLUCAO }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"death"}
\NormalTok{ ))}
\FunctionTok{with}\NormalTok{(dados8, }\FunctionTok{freq}\NormalTok{(death))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## cure 3351 87.1 87.1
## death 495 12.9 12.9
\end{verbatim}
There are 3846 observations in the database.
The variable that indicates whether the person received a vaccine
against COVID-19 is \texttt{VACINA\_COV}, with categories: 1-yes; 2-no;
9-ignored.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Frequency table for VACINA\_COV}
\FunctionTok{with}\NormalTok{(dados8, }\FunctionTok{freq}\NormalTok{(VACINA\_COV))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## 1 650 16.9 18.7
## 2 2084 54.2 60.0
## 9 738 19.2 21.3
## NA 374 9.7 NA
\end{verbatim}
Let's now group ``NA'' and ``9'' in the same category (NA - missing
data) and label the valid categories.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#recoding the vaccine\_cov variable }
\NormalTok{dados8 }\OtherTok{\textless{}{-}}\NormalTok{ dados8 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}\AttributeTok{vaccine\_cov =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ VACINA\_COV }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\NormalTok{ VACINA\_COV }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}
\NormalTok{ ))}
\CommentTok{\#frequency table for vaccine\_cov}
\FunctionTok{with}\NormalTok{(dados8, }\FunctionTok{freq}\NormalTok{(vaccine\_cov))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## no 2084 54.2 76.2
## yes 650 16.9 23.8
## NA 1112 28.9 NA
\end{verbatim}
The next step is filtering cases that we have information about COVID-19
vaccination. These data are analyzed in the following.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Filtering cases with information about vaccination}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ dados8 }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(}\SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(vaccine\_cov))}
\end{Highlighting}
\end{Shaded}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{freq}\NormalTok{(vaccine\_cov))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## no 2084 76.2 76.2
## yes 650 23.8 23.8
\end{verbatim}
The variable \texttt{vaccine\_cov} only indicates if the pregnant or
postpartum women took the vaccine, regardless of the dose. There is no
information on whether the person only took the first dose or the
second. The closest we come to this is to consider the column
\texttt{DOSE\_2\_COV}, which indicates the date of the second dose.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Create second dose date variable}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\NormalTok{ dplyr}\SpecialCharTok{::}\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{dt\_dose2\_cov =} \FunctionTok{as.Date}\NormalTok{(DOSE\_2\_COV, }\AttributeTok{format =} \StringTok{"\%d/\%m/\%Y"}\NormalTok{)}
\NormalTok{ )}
\CommentTok{\#Create variable that indicates that it has the date of the second dose}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final}\SpecialCharTok{\%\textgreater{}\%}
\NormalTok{ dplyr}\SpecialCharTok{::}\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{indic\_dt\_dose2\_cov =} \FunctionTok{ifelse}\NormalTok{(}\FunctionTok{is.na}\NormalTok{(dt\_dose2\_cov) }\SpecialCharTok{\&} \SpecialCharTok{!}\FunctionTok{is.na}\NormalTok{(vaccine\_cov), }\DecValTok{0}\NormalTok{, }\FunctionTok{ifelse}\NormalTok{(}\FunctionTok{is.na}\NormalTok{(vaccine\_cov), }\ConstantTok{NA}\NormalTok{, }\DecValTok{1}\NormalTok{))}
\NormalTok{ )}
\CommentTok{\# first dose date frequency table}
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{freq}\NormalTok{(indic\_dt\_dose2\_cov, }\AttributeTok{total =} \ConstantTok{TRUE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## 0 2534 92.7 92.7
## 1 200 7.3 7.3
## Total 2734 100.0 100.0
\end{verbatim}
There is only information on the date of the second dose for 200 cases
of 650 cases indicated as ``yes'' for COVID-19 vaccine.
Now we will analyze the not vaccinated group versus two dose vaccinated
group.
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#Create second dose date variable}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{filter}\NormalTok{(vaccine\_cov }\SpecialCharTok{==} \StringTok{"no"} \SpecialCharTok{|}\NormalTok{ (vaccine\_cov }\SpecialCharTok{==} \StringTok{"yes"} \SpecialCharTok{\&}\NormalTok{ indic\_dt\_dose2\_cov }\SpecialCharTok{==} \DecValTok{1}\NormalTok{))}
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{freq}\NormalTok{(vaccine\_cov))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## n % val%
## no 2084 91.2 91.2
## yes 200 8.8 8.8
\end{verbatim}
\#Analysis
\hypertarget{epidemiologic-characteristics}{%
\subsection{Epidemiologic
characteristics}\label{epidemiologic-characteristics}}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\# Ethnicity}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{ethnicity =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CS\_RACA }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"white"}\NormalTok{,}
\NormalTok{ CS\_RACA }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"black"}\NormalTok{,}
\NormalTok{ CS\_RACA }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"yellow"}\NormalTok{,}
\NormalTok{ CS\_RACA }\SpecialCharTok{==} \DecValTok{4} \SpecialCharTok{\textasciitilde{}} \StringTok{"brown"}\NormalTok{,}
\NormalTok{ CS\_RACA }\SpecialCharTok{==} \DecValTok{5} \SpecialCharTok{\textasciitilde{}} \StringTok{"indigenous"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}
\NormalTok{ ), }
\AttributeTok{white\_color =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ ethnicity }\SpecialCharTok{==} \StringTok{"white"} \SpecialCharTok{\textasciitilde{}} \StringTok{"yes"}\NormalTok{, }
\FunctionTok{is.na}\NormalTok{(ethnicity) }\SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}\NormalTok{, }
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \StringTok{"no"}
\NormalTok{ )}
\NormalTok{ )}
\CommentTok{\# Education}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{education2 =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CS\_ESCOL\_N }\SpecialCharTok{\textless{}=} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"up to 9 years"}\NormalTok{, }
\NormalTok{ CS\_ESCOL\_N }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"from 9 to 12 years"}\NormalTok{, }
\NormalTok{ CS\_ESCOL\_N }\SpecialCharTok{==} \DecValTok{4} \SpecialCharTok{\textasciitilde{}} \StringTok{"over 12 years"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}
\NormalTok{ )}
\NormalTok{ )}
\NormalTok{data\_final}\SpecialCharTok{$}\NormalTok{education2 }\OtherTok{\textless{}{-}}
\FunctionTok{factor}\NormalTok{(data\_final}\SpecialCharTok{$}\NormalTok{education2, }\AttributeTok{levels =} \FunctionTok{c}\NormalTok{(}\StringTok{"up to 9 years"}\NormalTok{, }\StringTok{"from 9 to 12 years"}\NormalTok{, }\StringTok{"over 12 years"}\NormalTok{))}
\CommentTok{\# residence area}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{residence =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"urban"}\NormalTok{,}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"rural"}\NormalTok{,}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"periurban"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}
\NormalTok{ )}
\NormalTok{ )}
\CommentTok{\# residence area 2 (grouping the categories urban and periurban)}
\NormalTok{data\_final }\OtherTok{\textless{}{-}}\NormalTok{ data\_final }\SpecialCharTok{\%\textgreater{}\%}
\FunctionTok{mutate}\NormalTok{(}
\AttributeTok{residence2 =} \FunctionTok{case\_when}\NormalTok{(}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{1} \SpecialCharTok{\textasciitilde{}} \StringTok{"urban/periurban"}\NormalTok{,}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{2} \SpecialCharTok{\textasciitilde{}} \StringTok{"rural"}\NormalTok{,}
\NormalTok{ CS\_ZONA }\SpecialCharTok{==} \DecValTok{3} \SpecialCharTok{\textasciitilde{}} \StringTok{"urban/periurban"}\NormalTok{,}
\ConstantTok{TRUE} \SpecialCharTok{\textasciitilde{}} \ConstantTok{NA\_character\_}
\NormalTok{ )}
\NormalTok{ )}
\NormalTok{data\_final}\SpecialCharTok{$}\NormalTok{residence2 }\OtherTok{\textless{}{-}}
\FunctionTok{factor}\NormalTok{(data\_final}\SpecialCharTok{$}\NormalTok{residence2, }\AttributeTok{levels =} \FunctionTok{c}\NormalTok{(}\StringTok{"rural"}\NormalTok{, }\StringTok{"urban/periurban"}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\hypertarget{ethnicity}{%
\subsubsection{Ethnicity}\label{ethnicity}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{ctable}\NormalTok{(ethnicity, vaccine\_cov, }\AttributeTok{prop =} \StringTok{"c"}\NormalTok{, }\AttributeTok{useNA =} \StringTok{"no"}\NormalTok{, }\AttributeTok{chisq =} \ConstantTok{FALSE}\NormalTok{, }\AttributeTok{OR =} \ConstantTok{FALSE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cross-Tabulation, Column Proportions
## ethnicity * vaccine_cov
## Data Frame: data_final
##
## ------------ ------------- --------------- -------------- ---------------
## vaccine_cov no yes Total
## ethnicity
## black 96 ( 5.1%) 6 ( 3.3%) 102 ( 4.9%)
## brown 753 ( 39.9%) 61 ( 33.3%) 814 ( 39.3%)
## indigenous 5 ( 0.3%) 4 ( 2.2%) 9 ( 0.4%)
## white 1022 ( 54.1%) 111 ( 60.7%) 1133 ( 54.7%)
## yellow 12 ( 0.6%) 1 ( 0.5%) 13 ( 0.6%)
## Total 1888 (100.0%) 183 (100.0%) 2071 (100.0%)
## ------------ ------------- --------------- -------------- ---------------
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{fisher.test}\NormalTok{(data\_final}\SpecialCharTok{$}\NormalTok{ethnicity, data\_final}\SpecialCharTok{$}\NormalTok{vaccine\_cov)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
##
## Fisher's Exact Test for Count Data
##
## data: data_final$ethnicity and data_final$vaccine_cov
## p-value = 0.007548
## alternative hypothesis: two.sided
\end{verbatim}
\hypertarget{white-color}{%
\subsubsection{White color}\label{white-color}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{ctable}\NormalTok{(white\_color, vaccine\_cov, }\AttributeTok{prop =} \StringTok{"c"}\NormalTok{, }\AttributeTok{useNA =} \StringTok{"no"}\NormalTok{, }\AttributeTok{chisq =} \ConstantTok{TRUE}\NormalTok{, }\AttributeTok{OR =} \ConstantTok{TRUE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cross-Tabulation, Column Proportions
## white_color * vaccine_cov
## Data Frame: data_final
##
##
## ------------- ------------- --------------- -------------- ---------------
## vaccine_cov no yes Total
## white_color
## no 866 ( 45.9%) 72 ( 39.3%) 938 ( 45.3%)
## yes 1022 ( 54.1%) 111 ( 60.7%) 1133 ( 54.7%)
## Total 1888 (100.0%) 183 (100.0%) 2071 (100.0%)
## ------------- ------------- --------------- -------------- ---------------
##
## ----------------------------
## Chi.squared df p.value
## ------------- ---- ---------
## 2.6088 1 0.1063
## ----------------------------
##
## ----------------------------------
## Odds Ratio Lo - 95% Hi - 95%
## ------------ ---------- ----------
## 1.31 0.96 1.78
## ----------------------------------
\end{verbatim}
\hypertarget{education-years}{%
\subsubsection{Education (years)}\label{education-years}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{ctable}\NormalTok{(education2, vaccine\_cov, }\AttributeTok{prop =} \StringTok{"c"}\NormalTok{, }\AttributeTok{useNA =} \StringTok{"no"}\NormalTok{, }\AttributeTok{chisq =} \ConstantTok{TRUE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cross-Tabulation, Column Proportions
## education2 * vaccine_cov
## Data Frame: data_final
##
##
## -------------------- ------------- --------------- -------------- ---------------
## vaccine_cov no yes Total
## education2
## up to 9 years 279 ( 26.7%) 20 ( 19.8%) 299 ( 26.1%)
## from 9 to 12 years 573 ( 54.9%) 55 ( 54.5%) 628 ( 54.8%)
## over 12 years 192 ( 18.4%) 26 ( 25.7%) 218 ( 19.0%)
## Total 1044 (100.0%) 101 (100.0%) 1145 (100.0%)
## -------------------- ------------- --------------- -------------- ---------------
##
## ----------------------------
## Chi.squared df p.value
## ------------- ---- ---------
## 4.3072 2 0.1161
## ----------------------------
\end{verbatim}
\hypertarget{age}{%
\subsubsection{Age}\label{age}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{datasummary}\NormalTok{((vaccine\_cov) }\SpecialCharTok{\textasciitilde{}}\NormalTok{ age}\SpecialCharTok{*}\NormalTok{(n}\SpecialCharTok{+}\NormalTok{media}\SpecialCharTok{+}\NormalTok{DP}\SpecialCharTok{+}\NormalTok{mediana}\SpecialCharTok{+}\NormalTok{q25}\SpecialCharTok{+}\NormalTok{q75}\SpecialCharTok{+}\NormalTok{IQR),}
\AttributeTok{data =}\NormalTok{ data\_final, }\AttributeTok{output =} \StringTok{\textquotesingle{}markdown\textquotesingle{}}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{longtable}[]{@{}lrrrrrrr@{}}
\toprule
& n & media & DP & mediana & q25 & q75 & IQR \\
\midrule
\endhead
no & 2084.00 & 29.72 & 7.09 & 30.00 & 25.00 & 35.00 & 10.00 \\
yes & 200.00 & 31.44 & 7.72 & 31.00 & 25.00 & 37.00 & 12.00 \\
\bottomrule
\end{longtable}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#t{-}test}
\FunctionTok{t.test}\NormalTok{(age }\SpecialCharTok{\textasciitilde{}}\NormalTok{ vaccine\_cov, }\AttributeTok{data =}\NormalTok{ data\_final)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
##
## Welch Two Sample t-test
##
## data: age by vaccine_cov
## t = -3.0298, df = 232.39, p-value = 0.002724
## alternative hypothesis: true difference in means between group no and group yes is not equal to 0
## 95 percent confidence interval:
## -2.8372657 -0.6012756
## sample estimates:
## mean in group no mean in group yes
## 29.72073 31.44000
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{\#effect size}
\NormalTok{c\_cohen }\OtherTok{\textless{}{-}} \FunctionTok{cohens\_d}\NormalTok{(age }\SpecialCharTok{\textasciitilde{}} \FunctionTok{as.factor}\NormalTok{(vaccine\_cov), }\AttributeTok{data=}\NormalTok{data\_final)}
\NormalTok{c\_cohen}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cohen's d | 95% CI
## --------------------------
## -0.24 | [-0.39, -0.10]
##
## - Estimated using pooled SD.
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{interpret\_d}\NormalTok{(c\_cohen}\SpecialCharTok{$}\NormalTok{Cohens\_d,}\AttributeTok{rules=}\StringTok{"cohen1988"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## [1] "small"
## (Rules: cohen1988)
\end{verbatim}
\hypertarget{residence-area}{%
\subsubsection{Residence area}\label{residence-area}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{ctable}\NormalTok{(residence, vaccine\_cov, }\AttributeTok{prop =} \StringTok{"c"}\NormalTok{, }\AttributeTok{useNA =} \StringTok{"no"}\NormalTok{, }\AttributeTok{chisq =} \ConstantTok{FALSE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cross-Tabulation, Column Proportions
## residence * vaccine_cov
## Data Frame: data_final
##
## ----------- ------------- --------------- -------------- ---------------
## vaccine_cov no yes Total
## residence
## periurban 6 ( 0.3%) 0 ( 0.0%) 6 ( 0.3%)
## rural 113 ( 5.8%) 9 ( 4.8%) 122 ( 5.7%)
## urban 1838 ( 93.9%) 179 ( 95.2%) 2017 ( 94.0%)
## Total 1957 (100.0%) 188 (100.0%) 2145 (100.0%)
## ----------- ------------- --------------- -------------- ---------------
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{fisher.test}\NormalTok{(data\_final}\SpecialCharTok{$}\NormalTok{residence, data\_final}\SpecialCharTok{$}\NormalTok{vaccine\_cov)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
##
## Fisher's Exact Test for Count Data
##
## data: data_final$residence and data_final$vaccine_cov
## p-value = 0.8508
## alternative hypothesis: two.sided
\end{verbatim}
\hypertarget{residence-area-2-grouping-the-categories-urban-and-periurban}{%
\subsubsection{Residence area 2 (grouping the categories urban and
periurban)}\label{residence-area-2-grouping-the-categories-urban-and-periurban}}
\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{with}\NormalTok{(data\_final, }\FunctionTok{ctable}\NormalTok{(residence2, vaccine\_cov, }\AttributeTok{prop =} \StringTok{"c"}\NormalTok{, }\AttributeTok{useNA =} \StringTok{"no"}\NormalTok{, }\AttributeTok{chisq =} \ConstantTok{TRUE}\NormalTok{, }\AttributeTok{OR =} \ConstantTok{TRUE}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Cross-Tabulation, Column Proportions
## residence2 * vaccine_cov
## Data Frame: data_final
##
##
## ----------------- ------------- --------------- -------------- ---------------
## vaccine_cov no yes Total
## residence2
## rural 113 ( 5.8%) 9 ( 4.8%) 122 ( 5.7%)
## urban/periurban 1844 ( 94.2%) 179 ( 95.2%) 2023 ( 94.3%)
## Total 1957 (100.0%) 188 (100.0%) 2145 (100.0%)
## ----------------- ------------- --------------- -------------- ---------------
##
## ----------------------------
## Chi.squared df p.value
## ------------- ---- ---------
## 0.1546 1 0.6941
## ----------------------------
##
## ----------------------------------
## Odds Ratio Lo - 95% Hi - 95%
## ------------ ---------- ----------
## 1.22 0.61 2.44
## ----------------------------------
\end{verbatim}