#LIBRERIAS
library(funModeling) 
## Loading required package: Hmisc
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
## Loading required package: ggplot2
## 
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
## 
##     format.pval, units
## funModeling v.1.9.4 :)
## Examples and tutorials at livebook.datascienceheroes.com
##  / Now in Spanish: librovivodecienciadedatos.ai
library(tidyverse) 
## ── Attaching packages
## ───────────────────────────────────────
## tidyverse 1.3.2 ──
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.5.0 
## ✔ readr   2.1.3      ✔ forcats 0.5.2 
## ✔ purrr   1.0.0      
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter()    masks stats::filter()
## ✖ dplyr::lag()       masks stats::lag()
## ✖ dplyr::src()       masks Hmisc::src()
## ✖ dplyr::summarize() masks Hmisc::summarize()
library(Hmisc)
library(tidyverse)
library(ggpubr)
library(gtable)
library(gt)
## 
## Attaching package: 'gt'
## 
## The following object is masked from 'package:Hmisc':
## 
##     html
library(survival)
library(ggpubr)
library(survminer)
## 
## Attaching package: 'survminer'
## 
## The following object is masked from 'package:survival':
## 
##     myeloma
library(readr)
library(gtsummary)

Análisis Viruela del Mono en Sinaloa

library(readxl)
Viruela <- read_excel("C:/Users/fidel/OneDrive - CINVESTAV/Proyecto colaboración SSA/base de datos/Viruelasimica/Viruela.xlsx")

dbvirsim <- Viruela
dbvirsim <- dbvirsim %>% filter(!is.na(RESDEFVS))

glimpse(dbvirsim)
## Rows: 38
## Columns: 246
## $ NUM_AFILIA_EXPED           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FOLIO                      <dbl> 90, 155, 311, 312, 460, 676, 835, 928, 1092…
## $ PRIMER_AP                  <chr> "GARCIA", "CASILLAS", "MEDINA", "PIÑA", "LE…
## $ SEGUNDO_AP                 <chr> "ESPINOZA", "MERCADO", "URIARTE", "GONZALEZ…
## $ NOMBRE                     <chr> "ARTURO", "SOPHIA ISABEL", "CARLOS EDEL", "…
## $ FEC_NAC                    <dttm> 1977-12-18, 2014-04-22, 2014-12-25, 2009-0…
## $ EDAD_A                     <dbl> 44, 8, 7, 13, 43, 27, 67, 42, 28, 32, 39, 3…
## $ EDAD_M                     <dbl> 9, 6, 10, 4, 9, 7, 7, 0, 0, 8, 4, 0, 10, 5,…
## $ EDAD_D                     <dbl> 13, 18, 13, 15, 11, 10, 13, 0, 0, 0, 16, 29…
## $ SEXO                       <dbl> 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ GENERO                     <chr> "Hombre", "Mujer", "Hombre", "Mujer", "Homb…
## $ ORIENT_SEX                 <chr> "Gay", "Heterosexual", "Heterosexual", "Het…
## $ ESTADO_NAC                 <dbl> 25, 25, 25, 25, 25, 25, 25, NA, NA, 25, 30,…
## $ DES_ESTADO_NAC             <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ MUNIC_NAC                  <dbl> 6, 6, 6, 6, 6, 12, 6, NA, NA, 6, 69, 12, 12…
## $ DES_MUNIC_NAC              <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ CURP                       <chr> "GAEA771218HSLRSR08", "CAMS140422MSLSRPA9",…
## $ CALLE                      <chr> "ESTERO DE CHAMETLA", "LOS TULES", "MONTE D…
## $ NUM_EX                     <chr> "3217", "1996", "5003", "94", "S/N", "SIN N…
## $ NUM_IN                     <chr> "S/N", "S/N", "S/N", "S/N", "S/N", "SIN NUM…
## $ COLONIA                    <chr> "PRADERA DORADA", NA, NA, NA, NA, NA, NA, N…
## $ ESTADO                     <dbl> 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,…
## $ DES_ESTADO                 <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ JURISDIC                   <dbl> 4, 4, 4, 4, 4, 5, 4, 6, 6, 4, 4, 5, 5, 5, 5…
## $ DES_JURISDIC               <chr> "JURISDICCION SANITARIA IV CULIACAN", "JURI…
## $ MUNICIPIO                  <dbl> 6, 6, 6, 6, 6, 12, 6, 12, 12, 6, 6, 12, 12,…
## $ DES_MUNICIPIO              <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ LOCALIDAD                  <dbl> 1, 1, 1, 1, 968, 1, 1, NA, NA, 1, 1, 1, 1, …
## $ DES_LOCALIDAD              <chr> "CULIACÁN ROSALES", "CULIACÁN ROSALES", "CU…
## $ ENTRE_CALL                 <chr> "S/R", "S/R", "CIMA EVEREST Y CIMA ORIZABA"…
## $ Y_CALLE                    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ C_P                        <dbl> 80058, 80058, 80295, 80190, 80450, 82089, 8…
## $ TEL                        <chr> "6672444166", "6673387097|", "6673503153", …
## $ RECON_INDIGENA             <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ HABLA_LENG_IND             <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ LENG_IND                   <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ DES_LENG_IND               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ OCUPACION                  <dbl> 10, 33, 12, 12, 33, 20, 9, NA, NA, 29, 33, …
## $ DES_OCUPACION              <chr> "Empleados(as)", "Otros", "Estudiantes", "E…
## $ DIR_LABORAL                <chr> NA, NA, NA, NA, NA, "EGA INDUSTRIAL ZONA NO…
## $ MIGRANTE                   <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ NACIONALIDAD               <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_ORIGEN                <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO1             <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO2             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO3             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_INGRESO_MEX            <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ NOM_UNIDAD                 <chr> "UMF 36 CULIACAN", "HOSPITAL PEDIÁTRICO DE …
## $ ESTADO_UNIDAD              <dbl> 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,…
## $ DES_ESTADO_UNIDAD          <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ JURISD_UNIDAD              <dbl> 4, 4, 4, 4, 4, 5, 4, 5, 5, 4, 4, 5, 5, 5, 5…
## $ DES_JURISD_UNIDAD          <chr> "JURISDICCION SANITARIA IV CULIACAN", "JURI…
## $ CLUES                      <chr> "SLIMS000155", "SLSSA002556", "SLSSA002556"…
## $ MUN_UNIDAD                 <dbl> 6, 6, 6, 6, 6, 12, 6, 12, 12, 6, 6, 12, 12,…
## $ DES_MUN_UNIDAD             <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ LOC_UNIDAD                 <dbl> 1, 1, 1, 1, 1194, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ DES_LOC_UNIDAD             <chr> "CULIACÁN ROSALES", "CULIACÁN ROSALES", "CU…
## $ INST_UNIDAD                <dbl> 2, 1, 1, 3, 1, 2, 1, 3, 3, 3, 1, 1, 2, 3, 1…
## $ DES_INST_UNIDAD            <chr> "IMSS", "SSA", "SSA", "ISSSTE", "SSA", "IMS…
## $ FEC_PRIM_CONTACTO_SS       <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ FEC_NOT_JUR                <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ FEC_NOT_EST                <dttm> 2022-07-13, 2022-07-27, 2022-08-04, 2022-0…
## $ FEC_NOT_DGE                <dttm> 2022-07-13, 2022-07-27, 2022-08-04, 2022-0…
## $ FEC_INI_EST_EPI            <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ VIAJE                      <dbl> 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2…
## $ PAIS_VIAJE1                <chr> "México", NA, NA, NA, NA, NA, NA, NA, NA, "…
## $ ESTADO_VIAJE1              <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ MUN_VIAJE1                 <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ LOC_VIAJE1                 <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ FEC_ENT_VIAJE1             <dttm> 2022-07-23, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_SAL_VIAJE1             <dttm> 2022-07-27, NA, NA, NA, NA, NA, NA, NA, NA…
## $ TIEMP_ESTANCIA1            <dbl> 4, 0, 0, 0, 0, 0, 0, NA, NA, 7, 1, 14, 1, 0…
## $ PAIS_VIAJE2                <chr> "México", NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ESTADO_VIAJE2              <chr> "JALISCO", NA, NA, NA, NA, NA, NA, NA, NA, …
## $ MUN_VIAJE2                 <chr> "GUADALAJARA", NA, NA, NA, NA, NA, NA, NA, …
## $ LOC_VIAJE2                 <chr> "GUADALAJARA", NA, NA, NA, NA, NA, NA, NA, …
## $ FEC_ENT_VIAJE2             <dttm> 2022-06-27, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_SAL_VIAJE2             <dttm> 2022-07-04, NA, NA, NA, NA, NA, NA, NA, NA…
## $ TIEMP_ESTANCIA2            <dbl> 8, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 6, 0,…
## $ PROCEDENCIA                <chr> "De la Jurisdicción", "De la Jurisdicción",…
## $ ESTUVO                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 1, 1, 2,…
## $ CONFIRM_LABOR              <dbl> NA, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2…
## $ FOLIO_CONFIRM              <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CUAL_ENTORNO               <chr> "Evento Masivo Sin Contacto Sexual", "Casa"…
## $ ESPECIFIQUE_LU             <chr> NA, NA, "VISITA CASA ZONA RURAL", "VIA PUBL…
## $ ESPECIFIQUE_FE             <dttm> NA, NA, 2022-07-22, NA, NA, NA, NA, NA, NA…
## $ CONT_MASC_DOMEST           <dbl> 0, 0, 0, 0, 0, 1, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ CONT_ROEDORES              <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ROED_SALV             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ANIM_SALV             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_OTROS                 <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ESP_OTROS             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MEC_TRANSM                 <chr> "Persona a persona (Excepto las opciones an…
## $ ESPEC_MEC_TRANS            <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FECHA_INI_SIGNOS           <dttm> 2022-07-10, 2022-07-19, 2022-07-29, 2022-0…
## $ FECHA_INI_EXANT            <dttm> 2022-07-10, 2022-07-19, 2022-07-29, 2022-0…
## $ EXA_MACULA                 <dbl> 1, 0, 0, 1, 0, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ EXA_PAPULA                 <dbl> 1, 1, 0, 1, 1, 1, 0, NA, NA, 0, 0, 1, 1, 1,…
## $ EXA_VESICULA               <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1…
## $ EXA_PUSTULA                <dbl> 0, 0, 0, 0, 1, 1, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ EXA_COSTRA                 <dbl> 1, 1, 0, 0, 0, 1, 1, NA, NA, 0, 1, 0, 1, 1,…
## $ DISTRIB_EXA                <chr> "Cefalocaudal", "Cefalocaudal", "Centrífuga…
## $ LEXAN_CABEZA               <dbl> 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0…
## $ LEXAN_CARA                 <dbl> 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0…
## $ LEXAN_CUELLO               <dbl> 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0…
## $ LEXAN_TORAX                <dbl> 1, 1, 0, 0, 1, 1, 1, NA, NA, 0, 1, 0, 0, 1,…
## $ LEXAN_MIEM_SUP             <dbl> 0, 0, 1, 1, 1, 0, 0, 1, NA, 1, 1, 1, 1, 1, …
## $ LEXAN_MIEM_INF             <dbl> 0, 0, 1, 1, 1, 1, 0, NA, 1, 0, 1, 0, 1, 1, …
## $ LEXAN_MUC_ORAL             <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ LEXAN_GENITALES            <dbl> 0, 1, 0, 0, 1, 1, 0, 1, NA, 0, 0, 0, 1, 1, …
## $ LEXAN_ABDOMEN              <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 1, 0, 1,…
## $ LEXAN_ESPALDA              <dbl> 1, 0, 0, 0, 1, 0, 0, NA, NA, 1, 1, 0, 0, 1,…
## $ LEXAN_REG_PERI             <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 1,…
## $ LEXAN_PLANTAS              <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 1,…
## $ LEXAN_PALMAS               <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ FIEBRE                     <dbl> 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ CUANT_FIEBRE               <dbl> 38.0, 38.7, 40.0, 0.0, 38.0, 38.0, 38.0, NA…
## $ FEC_INI_FIEBRE             <dttm> 2022-07-10, 2022-07-18, 2022-07-29, NA, 20…
## $ CEFALEA                    <dbl> 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2…
## $ ARTRALGIAS                 <dbl> 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2…
## $ NAUSEA                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 1, 2, 2, 1, 2,…
## $ MIALGIAS                   <dbl> 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ LUMBALGIA                  <dbl> 2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 1, 1, 1,…
## $ VOMITO                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ ASTENIA                    <dbl> 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1…
## $ TOS                        <dbl> 2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ ODINOFAGIA                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 1, 2,…
## $ ESCALOFRIOS                <dbl> 2, 2, 2, 2, 2, 1, 2, NA, 1, 2, 1, 2, 1, 1, …
## $ DIAFORESIS                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ CONJUNTIVITIS              <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ SANGRANTES                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ DOLOROSAS                  <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ OTRAS_COMOR                <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ LINF_AXILAR                <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ LINF_CERVICAL              <dbl> 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0…
## $ LINF_INGUINAL              <dbl> 0, 0, 0, 0, 0, 0, 1, NA, NA, 0, 0, 1, 1, 0,…
## $ LINF_OTROS                 <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ LINF_ESP_OTROS             <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_DIABETES             <dbl> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_NEOPLASIAS           <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_HEPATITISC           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_GONORREA             <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_CLAMIDIA             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_HERPES               <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_SIFILIS              <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_VERRUGAS             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_MICOPLASMA           <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_TRICOMONIASIS        <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_LINFOGRA             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_VIH                  <dbl> 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0…
## $ CD4                        <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_OTRAS                <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_NINGUNA              <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ COMOR_ESP_OTRAS1           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_ESP_OTRAS2           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_ESP_OTRAS3           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ EMBARAZO                   <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ SDG                        <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ PUERPERIO                  <dbl> 0, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ FEC_TOMA_LES_CUT1          <dttm> 2022-07-13, 2022-07-26, 2022-08-02, 2022-0…
## $ FEC_ENV_LESP_LES_CUT1      <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 20…
## $ FEC_RECEP_LESP_LES_CUT1    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, 2022-0…
## $ FEC_ENV_INDRE_LES_CUT1     <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_RECEP_INDRE_LES_CUT1   <dttm> 2022-07-15, 2022-07-26, 2022-08-05, 2022-0…
## $ CAL_MTRA_LESP_LES_CUT1     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LES_CUT1   <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LES_CUT1     <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ CAL_MTRA_INDRE_LES_CUT1    <dbl> 1, 1, 1, 1, 1, NA, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ MOTIV_RECH_INDRE_LES_CUT1  <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_LES_CUT1    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_RESUL_LES_CUT1         <dttm> 2022-07-16, 2022-07-28, 2022-08-06, 2022-0…
## $ RESULTADO_LES_CUT11        <chr> "Positivo a virus de viruela símica", "Nega…
## $ RESDEFVS                   <chr> "POSITIVO", "NEGATIVO", "NEGATIVO", "NEGATI…
## $ `POSITIVO OTRO`            <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "VHH3",…
## $ RESULTADO_VIRUEL1          <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "Positi…
## $ RESULTADO_HERPES1          <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LES_CUT1             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_CUT11          <dbl> 1, 1, 1, 1, 1, NA, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ FEC_TOMA_LES_CUT2          <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_LESP_LES_CUT2      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_LES_CUT2    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_LES_CUT2     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_LES_CUT2   <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ CAL_MTRA_LESP_LES_CUT2     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LES_CUT2   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LES_CUT2     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_LES_CUT2         <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ RESULTADO_LES_CUT21        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LES_CUT22        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LES_CUT23        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LES_CUT2             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_CUT21          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_TOMA_EX_FAR            <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_ENV_LESP_EX_FAR        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_EX_FAR      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_EX_FAR       <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_EX_FAR     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_LESP_EX_FAR       <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_EX_FAR     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_EX_FAR       <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_INDRE_EX_FAR      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MOTIV_RECH_INDRE_EX_FAR    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_EX_FAR      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_EX_FAR           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_EX_FAR           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_EX_FAR               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_EX_FAR         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TIPO_BIOPSIA               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_TOMA_LIQ_CEFAL         <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_LESP_LIQ_CEFAL     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_LIQ_CEFAL   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_LIQ_CEFAL    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_LIQ_CEFAL  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_LESP_LIQ_CEFAL    <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LIQ_CEFAL  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LIQ_CEFAL    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_INDRE_LIQ_CEFAL   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MOTIV_RECH_INDRE_LIQ_CEFAL <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_LIQ_CEFAL   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_LIQ_CEFAL        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LIQ_CEFAL        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LIQ_CEFAL            <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LIQ_CEFAL          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ DES_LAB_PROC               <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ HOSPITALIZADO              <dbl> 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2…
## $ FEC_HOSPITAL               <dttm> NA, NA, NA, NA, NA, NA, 2022-08-17, NA, NA…
## $ CUID_INTENSIV              <dbl> 2, 2, 2, 2, 0, 2, 2, NA, NA, 0, 2, 2, 2, 2,…
## $ TRATAMIENTO                <dbl> 2, 2, 1, 2, 2, 1, 1, NA, NA, 2, 2, 1, 2, 1,…
## $ FEC_INI_TRATAM             <dttm> NA, NA, 2022-08-02, NA, NA, 2022-08-03, 20…
## $ TIPO_TRATAM                <dbl> 0, 0, 2, 0, 0, 1, 1, NA, NA, 0, 0, 2, 0, 1,…
## $ OTRO_ESPECIF_TRAT          <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ SITUACION_ACTUAL           <dbl> 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3…
## $ FEC_ALTA                   <dttm> 2022-07-13, 2022-07-28, 2022-08-06, 2022-0…
## $ DEFUNCION                  <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ FEC_DEFUN                  <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ NUM_CONTACT_D              <dbl> 4, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0…
## $ FEC_CLASIFICACION          <dttm> 2022-07-16, 2022-07-27, 2022-08-06, 2022-0…
## $ DIAG_FINAL                 <dbl> 2, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2…
## $ OTRO_DIAG                  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ OBSERVACIONES              <chr> "EN ESTUDIO", NA, NA, NA, NA, NA, NA, NA, N…
## $ NOM_ELAB_EST_EPI           <chr> "CISNEROS AVENDAÑO FRANCISCO ENRIQUE", "ROS…
## $ NOM_VALID                  <chr> "CISNEROS AVENDAÑO FRANCISCO ENRIQUE", "EPI…
## $ CARGO_VALID                <chr> "EPIDEMIOLÓGIA", "PAULINA HERNANDEZ CRUZ", …
## $ TEL_VALID                  <chr> "6671765692", "6672381056", "6672381056", "…
## $ CVE_USU                    <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "1US012…
## $ FEC_CAP                    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, 2022-0…

#definir variables

dbvirsim <- dbvirsim %>% mutate(SEXO=recode(SEXO, `1` = "Hombre", 
                                                    `2` = "Mujer"))

##CURVAS

library(lubridate)
## Loading required package: timechange
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
library(epiR); library(ggplot2); library(scales); library(zoo)
## Package epiR 2.0.54 is loaded
## Type help(epi.about) for summary information
## Type browseVignettes(package = 'epiR') to learn how to use epiR for applied epidemiological analyses
## 
## 
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
## 
##     discard
## The following object is masked from 'package:readr':
## 
##     col_factor
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:Hmisc':
## 
##     subplot
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
ggplot(data = dbvirsim, aes(x = as.Date(FEC_INI_FIEBRE))) +
  theme_bw() +
  geom_histogram(binwidth = 2, colour = "#3e78d6", fill = "#3e78d6", size = 0.1)+
  geom_density(aes(y = ..density.. * (nrow(dbvirsim) * 2)), colour = "red", size=0.8)+
  scale_x_date(date_breaks = "1 week",labels = date_format("%d %b"), 
     name = "Date") +
  scale_y_continuous(breaks = seq(from = 0, to =50, by = 1), name = "Number of cases") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust = 1))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(density)` instead.
## Warning: Removed 5 rows containing non-finite values (`stat_bin()`).
## Warning: Removed 5 rows containing non-finite values (`stat_density()`).

ggplot(data = dbvirsim, aes(x = as.Date(FEC_INI_FIEBRE))) +
  theme_bw() +
  geom_histogram(binwidth = 2, colour = "#3e78d6", fill = "#3e78d6", size = 0.1)+
  geom_density(aes(y = ..density.. * (nrow(dbvirsim) * 2)), colour = "red", size=0.8)+
  scale_x_date(date_breaks = "1 week",labels = date_format("%d %b"), 
     name = "Date") +
  scale_y_continuous(breaks = seq(from = 0, to =50, by = 1), name = "Number of cases") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust = 1))
## Warning: Removed 5 rows containing non-finite values (`stat_bin()`).
## Warning: Removed 5 rows containing non-finite values (`stat_density()`).

ggplot(data = dbvirsim, aes(x = as.Date(FEC_INI_FIEBRE), group=RESDEFVS, fill=RESDEFVS)) +
  theme_bw() +
  geom_histogram(binwidth = 7, colour = "black",  size = 0.1)+
  scale_x_date(date_breaks = "1 week",labels = date_format("%d %b"), 
     name = "Date") +
  scale_y_continuous(breaks = seq(from = 0, to =50, by = 1), name = "Number of cases") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust = 1))+scale_fill_manual(values = c("red", "skyblue"), name = "Diagnostico") 
## Warning: Removed 5 rows containing non-finite values (`stat_bin()`).

DEMOGRAFICOS

dbvirsim %>% select(RESDEFVS,SEXO,EDAD_A,ORIENT_SEX,MEC_TRANSM,HOSPITALIZADO,`POSITIVO OTRO`,RESULTADO_HERPES1,RESULTADO_VIRUEL1) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>% 
  add_overall()
## Warning for variable 'EDAD_A':
## simpleWarning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot compute exact p-value with ties
## There was an error in 'add_p()/add_difference()' for variable 'POSITIVO OTRO', p-value omitted:
## Error in stats::fisher.test(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "VHH3", : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'RESULTADO_HERPES1', p-value omitted:
## Error in stats::chisq.test(x = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, : 'x' and 'y' must have at least 2 levels
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
SEXO 0.008
    Hombre 31 (82%) 12 (63%) 19 (100%)
    Mujer 7 (18%) 7 (37%) 0 (0%)
EDAD_A 34 (27, 40) 32 (16, 42) 35 (30, 40) 0.3
ORIENT_SEX <0.001
    Bisexual 3 (7.9%) 0 (0%) 3 (16%)
    Gay 13 (34%) 2 (11%) 11 (58%)
    Heterosexual 20 (53%) 17 (89%) 3 (16%)
    Hombres que tienen sexo con hombres 2 (5.3%) 0 (0%) 2 (11%)
MEC_TRANSM 0.016
    Desconocida 14 (37%) 9 (47%) 5 (26%)
    En los Servicios Salud 1 (2.6%) 1 (5.3%) 0 (0%)
    Persona a persona (Excepto las opciones anteriores) 13 (34%) 8 (42%) 5 (26%)
    Sexual 10 (26%) 1 (5.3%) 9 (47%)
HOSPITALIZADO 0.7
    1 6 (16%) 2 (11%) 4 (21%)
    2 32 (84%) 17 (89%) 15 (79%)
POSITIVO OTRO
    VHH3 3 (100%) 3 (100%) 0 (NA%)
    Unknown 35 16 19
RESULTADO_HERPES1 0 (NA%) 0 (NA%) 0 (NA%)
    Unknown 38 19 19
RESULTADO_VIRUEL1 >0.9
    Negativo a herpes virus 3 humano (varicela zóster) 7 (70%) 7 (70%) 0 (NA%)
    Positivo a herpes virus humano 3 (varicela zóster) 3 (30%) 3 (30%) 0 (NA%)
    Unknown 28 9 19
1 n (%); Median (IQR)
2 Fisher's exact test; Wilcoxon rank sum test
dbvirsim %>% select(EXA_MACULA:FEC_TOMA_LES_CUT1,RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>% 
  add_overall()
## Warning for variable 'FEC_INI_FIEBRE':
## simpleWarning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot compute exact p-value with ties
## Warning for variable 'TOS':
## simpleWarning in stats::chisq.test(x = c(2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 2, : Chi-squared approximation may be incorrect
## There was an error in 'add_p()/add_difference()' for variable 'CONJUNTIVITIS', p-value omitted:
## Error in stats::chisq.test(x = c(2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_HEPATITISC', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_GONORREA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_CLAMIDIA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_HERPES', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_VERRUGAS', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_MICOPLASMA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_TRICOMONIASIS', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_LINFOGRA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_ESP_OTRAS1', p-value omitted:
## Error in stats::fisher.test(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_ESP_OTRAS2', p-value omitted:
## Error in stats::chisq.test(x = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_ESP_OTRAS3', p-value omitted:
## Error in stats::chisq.test(x = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'EMBARAZO', p-value omitted:
## Error in stats::chisq.test(x = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'SDG', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## Warning for variable 'FEC_TOMA_LES_CUT1':
## simpleWarning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot compute exact p-value with ties
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
EXA_MACULA 19 (53%) 9 (47%) 10 (59%) 0.5
    Unknown 2 0 2
EXA_PAPULA 25 (69%) 10 (53%) 15 (88%) 0.021
    Unknown 2 0 2
EXA_VESICULA 33 (87%) 16 (84%) 17 (89%) >0.9
EXA_PUSTULA 20 (56%) 8 (42%) 12 (71%) 0.086
    Unknown 2 0 2
EXA_COSTRA 22 (61%) 9 (47%) 13 (76%) 0.074
    Unknown 2 0 2
DISTRIB_EXA 0.069
    Cefalocaudal 18 (50%) 12 (63%) 6 (35%)
    Centrífuga 9 (25%) 6 (32%) 3 (18%)
    Centrípeta 2 (5.6%) 0 (0%) 2 (12%)
    No Especificada 3 (8.3%) 0 (0%) 3 (18%)
    Otra 1 (2.8%) 0 (0%) 1 (5.9%)
    Simultánea 3 (8.3%) 1 (5.3%) 2 (12%)
    Unknown 2 0 2
LEXAN_CABEZA 22 (58%) 10 (53%) 12 (63%) 0.5
LEXAN_CARA 26 (68%) 12 (63%) 14 (74%) 0.5
LEXAN_CUELLO 20 (53%) 11 (58%) 9 (47%) 0.5
LEXAN_TORAX 23 (64%) 10 (53%) 13 (76%) 0.14
    Unknown 2 0 2
LEXAN_MIEM_SUP 30 (81%) 17 (89%) 13 (72%) 0.2
    Unknown 1 0 1
LEXAN_MIEM_INF 25 (68%) 13 (68%) 12 (67%) >0.9
    Unknown 1 0 1
LEXAN_MUC_ORAL 3 (8.3%) 2 (11%) 1 (5.9%) >0.9
    Unknown 2 0 2
LEXAN_GENITALES 13 (35%) 5 (26%) 8 (44%) 0.2
    Unknown 1 0 1
LEXAN_ABDOMEN 13 (36%) 7 (37%) 6 (35%) >0.9
    Unknown 2 0 2
LEXAN_ESPALDA 18 (50%) 11 (58%) 7 (41%) 0.3
    Unknown 2 0 2
LEXAN_REG_PERI 4 (11%) 2 (11%) 2 (12%) >0.9
    Unknown 2 0 2
LEXAN_PLANTAS 6 (17%) 4 (21%) 2 (12%) 0.7
    Unknown 2 0 2
LEXAN_PALMAS 13 (36%) 6 (32%) 7 (41%) 0.5
    Unknown 2 0 2
FIEBRE 0.046
    1 33 (87%) 14 (74%) 19 (100%)
    2 5 (13%) 5 (26%) 0 (0%)
CUANT_FIEBRE 0.053
    0 5 (14%) 5 (26%) 0 (0%)
    38 21 (58%) 8 (42%) 13 (76%)
    38.3 1 (2.8%) 1 (5.3%) 0 (0%)
    38.5 1 (2.8%) 0 (0%) 1 (5.9%)
    38.7 1 (2.8%) 1 (5.3%) 0 (0%)
    39 6 (17%) 3 (16%) 3 (18%)
    40 1 (2.8%) 1 (5.3%) 0 (0%)
    Unknown 2 0 2
FEC_INI_FIEBRE 2022-05-24 to 2022-11-23 2022-07-18 to 2022-11-12 2022-05-24 to 2022-11-23 >0.9
    Unknown 5 5 0
CEFALEA >0.9
    1 29 (76%) 14 (74%) 15 (79%)
    2 9 (24%) 5 (26%) 4 (21%)
ARTRALGIAS 0.10
    1 21 (55%) 8 (42%) 13 (68%)
    2 17 (45%) 11 (58%) 6 (32%)
NAUSEA 0.2
    1 7 (19%) 2 (11%) 5 (29%)
    2 29 (81%) 17 (89%) 12 (71%)
    Unknown 2 0 2
MIALGIAS 0.2
    1 26 (68%) 11 (58%) 15 (79%)
    2 12 (32%) 8 (42%) 4 (21%)
LUMBALGIA 0.048
    1 15 (42%) 5 (26%) 10 (59%)
    2 21 (58%) 14 (74%) 7 (41%)
    Unknown 2 0 2
VOMITO 0.5
    1 1 (2.8%) 0 (0%) 1 (5.9%)
    2 35 (97%) 19 (100%) 16 (94%)
    Unknown 2 0 2
ASTENIA 0.009
    1 22 (58%) 7 (37%) 15 (79%)
    2 16 (42%) 12 (63%) 4 (21%)
TOS 0.3
    1 10 (28%) 4 (21%) 6 (35%)
    2 26 (72%) 15 (79%) 11 (65%)
    Unknown 2 0 2
ODINOFAGIA 0.4
    1 8 (22%) 3 (16%) 5 (29%)
    2 28 (78%) 16 (84%) 12 (71%)
    Unknown 2 0 2
ESCALOFRIOS 0.070
    1 15 (41%) 5 (26%) 10 (56%)
    2 22 (59%) 14 (74%) 8 (44%)
    Unknown 1 0 1
DIAFORESIS 0.2
    1 7 (19%) 2 (11%) 5 (29%)
    2 29 (81%) 17 (89%) 12 (71%)
    Unknown 2 0 2
CONJUNTIVITIS
    2 36 (100%) 19 (100%) 17 (100%)
    Unknown 2 0 2
SANGRANTES 0.2
    1 2 (5.6%) 0 (0%) 2 (12%)
    2 34 (94%) 19 (100%) 15 (88%)
    Unknown 2 0 2
DOLOROSAS 0.040
    1 4 (11%) 0 (0%) 4 (24%)
    2 32 (89%) 19 (100%) 13 (76%)
    Unknown 2 0 2
OTRAS_COMOR >0.9
    DOLOR ABDOMINAL 1 (50%) 0 (NA%) 1 (50%)
    NO 1 (50%) 0 (NA%) 1 (50%)
    Unknown 36 19 17
LINF_AXILAR 4 (11%) 0 (0%) 4 (24%) 0.040
    Unknown 2 0 2
LINF_CERVICAL 12 (32%) 4 (21%) 8 (42%) 0.2
LINF_INGUINAL 6 (17%) 1 (5.3%) 5 (29%) 0.081
    Unknown 2 0 2
LINF_OTROS 6 (17%) 1 (5.3%) 5 (29%) 0.081
    Unknown 2 0 2
LINF_ESP_OTROS >0.9
    RETROAURICULAR 1 (17%) 0 (0%) 1 (20%)
    SUBMANDIBULAR 5 (83%) 1 (100%) 4 (80%)
    Unknown 32 18 14
COMOR_DIABETES 2 (5.3%) 1 (5.3%) 1 (5.3%) >0.9
COMOR_NEOPLASIAS 1 (2.8%) 0 (0%) 1 (5.9%) 0.5
    Unknown 2 0 2
COMOR_HEPATITISC 0 (0%) 0 (0%) 0 (0%)
COMOR_GONORREA 0 (0%) 0 (0%) 0 (0%)
COMOR_CLAMIDIA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_HERPES 0 (0%) 0 (0%) 0 (0%)
COMOR_SIFILIS 1 (2.6%) 0 (0%) 1 (5.3%) >0.9
COMOR_VERRUGAS 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_MICOPLASMA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_TRICOMONIASIS 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_LINFOGRA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_VIH 11 (29%) 1 (5.3%) 10 (53%) 0.001
CD4 >0.9
    104 1 (25%) 0 (NA%) 1 (25%)
    119 1 (25%) 0 (NA%) 1 (25%)
    SIN CONTEO 1 (25%) 0 (NA%) 1 (25%)
    SIN DATOS 1 (25%) 0 (NA%) 1 (25%)
    Unknown 34 19 15
COMOR_OTRAS 2 (5.3%) 2 (11%) 0 (0%) 0.5
COMOR_NINGUNA 6 (17%) 2 (11%) 4 (24%) 0.4
    Unknown 2 0 2
COMOR_ESP_OTRAS1
    HIPERPLASI PROSTATICA BENIGNA 1 (100%) 1 (100%) 0 (NA%)
    Unknown 37 18 19
COMOR_ESP_OTRAS2 0 (NA%) 0 (NA%) 0 (NA%)
    Unknown 38 19 19
COMOR_ESP_OTRAS3 0 (NA%) 0 (NA%) 0 (NA%)
    Unknown 38 19 19
EMBARAZO
    2 38 (100%) 19 (100%) 19 (100%)
SDG 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
PUERPERIO 0.6
    0 3 (8.3%) 1 (5.3%) 2 (12%)
    2 33 (92%) 18 (95%) 15 (88%)
    Unknown 2 0 2
FEC_TOMA_LES_CUT1 2022-07-13 to 2022-12-06 2022-07-26 to 2022-12-06 2022-07-13 to 2022-11-25 0.7
    Unknown 2 0 2
1 n (%); Range
2 Pearson's Chi-squared test; Fisher's exact test; Wilcoxon rank sum test
dbvirsim
## # A tibble: 38 × 246
##    NUM_A…¹ FOLIO PRIME…² SEGUN…³ NOMBRE FEC_NAC             EDAD_A EDAD_M EDAD_D
##    <chr>   <dbl> <chr>   <chr>   <chr>  <dttm>               <dbl>  <dbl>  <dbl>
##  1 <NA>       90 GARCIA  ESPINO… ARTURO 1977-12-18 00:00:00     44      9     13
##  2 <NA>      155 CASILL… MERCADO SOPHI… 2014-04-22 00:00:00      8      6     18
##  3 <NA>      311 MEDINA  URIARTE CARLO… 2014-12-25 00:00:00      7     10     13
##  4 <NA>      312 PIÑA    GONZAL… SOFIA… 2009-06-25 00:00:00     13      4     15
##  5 <NA>      460 LEON    LOPEZ   JOSE … 1979-01-27 00:00:00     43      9     11
##  6 <NA>      676 PUGA    TORRES  HECTO… 1995-03-30 00:00:00     27      7     10
##  7 <NA>      835 BALTAZ… LOPEZ   FRANC… 1955-04-12 00:00:00     67      7     13
##  8 <NA>      928 PORTIL… CRUZ    ALFON… NA                      42      0      0
##  9 <NA>     1092 VALADEZ BENITEZ CARLO… NA                      28      0      0
## 10 <NA>     1261 BEJARA… PEREZ   GABRI… 1990-03-09 00:00:00     32      8      0
## # … with 28 more rows, 237 more variables: SEXO <chr>, GENERO <chr>,
## #   ORIENT_SEX <chr>, ESTADO_NAC <dbl>, DES_ESTADO_NAC <chr>, MUNIC_NAC <dbl>,
## #   DES_MUNIC_NAC <chr>, CURP <chr>, CALLE <chr>, NUM_EX <chr>, NUM_IN <chr>,
## #   COLONIA <chr>, ESTADO <dbl>, DES_ESTADO <chr>, JURISDIC <dbl>,
## #   DES_JURISDIC <chr>, MUNICIPIO <dbl>, DES_MUNICIPIO <chr>, LOCALIDAD <dbl>,
## #   DES_LOCALIDAD <chr>, ENTRE_CALL <chr>, Y_CALLE <lgl>, C_P <dbl>, TEL <chr>,
## #   RECON_INDIGENA <dbl>, HABLA_LENG_IND <dbl>, LENG_IND <dbl>, …
dbvirsim <- dbvirsim %>% mutate(status = ifelse(RESDEFVS == "POSITIVO", 1, 0))

dbvirsim$status
##  [1] 1 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 1 0
## EXANTEMA 

dbvirsim %>%
  select(EXA_MACULA:EXA_COSTRA, DISTRIB_EXA, RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
EXA_MACULA 19 (53%) 9 (47%) 10 (59%) 0.5
    Unknown 2 0 2
EXA_PAPULA 25 (69%) 10 (53%) 15 (88%) 0.021
    Unknown 2 0 2
EXA_VESICULA 33 (87%) 16 (84%) 17 (89%) >0.9
EXA_PUSTULA 20 (56%) 8 (42%) 12 (71%) 0.086
    Unknown 2 0 2
EXA_COSTRA 22 (61%) 9 (47%) 13 (76%) 0.074
    Unknown 2 0 2
DISTRIB_EXA 0.069
    Cefalocaudal 18 (50%) 12 (63%) 6 (35%)
    Centrífuga 9 (25%) 6 (32%) 3 (18%)
    Centrípeta 2 (5.6%) 0 (0%) 2 (12%)
    No Especificada 3 (8.3%) 0 (0%) 3 (18%)
    Otra 1 (2.8%) 0 (0%) 1 (5.9%)
    Simultánea 3 (8.3%) 1 (5.3%) 2 (12%)
    Unknown 2 0 2
1 n (%)
2 Pearson's Chi-squared test; Fisher's exact test
uvlm_tableEXA <- dbvirsim %>%
  select(EXA_MACULA:EXA_COSTRA, DISTRIB_EXA, status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 

uvlm_tableEXA
Characteristic N OR1 95% CI1 p-value
EXA_MACULA 36 1.59 0.43, 6.13 0.5
EXA_PAPULA 36 6.75 1.38, 50.8 0.030
EXA_VESICULA 38 1.59 0.23, 13.3 0.6
EXA_PUSTULA 36 3.30 0.86, 14.1 0.091
EXA_COSTRA 36 3.61 0.90, 16.7 0.080
DISTRIB_EXA 36
    Cefalocaudal
    Centrífuga 1.00 0.17, 5.37 >0.9
    Centrípeta 231,297,586 0.00, NA >0.9
    No Especificada 231,297,585 0.00, NA >0.9
    Otra 231,297,585 0.00, NA >0.9
    Simultánea 4.00 0.32, 96.9 0.3
1 OR = Odds Ratio, CI = Confidence Interval
## LOCALIZACICIÓN DE LA LESIO

dbvirsim %>%
  select(LEXAN_CABEZA:LEXAN_PALMAS, RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
LEXAN_CABEZA 22 (58%) 10 (53%) 12 (63%) 0.5
LEXAN_CARA 26 (68%) 12 (63%) 14 (74%) 0.5
LEXAN_CUELLO 20 (53%) 11 (58%) 9 (47%) 0.5
LEXAN_TORAX 23 (64%) 10 (53%) 13 (76%) 0.14
    Unknown 2 0 2
LEXAN_MIEM_SUP 30 (81%) 17 (89%) 13 (72%) 0.2
    Unknown 1 0 1
LEXAN_MIEM_INF 25 (68%) 13 (68%) 12 (67%) >0.9
    Unknown 1 0 1
LEXAN_MUC_ORAL 3 (8.3%) 2 (11%) 1 (5.9%) >0.9
    Unknown 2 0 2
LEXAN_GENITALES 13 (35%) 5 (26%) 8 (44%) 0.2
    Unknown 1 0 1
LEXAN_ABDOMEN 13 (36%) 7 (37%) 6 (35%) >0.9
    Unknown 2 0 2
LEXAN_ESPALDA 18 (50%) 11 (58%) 7 (41%) 0.3
    Unknown 2 0 2
LEXAN_REG_PERI 4 (11%) 2 (11%) 2 (12%) >0.9
    Unknown 2 0 2
LEXAN_PLANTAS 6 (17%) 4 (21%) 2 (12%) 0.7
    Unknown 2 0 2
LEXAN_PALMAS 13 (36%) 6 (32%) 7 (41%) 0.5
    Unknown 2 0 2
1 n (%)
2 Pearson's Chi-squared test; Fisher's exact test
uvlm_tableLEXA <- dbvirsim %>%
  select(LEXAN_CABEZA:LEXAN_PALMAS, status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 

uvlm_tableLEXA
Characteristic N OR1 95% CI1 p-value
LEXAN_CABEZA 38 1.54 0.42, 5.81 0.5
LEXAN_CARA 38 1.63 0.41, 6.84 0.5
LEXAN_CUELLO 38 0.65 0.18, 2.35 0.5
LEXAN_TORAX 36 2.92 0.73, 13.5 0.14
LEXAN_MIEM_SUP 37 0.31 0.04, 1.67 0.2
LEXAN_MIEM_INF 37 0.92 0.23, 3.72 >0.9
LEXAN_MUC_ORAL 36 0.53 0.02, 6.08 0.6
LEXAN_GENITALES 37 2.24 0.57, 9.44 0.3
LEXAN_ABDOMEN 36 0.94 0.23, 3.69 >0.9
LEXAN_ESPALDA 36 0.51 0.13, 1.90 0.3
LEXAN_REG_PERI 36 1.13 0.12, 10.4 >0.9
LEXAN_PLANTAS 36 0.50 0.06, 2.97 0.5
LEXAN_PALMAS 36 1.52 0.39, 6.14 0.6
1 OR = Odds Ratio, CI = Confidence Interval
## CLINICA

dbvirsim %>%
  select(FIEBRE:DOLOROSAS, RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
## Warning for variable 'FEC_INI_FIEBRE':
## simpleWarning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot compute exact p-value with ties
## Warning for variable 'TOS':
## simpleWarning in stats::chisq.test(x = c(2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 2, : Chi-squared approximation may be incorrect
## There was an error in 'add_p()/add_difference()' for variable 'CONJUNTIVITIS', p-value omitted:
## Error in stats::chisq.test(x = c(2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, : 'x' and 'y' must have at least 2 levels
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
FIEBRE 0.046
    1 33 (87%) 14 (74%) 19 (100%)
    2 5 (13%) 5 (26%) 0 (0%)
CUANT_FIEBRE 0.053
    0 5 (14%) 5 (26%) 0 (0%)
    38 21 (58%) 8 (42%) 13 (76%)
    38.3 1 (2.8%) 1 (5.3%) 0 (0%)
    38.5 1 (2.8%) 0 (0%) 1 (5.9%)
    38.7 1 (2.8%) 1 (5.3%) 0 (0%)
    39 6 (17%) 3 (16%) 3 (18%)
    40 1 (2.8%) 1 (5.3%) 0 (0%)
    Unknown 2 0 2
FEC_INI_FIEBRE 2022-05-24 to 2022-11-23 2022-07-18 to 2022-11-12 2022-05-24 to 2022-11-23 >0.9
    Unknown 5 5 0
CEFALEA >0.9
    1 29 (76%) 14 (74%) 15 (79%)
    2 9 (24%) 5 (26%) 4 (21%)
ARTRALGIAS 0.10
    1 21 (55%) 8 (42%) 13 (68%)
    2 17 (45%) 11 (58%) 6 (32%)
NAUSEA 0.2
    1 7 (19%) 2 (11%) 5 (29%)
    2 29 (81%) 17 (89%) 12 (71%)
    Unknown 2 0 2
MIALGIAS 0.2
    1 26 (68%) 11 (58%) 15 (79%)
    2 12 (32%) 8 (42%) 4 (21%)
LUMBALGIA 0.048
    1 15 (42%) 5 (26%) 10 (59%)
    2 21 (58%) 14 (74%) 7 (41%)
    Unknown 2 0 2
VOMITO 0.5
    1 1 (2.8%) 0 (0%) 1 (5.9%)
    2 35 (97%) 19 (100%) 16 (94%)
    Unknown 2 0 2
ASTENIA 0.009
    1 22 (58%) 7 (37%) 15 (79%)
    2 16 (42%) 12 (63%) 4 (21%)
TOS 0.3
    1 10 (28%) 4 (21%) 6 (35%)
    2 26 (72%) 15 (79%) 11 (65%)
    Unknown 2 0 2
ODINOFAGIA 0.4
    1 8 (22%) 3 (16%) 5 (29%)
    2 28 (78%) 16 (84%) 12 (71%)
    Unknown 2 0 2
ESCALOFRIOS 0.070
    1 15 (41%) 5 (26%) 10 (56%)
    2 22 (59%) 14 (74%) 8 (44%)
    Unknown 1 0 1
DIAFORESIS 0.2
    1 7 (19%) 2 (11%) 5 (29%)
    2 29 (81%) 17 (89%) 12 (71%)
    Unknown 2 0 2
CONJUNTIVITIS
    2 36 (100%) 19 (100%) 17 (100%)
    Unknown 2 0 2
SANGRANTES 0.2
    1 2 (5.6%) 0 (0%) 2 (12%)
    2 34 (94%) 19 (100%) 15 (88%)
    Unknown 2 0 2
DOLOROSAS 0.040
    1 4 (11%) 0 (0%) 4 (24%)
    2 32 (89%) 19 (100%) 13 (76%)
    Unknown 2 0 2
1 n (%); Range
2 Fisher's exact test; Wilcoxon rank sum test; Pearson's Chi-squared test
uvlm_tableCLIN <- dbvirsim %>%
  select(FIEBRE:DOLOROSAS, status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 

uvlm_tableCLIN
Characteristic N OR1 95% CI1 p-value
FIEBRE 38 0.00 >0.9
CUANT_FIEBRE 36 1.13 1.02, NA 0.3
FEC_INI_FIEBRE 33 1.00 1.00, 1.00 >0.9
CEFALEA 38 0.75 0.16, 3.38 0.7
ARTRALGIAS 38 0.34 0.08, 1.23 0.11
NAUSEA 36 0.28 0.04, 1.55 0.2
MIALGIAS 38 0.37 0.08, 1.48 0.2
LUMBALGIA 36 0.25 0.06, 0.98 0.053
VOMITO 36 0.00 >0.9
ASTENIA 38 0.16 0.03, 0.62 0.012
TOS 36 0.49 0.10, 2.12 0.3
ODINOFAGIA 36 0.45 0.08, 2.20 0.3
ESCALOFRIOS 37 0.29 0.07, 1.10 0.075
DIAFORESIS 36 0.28 0.04, 1.55 0.2
CONJUNTIVITIS 36
SANGRANTES 36 0.00 >0.9
DOLOROSAS 36 0.00 >0.9
1 OR = Odds Ratio, CI = Confidence Interval
#LINFADENITIS

dbvirsim %>%
  select(LINF_AXILAR:LINF_ESP_OTROS, RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
LINF_AXILAR 4 (11%) 0 (0%) 4 (24%) 0.040
    Unknown 2 0 2
LINF_CERVICAL 12 (32%) 4 (21%) 8 (42%) 0.2
LINF_INGUINAL 6 (17%) 1 (5.3%) 5 (29%) 0.081
    Unknown 2 0 2
LINF_OTROS 6 (17%) 1 (5.3%) 5 (29%) 0.081
    Unknown 2 0 2
LINF_ESP_OTROS >0.9
    RETROAURICULAR 1 (17%) 0 (0%) 1 (20%)
    SUBMANDIBULAR 5 (83%) 1 (100%) 4 (80%)
    Unknown 32 18 14
1 n (%)
2 Fisher's exact test; Pearson's Chi-squared test
uvlm_tableLINF <- dbvirsim %>%
  select(LINF_AXILAR:LINF_ESP_OTROS, status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 

uvlm_tableLINF
Characteristic N OR1 95% CI1 p-value
LINF_AXILAR 36 62,180,880 0.00, NA >0.9
LINF_CERVICAL 38 2.73 0.68, 12.5 0.2
LINF_INGUINAL 36 7.50 1.04, 153 0.082
LINF_OTROS 36 7.50 1.04, 153 0.082
LINF_ESP_OTROS 6
    RETROAURICULAR
    SUBMANDIBULAR 0.00 >0.9
1 OR = Odds Ratio, CI = Confidence Interval
#COMORBILIDADES

dbvirsim %>%
  select(COMOR_DIABETES:COMOR_VIH,RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_HEPATITISC', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_GONORREA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_CLAMIDIA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_HERPES', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_VERRUGAS', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_MICOPLASMA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_TRICOMONIASIS', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
## There was an error in 'add_p()/add_difference()' for variable 'COMOR_LINFOGRA', p-value omitted:
## Error in stats::chisq.test(x = c(0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, : 'x' and 'y' must have at least 2 levels
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
COMOR_DIABETES 2 (5.3%) 1 (5.3%) 1 (5.3%) >0.9
COMOR_NEOPLASIAS 1 (2.8%) 0 (0%) 1 (5.9%) 0.5
    Unknown 2 0 2
COMOR_HEPATITISC 0 (0%) 0 (0%) 0 (0%)
COMOR_GONORREA 0 (0%) 0 (0%) 0 (0%)
COMOR_CLAMIDIA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_HERPES 0 (0%) 0 (0%) 0 (0%)
COMOR_SIFILIS 1 (2.6%) 0 (0%) 1 (5.3%) >0.9
COMOR_VERRUGAS 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_MICOPLASMA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_TRICOMONIASIS 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_LINFOGRA 0 (0%) 0 (0%) 0 (0%)
    Unknown 2 0 2
COMOR_VIH 11 (29%) 1 (5.3%) 10 (53%) 0.001
1 n (%)
2 Fisher's exact test; Pearson's Chi-squared test
vlm_tableCOMORBO <- dbvirsim %>%
  select(COMOR_DIABETES:COMOR_VIH, status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 



vlm_tableCOMORBO
Characteristic N OR1 95% CI1 p-value
COMOR_DIABETES 38 1.00 0.04, 26.6 >0.9
COMOR_NEOPLASIAS 36 18,585,991 0.00, NA >0.9
COMOR_HEPATITISC 38
COMOR_GONORREA 38
COMOR_CLAMIDIA 36
COMOR_HERPES 38
COMOR_SIFILIS 38 16,520,881 0.00, NA >0.9
COMOR_VERRUGAS 36
COMOR_MICOPLASMA 36
COMOR_TRICOMONIASIS 36
COMOR_LINFOGRA 36
COMOR_VIH 38 20.0 3.12, 398 0.008
1 OR = Odds Ratio, CI = Confidence Interval
glimpse(dbvirsim)
## Rows: 38
## Columns: 247
## $ NUM_AFILIA_EXPED           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FOLIO                      <dbl> 90, 155, 311, 312, 460, 676, 835, 928, 1092…
## $ PRIMER_AP                  <chr> "GARCIA", "CASILLAS", "MEDINA", "PIÑA", "LE…
## $ SEGUNDO_AP                 <chr> "ESPINOZA", "MERCADO", "URIARTE", "GONZALEZ…
## $ NOMBRE                     <chr> "ARTURO", "SOPHIA ISABEL", "CARLOS EDEL", "…
## $ FEC_NAC                    <dttm> 1977-12-18, 2014-04-22, 2014-12-25, 2009-0…
## $ EDAD_A                     <dbl> 44, 8, 7, 13, 43, 27, 67, 42, 28, 32, 39, 3…
## $ EDAD_M                     <dbl> 9, 6, 10, 4, 9, 7, 7, 0, 0, 8, 4, 0, 10, 5,…
## $ EDAD_D                     <dbl> 13, 18, 13, 15, 11, 10, 13, 0, 0, 0, 16, 29…
## $ SEXO                       <chr> "Hombre", "Mujer", "Hombre", "Mujer", "Homb…
## $ GENERO                     <chr> "Hombre", "Mujer", "Hombre", "Mujer", "Homb…
## $ ORIENT_SEX                 <chr> "Gay", "Heterosexual", "Heterosexual", "Het…
## $ ESTADO_NAC                 <dbl> 25, 25, 25, 25, 25, 25, 25, NA, NA, 25, 30,…
## $ DES_ESTADO_NAC             <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ MUNIC_NAC                  <dbl> 6, 6, 6, 6, 6, 12, 6, NA, NA, 6, 69, 12, 12…
## $ DES_MUNIC_NAC              <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ CURP                       <chr> "GAEA771218HSLRSR08", "CAMS140422MSLSRPA9",…
## $ CALLE                      <chr> "ESTERO DE CHAMETLA", "LOS TULES", "MONTE D…
## $ NUM_EX                     <chr> "3217", "1996", "5003", "94", "S/N", "SIN N…
## $ NUM_IN                     <chr> "S/N", "S/N", "S/N", "S/N", "S/N", "SIN NUM…
## $ COLONIA                    <chr> "PRADERA DORADA", NA, NA, NA, NA, NA, NA, N…
## $ ESTADO                     <dbl> 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,…
## $ DES_ESTADO                 <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ JURISDIC                   <dbl> 4, 4, 4, 4, 4, 5, 4, 6, 6, 4, 4, 5, 5, 5, 5…
## $ DES_JURISDIC               <chr> "JURISDICCION SANITARIA IV CULIACAN", "JURI…
## $ MUNICIPIO                  <dbl> 6, 6, 6, 6, 6, 12, 6, 12, 12, 6, 6, 12, 12,…
## $ DES_MUNICIPIO              <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ LOCALIDAD                  <dbl> 1, 1, 1, 1, 968, 1, 1, NA, NA, 1, 1, 1, 1, …
## $ DES_LOCALIDAD              <chr> "CULIACÁN ROSALES", "CULIACÁN ROSALES", "CU…
## $ ENTRE_CALL                 <chr> "S/R", "S/R", "CIMA EVEREST Y CIMA ORIZABA"…
## $ Y_CALLE                    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ C_P                        <dbl> 80058, 80058, 80295, 80190, 80450, 82089, 8…
## $ TEL                        <chr> "6672444166", "6673387097|", "6673503153", …
## $ RECON_INDIGENA             <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ HABLA_LENG_IND             <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ LENG_IND                   <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ DES_LENG_IND               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ OCUPACION                  <dbl> 10, 33, 12, 12, 33, 20, 9, NA, NA, 29, 33, …
## $ DES_OCUPACION              <chr> "Empleados(as)", "Otros", "Estudiantes", "E…
## $ DIR_LABORAL                <chr> NA, NA, NA, NA, NA, "EGA INDUSTRIAL ZONA NO…
## $ MIGRANTE                   <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ NACIONALIDAD               <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_ORIGEN                <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO1             <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO2             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ PAIS_TRANSITO3             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_INGRESO_MEX            <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ NOM_UNIDAD                 <chr> "UMF 36 CULIACAN", "HOSPITAL PEDIÁTRICO DE …
## $ ESTADO_UNIDAD              <dbl> 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,…
## $ DES_ESTADO_UNIDAD          <chr> "Sinaloa", "Sinaloa", "Sinaloa", "Sinaloa",…
## $ JURISD_UNIDAD              <dbl> 4, 4, 4, 4, 4, 5, 4, 5, 5, 4, 4, 5, 5, 5, 5…
## $ DES_JURISD_UNIDAD          <chr> "JURISDICCION SANITARIA IV CULIACAN", "JURI…
## $ CLUES                      <chr> "SLIMS000155", "SLSSA002556", "SLSSA002556"…
## $ MUN_UNIDAD                 <dbl> 6, 6, 6, 6, 6, 12, 6, 12, 12, 6, 6, 12, 12,…
## $ DES_MUN_UNIDAD             <chr> "CULIACAN", "CULIACAN", "CULIACAN", "CULIAC…
## $ LOC_UNIDAD                 <dbl> 1, 1, 1, 1, 1194, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ DES_LOC_UNIDAD             <chr> "CULIACÁN ROSALES", "CULIACÁN ROSALES", "CU…
## $ INST_UNIDAD                <dbl> 2, 1, 1, 3, 1, 2, 1, 3, 3, 3, 1, 1, 2, 3, 1…
## $ DES_INST_UNIDAD            <chr> "IMSS", "SSA", "SSA", "ISSSTE", "SSA", "IMS…
## $ FEC_PRIM_CONTACTO_SS       <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ FEC_NOT_JUR                <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ FEC_NOT_EST                <dttm> 2022-07-13, 2022-07-27, 2022-08-04, 2022-0…
## $ FEC_NOT_DGE                <dttm> 2022-07-13, 2022-07-27, 2022-08-04, 2022-0…
## $ FEC_INI_EST_EPI            <dttm> 2022-07-13, 2022-07-23, 2022-08-02, 2022-0…
## $ VIAJE                      <dbl> 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2…
## $ PAIS_VIAJE1                <chr> "México", NA, NA, NA, NA, NA, NA, NA, NA, "…
## $ ESTADO_VIAJE1              <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ MUN_VIAJE1                 <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ LOC_VIAJE1                 <chr> "CIUDAD DE MEXICO", NA, NA, NA, NA, NA, NA,…
## $ FEC_ENT_VIAJE1             <dttm> 2022-07-23, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_SAL_VIAJE1             <dttm> 2022-07-27, NA, NA, NA, NA, NA, NA, NA, NA…
## $ TIEMP_ESTANCIA1            <dbl> 4, 0, 0, 0, 0, 0, 0, NA, NA, 7, 1, 14, 1, 0…
## $ PAIS_VIAJE2                <chr> "México", NA, NA, NA, NA, NA, NA, NA, NA, N…
## $ ESTADO_VIAJE2              <chr> "JALISCO", NA, NA, NA, NA, NA, NA, NA, NA, …
## $ MUN_VIAJE2                 <chr> "GUADALAJARA", NA, NA, NA, NA, NA, NA, NA, …
## $ LOC_VIAJE2                 <chr> "GUADALAJARA", NA, NA, NA, NA, NA, NA, NA, …
## $ FEC_ENT_VIAJE2             <dttm> 2022-06-27, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_SAL_VIAJE2             <dttm> 2022-07-04, NA, NA, NA, NA, NA, NA, NA, NA…
## $ TIEMP_ESTANCIA2            <dbl> 8, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 6, 0,…
## $ PROCEDENCIA                <chr> "De la Jurisdicción", "De la Jurisdicción",…
## $ ESTUVO                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 1, 1, 2,…
## $ CONFIRM_LABOR              <dbl> NA, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2…
## $ FOLIO_CONFIRM              <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CUAL_ENTORNO               <chr> "Evento Masivo Sin Contacto Sexual", "Casa"…
## $ ESPECIFIQUE_LU             <chr> NA, NA, "VISITA CASA ZONA RURAL", "VIA PUBL…
## $ ESPECIFIQUE_FE             <dttm> NA, NA, 2022-07-22, NA, NA, NA, NA, NA, NA…
## $ CONT_MASC_DOMEST           <dbl> 0, 0, 0, 0, 0, 1, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ CONT_ROEDORES              <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ROED_SALV             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ANIM_SALV             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_OTROS                 <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ CONT_ESP_OTROS             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MEC_TRANSM                 <chr> "Persona a persona (Excepto las opciones an…
## $ ESPEC_MEC_TRANS            <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FECHA_INI_SIGNOS           <dttm> 2022-07-10, 2022-07-19, 2022-07-29, 2022-0…
## $ FECHA_INI_EXANT            <dttm> 2022-07-10, 2022-07-19, 2022-07-29, 2022-0…
## $ EXA_MACULA                 <dbl> 1, 0, 0, 1, 0, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ EXA_PAPULA                 <dbl> 1, 1, 0, 1, 1, 1, 0, NA, NA, 0, 0, 1, 1, 1,…
## $ EXA_VESICULA               <dbl> 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1…
## $ EXA_PUSTULA                <dbl> 0, 0, 0, 0, 1, 1, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ EXA_COSTRA                 <dbl> 1, 1, 0, 0, 0, 1, 1, NA, NA, 0, 1, 0, 1, 1,…
## $ DISTRIB_EXA                <chr> "Cefalocaudal", "Cefalocaudal", "Centrífuga…
## $ LEXAN_CABEZA               <dbl> 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0…
## $ LEXAN_CARA                 <dbl> 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0…
## $ LEXAN_CUELLO               <dbl> 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0…
## $ LEXAN_TORAX                <dbl> 1, 1, 0, 0, 1, 1, 1, NA, NA, 0, 1, 0, 0, 1,…
## $ LEXAN_MIEM_SUP             <dbl> 0, 0, 1, 1, 1, 0, 0, 1, NA, 1, 1, 1, 1, 1, …
## $ LEXAN_MIEM_INF             <dbl> 0, 0, 1, 1, 1, 1, 0, NA, 1, 0, 1, 0, 1, 1, …
## $ LEXAN_MUC_ORAL             <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ LEXAN_GENITALES            <dbl> 0, 1, 0, 0, 1, 1, 0, 1, NA, 0, 0, 0, 1, 1, …
## $ LEXAN_ABDOMEN              <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 1, 0, 1,…
## $ LEXAN_ESPALDA              <dbl> 1, 0, 0, 0, 1, 0, 0, NA, NA, 1, 1, 0, 0, 1,…
## $ LEXAN_REG_PERI             <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 1,…
## $ LEXAN_PLANTAS              <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 0, 1,…
## $ LEXAN_PALMAS               <dbl> 0, 0, 0, 0, 1, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ FIEBRE                     <dbl> 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ CUANT_FIEBRE               <dbl> 38.0, 38.7, 40.0, 0.0, 38.0, 38.0, 38.0, NA…
## $ FEC_INI_FIEBRE             <dttm> 2022-07-10, 2022-07-18, 2022-07-29, NA, 20…
## $ CEFALEA                    <dbl> 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2…
## $ ARTRALGIAS                 <dbl> 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2…
## $ NAUSEA                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 1, 2, 2, 1, 2,…
## $ MIALGIAS                   <dbl> 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ LUMBALGIA                  <dbl> 2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 1, 1, 1,…
## $ VOMITO                     <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ ASTENIA                    <dbl> 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1…
## $ TOS                        <dbl> 2, 2, 2, 2, 2, 1, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ ODINOFAGIA                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 1, 2,…
## $ ESCALOFRIOS                <dbl> 2, 2, 2, 2, 2, 1, 2, NA, 1, 2, 1, 2, 1, 1, …
## $ DIAFORESIS                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ CONJUNTIVITIS              <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ SANGRANTES                 <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ DOLOROSAS                  <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ OTRAS_COMOR                <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ LINF_AXILAR                <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ LINF_CERVICAL              <dbl> 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0…
## $ LINF_INGUINAL              <dbl> 0, 0, 0, 0, 0, 0, 1, NA, NA, 0, 0, 1, 1, 0,…
## $ LINF_OTROS                 <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 1, 0,…
## $ LINF_ESP_OTROS             <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_DIABETES             <dbl> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_NEOPLASIAS           <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_HEPATITISC           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_GONORREA             <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_CLAMIDIA             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_HERPES               <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_SIFILIS              <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_VERRUGAS             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_MICOPLASMA           <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_TRICOMONIASIS        <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_LINFOGRA             <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ COMOR_VIH                  <dbl> 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0…
## $ CD4                        <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_OTRAS                <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
## $ COMOR_NINGUNA              <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 1, 1,…
## $ COMOR_ESP_OTRAS1           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_ESP_OTRAS2           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ COMOR_ESP_OTRAS3           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ EMBARAZO                   <dbl> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ SDG                        <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ PUERPERIO                  <dbl> 0, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ FEC_TOMA_LES_CUT1          <dttm> 2022-07-13, 2022-07-26, 2022-08-02, 2022-0…
## $ FEC_ENV_LESP_LES_CUT1      <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 20…
## $ FEC_RECEP_LESP_LES_CUT1    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, 2022-0…
## $ FEC_ENV_INDRE_LES_CUT1     <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_RECEP_INDRE_LES_CUT1   <dttm> 2022-07-15, 2022-07-26, 2022-08-05, 2022-0…
## $ CAL_MTRA_LESP_LES_CUT1     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LES_CUT1   <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LES_CUT1     <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ CAL_MTRA_INDRE_LES_CUT1    <dbl> 1, 1, 1, 1, 1, NA, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ MOTIV_RECH_INDRE_LES_CUT1  <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_LES_CUT1    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_RESUL_LES_CUT1         <dttm> 2022-07-16, 2022-07-28, 2022-08-06, 2022-0…
## $ RESULTADO_LES_CUT11        <chr> "Positivo a virus de viruela símica", "Nega…
## $ RESDEFVS                   <chr> "POSITIVO", "NEGATIVO", "NEGATIVO", "NEGATI…
## $ `POSITIVO OTRO`            <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "VHH3",…
## $ RESULTADO_VIRUEL1          <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "Positi…
## $ RESULTADO_HERPES1          <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LES_CUT1             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_CUT11          <dbl> 1, 1, 1, 1, 1, NA, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ FEC_TOMA_LES_CUT2          <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_LESP_LES_CUT2      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_LES_CUT2    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_LES_CUT2     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_LES_CUT2   <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ CAL_MTRA_LESP_LES_CUT2     <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LES_CUT2   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LES_CUT2     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_LES_CUT2         <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ RESULTADO_LES_CUT21        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LES_CUT22        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LES_CUT23        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LES_CUT2             <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_CUT21          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_TOMA_EX_FAR            <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ FEC_ENV_LESP_EX_FAR        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_EX_FAR      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_EX_FAR       <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_EX_FAR     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_LESP_EX_FAR       <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_EX_FAR     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_EX_FAR       <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_INDRE_EX_FAR      <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MOTIV_RECH_INDRE_EX_FAR    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_EX_FAR      <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_EX_FAR           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_EX_FAR           <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_EX_FAR               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LES_EX_FAR         <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TIPO_BIOPSIA               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_TOMA_LIQ_CEFAL         <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_LESP_LIQ_CEFAL     <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_LESP_LIQ_CEFAL   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_ENV_INDRE_LIQ_CEFAL    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECEP_INDRE_LIQ_CEFAL  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_LESP_LIQ_CEFAL    <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 0, N…
## $ MOTIV_RECH_LESP_LIQ_CEFAL  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_LESP_LIQ_CEFAL    <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CAL_MTRA_INDRE_LIQ_CEFAL   <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ MOTIV_RECH_INDRE_LIQ_CEFAL <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RECH_INDRE_LIQ_CEFAL   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ FEC_RESUL_LIQ_CEFAL        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ RESULTADO_LIQ_CEFAL        <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ CLADO_LIQ_CEFAL            <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ TECNICA_LIQ_CEFAL          <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ DES_LAB_PROC               <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ HOSPITALIZADO              <dbl> 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2…
## $ FEC_HOSPITAL               <dttm> NA, NA, NA, NA, NA, NA, 2022-08-17, NA, NA…
## $ CUID_INTENSIV              <dbl> 2, 2, 2, 2, 0, 2, 2, NA, NA, 0, 2, 2, 2, 2,…
## $ TRATAMIENTO                <dbl> 2, 2, 1, 2, 2, 1, 1, NA, NA, 2, 2, 1, 2, 1,…
## $ FEC_INI_TRATAM             <dttm> NA, NA, 2022-08-02, NA, NA, 2022-08-03, 20…
## $ TIPO_TRATAM                <dbl> 0, 0, 2, 0, 0, 1, 1, NA, NA, 0, 0, 2, 0, 1,…
## $ OTRO_ESPECIF_TRAT          <dbl> 0, 0, 0, 0, 0, 0, 0, NA, NA, 0, 0, 0, 0, 0,…
## $ SITUACION_ACTUAL           <dbl> 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3…
## $ FEC_ALTA                   <dttm> 2022-07-13, 2022-07-28, 2022-08-06, 2022-0…
## $ DEFUNCION                  <dbl> 2, 2, 2, 2, 2, 2, 2, NA, NA, 2, 2, 2, 2, 2,…
## $ FEC_DEFUN                  <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ NUM_CONTACT_D              <dbl> 4, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0…
## $ FEC_CLASIFICACION          <dttm> 2022-07-16, 2022-07-27, 2022-08-06, 2022-0…
## $ DIAG_FINAL                 <dbl> 2, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2…
## $ OTRO_DIAG                  <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ OBSERVACIONES              <chr> "EN ESTUDIO", NA, NA, NA, NA, NA, NA, NA, N…
## $ NOM_ELAB_EST_EPI           <chr> "CISNEROS AVENDAÑO FRANCISCO ENRIQUE", "ROS…
## $ NOM_VALID                  <chr> "CISNEROS AVENDAÑO FRANCISCO ENRIQUE", "EPI…
## $ CARGO_VALID                <chr> "EPIDEMIOLÓGIA", "PAULINA HERNANDEZ CRUZ", …
## $ TEL_VALID                  <chr> "6671765692", "6672381056", "6672381056", "…
## $ CVE_USU                    <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, "1US012…
## $ FEC_CAP                    <dttm> NA, NA, NA, NA, NA, NA, NA, NA, NA, 2022-0…
## $ status                     <dbl> 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1…

MODELO CONSTRUIDO CON VARIABLES SIGNIFICATIVAS

dbvirsim %>% select(GENERO, ORIENT_SEX, MEC_TRANSM,FIEBRE,LUMBALGIA,ASTENIA,DOLOROSAS,COMOR_VIH, EXA_PAPULA,LINF_AXILAR,RESDEFVS) %>% tbl_summary(by=RESDEFVS) %>% add_p() %>%  add_overall()
Characteristic Overall, N = 381 NEGATIVO, N = 191 POSITIVO, N = 191 p-value2
GENERO 0.008
    Hombre 31 (82%) 12 (63%) 19 (100%)
    Mujer 7 (18%) 7 (37%) 0 (0%)
ORIENT_SEX <0.001
    Bisexual 3 (7.9%) 0 (0%) 3 (16%)
    Gay 13 (34%) 2 (11%) 11 (58%)
    Heterosexual 20 (53%) 17 (89%) 3 (16%)
    Hombres que tienen sexo con hombres 2 (5.3%) 0 (0%) 2 (11%)
MEC_TRANSM 0.016
    Desconocida 14 (37%) 9 (47%) 5 (26%)
    En los Servicios Salud 1 (2.6%) 1 (5.3%) 0 (0%)
    Persona a persona (Excepto las opciones anteriores) 13 (34%) 8 (42%) 5 (26%)
    Sexual 10 (26%) 1 (5.3%) 9 (47%)
FIEBRE 0.046
    1 33 (87%) 14 (74%) 19 (100%)
    2 5 (13%) 5 (26%) 0 (0%)
LUMBALGIA 0.048
    1 15 (42%) 5 (26%) 10 (59%)
    2 21 (58%) 14 (74%) 7 (41%)
    Unknown 2 0 2
ASTENIA 0.009
    1 22 (58%) 7 (37%) 15 (79%)
    2 16 (42%) 12 (63%) 4 (21%)
DOLOROSAS 0.040
    1 4 (11%) 0 (0%) 4 (24%)
    2 32 (89%) 19 (100%) 13 (76%)
    Unknown 2 0 2
COMOR_VIH 11 (29%) 1 (5.3%) 10 (53%) 0.001
EXA_PAPULA 25 (69%) 10 (53%) 15 (88%) 0.021
    Unknown 2 0 2
LINF_AXILAR 4 (11%) 0 (0%) 4 (24%) 0.040
    Unknown 2 0 2
1 n (%)
2 Fisher's exact test; Pearson's Chi-squared test
#EXA_PAPULA, EXA_PUSTULA, EXA_COSTRA, LUMBALGIA, ASTENIA, ESCALOFRIOS, LINF_INGUINAL, LINF_OTROS, #COMOR_VIH

dbvirsim %>% select(GENERO, ORIENT_SEX, MEC_TRANSM,FIEBRE,LUMBALGIA,ASTENIA,DOLOROSAS,COMOR_VIH, EXA_PAPULA,LINF_AXILAR,status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
## collapsing to unique 'x' values
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
Characteristic N OR1 95% CI1 p-value
GENERO 38
    Hombre
    Mujer 0.00 >0.9
ORIENT_SEX 38
    Bisexual
    Gay 0.00 >0.9
    Heterosexual 0.00 >0.9
    Hombres que tienen sexo con hombres 1.00 0.00, Inf >0.9
MEC_TRANSM 38
    Desconocida
    En los Servicios Salud 0.00 >0.9
    Persona a persona (Excepto las opciones anteriores) 1.13 0.23, 5.52 0.9
    Sexual 16.2 2.14, 347 0.020
FIEBRE 38 0.00 >0.9
LUMBALGIA 36 0.25 0.06, 0.98 0.053
ASTENIA 38 0.16 0.03, 0.62 0.012
DOLOROSAS 36 0.00 >0.9
COMOR_VIH 38 20.0 3.12, 398 0.008
EXA_PAPULA 36 6.75 1.38, 50.8 0.030
LINF_AXILAR 36 62,180,880 0.00, NA >0.9
1 OR = Odds Ratio, CI = Confidence Interval

significativos en el modelo

dbvirsim %>% select(EXA_PAPULA, LUMBALGIA, ASTENIA, LINF_INGUINAL, COMOR_VIH,status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 
Characteristic N OR1 95% CI1 p-value
EXA_PAPULA 36 6.75 1.38, 50.8 0.030
LUMBALGIA 36 0.25 0.06, 0.98 0.053
ASTENIA 38 0.16 0.03, 0.62 0.012
LINF_INGUINAL 36 7.50 1.04, 153 0.082
COMOR_VIH 38 20.0 3.12, 398 0.008
1 OR = Odds Ratio, CI = Confidence Interval

#FOREST PLOTS

dbvirsimica<-dbvirsim %>% select(EXA_PAPULA,EXA_PUSTULA, EXA_COSTRA, LUMBALGIA, ASTENIA, ESCALOFRIOS, LINF_INGUINAL, LINF_OTROS, COMOR_VIH,status)

#write_xlsx(dbvirsimica,"C:/Users/fidel/OneDrive - CINVESTAV/Proyecto colaboración SSA/base de datos/Viruelasimica/dbvirsimica.xlsx")

dbvirsimica <- dbvirsimica %>% mutate(EXA_PAPULA=recode(EXA_PAPULA, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      EXA_COSTRA=recode(EXA_COSTRA, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      EXA_PUSTULA=recode(EXA_PUSTULA, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      LUMBALGIA=recode(LUMBALGIA, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      ASTENIA=recode(ASTENIA, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      ESCALOFRIOS=recode(ESCALOFRIOS, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      LINF_INGUINAL=recode(ESCALOFRIOS, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      LINF_OTROS=recode(ESCALOFRIOS, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      COMOR_VIH=recode(ESCALOFRIOS, `0` = "Negative", 
                                                    `1` = "Positive"))

                                      


dbvirsimica<- dbvirsimica %>% drop_na()



library(finalfit)
explanatory <- c("EXA_PAPULA", "EXA_COSTRA")

dependent <- "status"

dbvirsimica %>% 
  or_plot(dependent, explanatory, 
          breaks = c(0.5, 1, 5, 10, 20, 30),
          table_text_size = 3.5)
## Waiting for profiling to be done...
## Waiting for profiling to be done...
## Waiting for profiling to be done...
## Warning: Removed 2 rows containing missing values (`geom_errorbarh()`).

#write_xlsx(dbvirsimica,"C:/Users/fidel/OneDrive - CINVESTAV/Proyecto colaboración SSA/base de datos/Viruelasimica/dbvirsimica.xlsx")
str(dbvirsimica)
## tibble [36 × 10] (S3: tbl_df/tbl/data.frame)
##  $ EXA_PAPULA   : chr [1:36] "Positive" "Positive" "Negative" "Positive" ...
##  $ EXA_PUSTULA  : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ EXA_COSTRA   : chr [1:36] "Positive" "Positive" "Negative" "Negative" ...
##  $ LUMBALGIA    : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ ASTENIA      : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ ESCALOFRIOS  : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ LINF_INGUINAL: chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ LINF_OTROS   : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ COMOR_VIH    : chr [1:36] "Negative" "Negative" "Negative" "Negative" ...
##  $ status       : num [1:36] 1 0 0 0 0 1 0 0 0 1 ...
library(tidyverse)
library(finalfit)
library(gt)


dbvirsimica<-dbvirsim %>% select(GENERO, ORIENT_SEX, MEC_TRANSM,FIEBRE,LUMBALGIA,ASTENIA,DOLOROSAS,COMOR_VIH, EXA_PAPULA,LINF_AXILAR,status)


dbvirsimica <- dbvirsimica %>% mutate(FIEBRE=recode(FIEBRE, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      LUMBALGIA=recode(LUMBALGIA, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      ASTENIA=recode(ASTENIA, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      LUMBALGIA=recode(LUMBALGIA, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      DOLOROSAS=recode(DOLOROSAS, `2` = "Negative", 
                                                    `1` = "Positive"),
                                      COMOR_VIH=recode(COMOR_VIH, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      EXA_PAPULA=recode(EXA_PAPULA, `0` = "Negative", 
                                                    `1` = "Positive"),
                                      LINF_AXILAR=recode(LINF_AXILAR, `0` = "Negative", 
                                                    `1` = "Positive"))

                                      
dbvirsimica$FIEBRE = as.character(dbvirsimica$FIEBRE)
dbvirsimica$LUMBALGIA = as.character(dbvirsimica$LUMBALGIA)
dbvirsimica$ASTENIA = as.character(dbvirsimica$ASTENIA)
dbvirsimica$COMOR_VIH = as.character(dbvirsimica$COMOR_VIH)
dbvirsimica$EXA_PAPULA = as.character(dbvirsimica$EXA_PAPULA)

#dbvirsimica<- dbvirsimica %>% drop_na()

#library("writexl")

#write_xlsx(dbvirsimica,"C:/Users/fidel/OneDrive - CINVESTAV/Proyecto colaboración SSA/base de datos/Viruelasimica/dbvirsimica.xlsx")



# Specify explanatory variables of interest
explanatory <- c("GENERO", "ORIENT_SEX", "MEC_TRANSM","FIEBRE","LUMBALGIA","ASTENIA","DOLOROSAS","COMOR_VIH", "EXA_PAPULA","LINF_AXILAR")

dependent <- "status"

dbvirsimica %>% 
  summary_factorlist("status", explanatory,
                     p=TRUE, na_include=FALSE)
##        label                                              levels      unit
##       GENERO                                              Hombre Mean (sd)
##                                                            Mujer Mean (sd)
##   ORIENT_SEX                                            Bisexual Mean (sd)
##                                                              Gay Mean (sd)
##                                                     Heterosexual Mean (sd)
##                              Hombres que tienen sexo con hombres Mean (sd)
##   MEC_TRANSM                                         Desconocida Mean (sd)
##              Persona a persona (Excepto las opciones anteriores) Mean (sd)
##                                                           Sexual Mean (sd)
##       FIEBRE                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##    LUMBALGIA                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##      ASTENIA                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##    DOLOROSAS                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##    COMOR_VIH                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##   EXA_PAPULA                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##  LINF_AXILAR                                            Negative Mean (sd)
##                                                         Positive Mean (sd)
##      value      p
##  0.6 (0.5)  0.003
##  0.0 (0.0)       
##  1.0 (0.0) <0.001
##  0.8 (0.4)       
##  0.1 (0.4)       
##  1.0 (0.0)       
##  0.4 (0.5)  0.022
##  0.4 (0.5)       
##  0.9 (0.3)       
##  0.0 (0.0)  0.016
##  0.6 (0.5)       
##  0.3 (0.5)  0.050
##  0.7 (0.5)       
##  0.2 (0.4)  0.008
##  0.7 (0.5)       
##  0.4 (0.5)  0.025
##  1.0 (0.0)       
##  0.3 (0.5)  0.001
##  0.9 (0.3)       
##  0.2 (0.4)  0.020
##  0.6 (0.5)       
##  0.4 (0.5)  0.025
##  1.0 (0.0)
model1<-dbvirsimica %>% select(GENERO, ORIENT_SEX, MEC_TRANSM,FIEBRE,LUMBALGIA,ASTENIA,DOLOROSAS,COMOR_VIH, EXA_PAPULA,LINF_AXILAR,status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
## collapsing to unique 'x' values
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
model1
Characteristic N OR1 95% CI1 p-value
GENERO 38
    Hombre
    Mujer 0.00 >0.9
ORIENT_SEX 38
    Bisexual
    Gay 0.00 >0.9
    Heterosexual 0.00 >0.9
    Hombres que tienen sexo con hombres 1.00 0.00, Inf >0.9
MEC_TRANSM 38
    Desconocida
    En los Servicios Salud 0.00 >0.9
    Persona a persona (Excepto las opciones anteriores) 1.13 0.23, 5.52 0.9
    Sexual 16.2 2.14, 347 0.020
FIEBRE 38
    Negative
    Positive 57,739,388 0.00, NA >0.9
LUMBALGIA 36
    Negative
    Positive 4.00 1.02, 17.6 0.053
ASTENIA 38
    Negative
    Positive 6.43 1.62, 30.3 0.012
DOLOROSAS 36
    Negative
    Positive 62,180,880 0.00, NA >0.9
COMOR_VIH 38
    Negative
    Positive 20.0 3.12, 398 0.008
EXA_PAPULA 36
    Negative
    Positive 6.75 1.38, 50.8 0.030
LINF_AXILAR 36
    Negative
    Positive 62,180,880 0.00, NA >0.9
1 OR = Odds Ratio, CI = Confidence Interval

MODEL 2

model2<-dbvirsimica %>% select(FIEBRE,LUMBALGIA,ASTENIA,DOLOROSAS,COMOR_VIH, EXA_PAPULA,LINF_AXILAR,status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
## collapsing to unique 'x' values
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
model2
Characteristic N OR1 95% CI1 p-value
FIEBRE 38
    Negative
    Positive 57,739,388 0.00, NA >0.9
LUMBALGIA 36
    Negative
    Positive 4.00 1.02, 17.6 0.053
ASTENIA 38
    Negative
    Positive 6.43 1.62, 30.3 0.012
DOLOROSAS 36
    Negative
    Positive 62,180,880 0.00, NA >0.9
COMOR_VIH 38
    Negative
    Positive 20.0 3.12, 398 0.008
EXA_PAPULA 36
    Negative
    Positive 6.75 1.38, 50.8 0.030
LINF_AXILAR 36
    Negative
    Positive 62,180,880 0.00, NA >0.9
1 OR = Odds Ratio, CI = Confidence Interval

MODELO 3

model3<-dbvirsimica %>% select(LUMBALGIA,ASTENIA,COMOR_VIH, EXA_PAPULA,status) %>%
  tbl_uvregression(
    method       = glm,
    y            = status,
    method.args  = list(family = binomial),
    exponentiate = TRUE
  ) 


model3
Characteristic N OR1 95% CI1 p-value
LUMBALGIA 36
    Negative
    Positive 4.00 1.02, 17.6 0.053
ASTENIA 38
    Negative
    Positive 6.43 1.62, 30.3 0.012
COMOR_VIH 38
    Negative
    Positive 20.0 3.12, 398 0.008
EXA_PAPULA 36
    Negative
    Positive 6.75 1.38, 50.8 0.030
1 OR = Odds Ratio, CI = Confidence Interval

##MERGED MODEL TABLES

library(gtsummary)

models <-
  tbl_merge(
    tbls = list(model1, model2, model3),
    tab_spanner = c("Model 1", "Model 2", "Model 3")
  )

models
Characteristic Model 1 Model 2 Model 3
N OR1 95% CI1 p-value N OR1 95% CI1 p-value N OR1 95% CI1 p-value
GENERO 38
    Hombre
    Mujer 0.00 >0.9
ORIENT_SEX 38
    Bisexual
    Gay 0.00 >0.9
    Heterosexual 0.00 >0.9
    Hombres que tienen sexo con hombres 1.00 0.00, Inf >0.9
MEC_TRANSM 38
    Desconocida
    En los Servicios Salud 0.00 >0.9
    Persona a persona (Excepto las opciones anteriores) 1.13 0.23, 5.52 0.9
    Sexual 16.2 2.14, 347 0.020
FIEBRE 38 38
    Negative
    Positive 57,739,388 0.00, NA >0.9 57,739,388 0.00, NA >0.9
LUMBALGIA 36 36 36
    Negative
    Positive 4.00 1.02, 17.6 0.053 4.00 1.02, 17.6 0.053 4.00 1.02, 17.6 0.053
ASTENIA 38 38 38
    Negative
    Positive 6.43 1.62, 30.3 0.012 6.43 1.62, 30.3 0.012 6.43 1.62, 30.3 0.012
DOLOROSAS 36 36
    Negative
    Positive 62,180,880 0.00, NA >0.9 62,180,880 0.00, NA >0.9
COMOR_VIH 38 38 38
    Negative
    Positive 20.0 3.12, 398 0.008 20.0 3.12, 398 0.008 20.0 3.12, 398 0.008
EXA_PAPULA 36 36 36
    Negative
    Positive 6.75 1.38, 50.8 0.030 6.75 1.38, 50.8 0.030 6.75 1.38, 50.8 0.030
LINF_AXILAR 36 36
    Negative
    Positive 62,180,880 0.00, NA >0.9 62,180,880 0.00, NA >0.9
1 OR = Odds Ratio, CI = Confidence Interval

FOREST PLOT OR

MODEL1

library(ggstats)

glm(status~GENERO+ORIENT_SEX+MEC_TRANSM+FIEBRE+LUMBALGIA+ASTENIA+DOLOROSAS+COMOR_VIH+EXA_PAPULA+LINF_AXILAR, dbvirsimica, family = binomial) %>%
  tbl_regression(
    add_estimate_to_reference_rows = TRUE,
    exponentiate = TRUE
  ) %>%
  plot()
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: Transformation introduced infinite values in continuous x-axis
## Transformation introduced infinite values in continuous x-axis
## Transformation introduced infinite values in continuous x-axis

##MODEL 2

glm(status~FIEBRE+LUMBALGIA+ASTENIA+DOLOROSAS+COMOR_VIH+EXA_PAPULA+LINF_AXILAR, dbvirsimica, family = binomial) %>%
  tbl_regression(
    add_estimate_to_reference_rows = TRUE,
    exponentiate = TRUE
  ) %>%
  plot()
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning: glm.fit: algorithm did not converge
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
## Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
## collapsing to unique 'x' values

## Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
## collapsing to unique 'x' values
## Warning: Transformation introduced infinite values in continuous x-axis
## Transformation introduced infinite values in continuous x-axis
## Transformation introduced infinite values in continuous x-axis

##MODEL 3

glm(status~LUMBALGIA+ASTENIA+COMOR_VIH+EXA_PAPULA, dbvirsimica, family = binomial) %>%
  tbl_regression(
    add_estimate_to_reference_rows = TRUE,
    exponentiate = TRUE
  ) %>%
  plot()

FP

#Looping multiple univariate models

mv_reg <- glm(status ~LUMBALGIA+ASTENIA+COMOR_VIH+EXA_PAPULA, family = "binomial", data = dbvirsimica)

summary(mv_reg)
## 
## Call:
## glm(formula = status ~ LUMBALGIA + ASTENIA + COMOR_VIH + EXA_PAPULA, 
##     family = "binomial", data = dbvirsimica)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.8578  -0.6468  -0.2496   0.9057   1.5070  
## 
## Coefficients:
##                    Estimate Std. Error z value Pr(>|z|)  
## (Intercept)         -3.4535     1.3508  -2.557   0.0106 *
## LUMBALGIAPositive    0.7101     1.0098   0.703   0.4820  
## ASTENIAPositive      1.4273     1.0424   1.369   0.1709  
## COMOR_VIHPositive    3.3874     1.4320   2.366   0.0180 *
## EXA_PAPULAPositive   1.9953     1.2512   1.595   0.1108  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 49.795  on 35  degrees of freedom
## Residual deviance: 30.557  on 31  degrees of freedom
##   (2 observations deleted due to missingness)
## AIC: 40.557
## 
## Number of Fisher Scoring iterations: 5
## choose a model using forward selection based on AIC
## you can also do "backward" or "both" by adjusting the direction
final_mv_reg <- mv_reg %>%
  step(direction = "forward", trace = FALSE)

final_mv_reg
## 
## Call:  glm(formula = status ~ LUMBALGIA + ASTENIA + COMOR_VIH + EXA_PAPULA, 
##     family = "binomial", data = dbvirsimica)
## 
## Coefficients:
##        (Intercept)   LUMBALGIAPositive     ASTENIAPositive   COMOR_VIHPositive  
##            -3.4535              0.7101              1.4273              3.3874  
## EXA_PAPULAPositive  
##             1.9953  
## 
## Degrees of Freedom: 35 Total (i.e. Null);  31 Residual
##   (2 observations deleted due to missingness)
## Null Deviance:       49.8 
## Residual Deviance: 30.56     AIC: 40.56
mv_tab_base <- final_mv_reg %>% 
  broom::tidy(exponentiate = TRUE, conf.int = TRUE) %>%  ## get a tidy dataframe of estimates 
  mutate(across(where(is.numeric), round, digits = 2))          ## round 

## show results table of final regression 
mv_tab <- tbl_regression(final_mv_reg, exponentiate = TRUE)

mv_tab
Characteristic OR1 95% CI1 p-value
LUMBALGIA
    Negative
    Positive 2.03 0.26, 15.7 0.5
ASTENIA
    Negative
    Positive 4.17 0.57, 40.5 0.2
COMOR_VIH
    Negative
    Positive 29.6 2.87, 1,126 0.018
EXA_PAPULA
    Negative
    Positive 7.35 0.82, 172 0.11
1 OR = Odds Ratio, CI = Confidence Interval
library(broom)

## define variables of interest 
explanatory_vars <- c("LUMBALGIA","ASTENIA","COMOR_VIH", "EXA_PAPULA")


explanatory_vars %>% str_c("status ~ ", .)
## [1] "status ~ LUMBALGIA"  "status ~ ASTENIA"    "status ~ COMOR_VIH" 
## [4] "status ~ EXA_PAPULA"
models <- explanatory_vars %>%       # begin with variables of interest
  str_c("status ~ ", .) %>%         # combine each variable into formula ("outcome ~ variable of interest")
  
  # iterate through each univariate formula
  map(                               
    .f = ~glm(                       # pass the formulas one-by-one to glm()
      formula = as.formula(.x),      # within glm(), the string formula is .x
      family = "binomial",           # specify type of glm (logistic)
      data = dbvirsimica)) %>%          # dataset
  
  # tidy up each of the glm regression outputs from above
  map(
    .f = ~tidy(
      .x, 
      exponentiate = TRUE,           # exponentiate 
      conf.int = TRUE)) %>%          # return confidence intervals
  
  # collapse the list of regression outputs in to one data frame
  bind_rows() %>% 
  
  # round all numeric columns
  mutate(across(where(is.numeric), round, digits = 2))

models 
## # A tibble: 8 × 7
##   term               estimate std.error statistic p.value conf.low conf.high
##   <chr>                 <dbl>     <dbl>     <dbl>   <dbl>    <dbl>     <dbl>
## 1 (Intercept)            0.5       0.46     -1.5     0.13     0.19      1.2 
## 2 LUMBALGIAPositive      4         0.72      1.93    0.05     1.02     17.6 
## 3 (Intercept)            0.33      0.58     -1.9     0.06     0.09      0.96
## 4 ASTENIAPositive        6.43      0.74      2.53    0.01     1.62     30.4 
## 5 (Intercept)            0.5       0.41     -1.7     0.09     0.21      1.09
## 6 COMOR_VIHPositive     20         1.13      2.66    0.01     3.12    398.  
## 7 (Intercept)            0.22      0.78     -1.92    0.05     0.03      0.86
## 8 EXA_PAPULAPositive     6.75      0.88      2.17    0.03     1.38     50.8
## for each explanatory variable
univ_tab_base <- explanatory_vars %>% 
  map(.f = 
        ~{dbvirsimica %>%                ## begin with linelist
            group_by(status) %>%     ## group data set by outcome
            count(.data[[.x]]) %>%    ## produce counts for variable of interest
            pivot_wider(              ## spread to wide format (as in cross-tabulation)
              names_from = status,
              values_from = n) %>% 
            drop_na(.data[[.x]]) %>%         ## drop rows with missings
            rename("variable" = .x) %>%      ## change variable of interest column to "variable"
            mutate(variable = as.character(variable))} ## convert to character, else non-dichotomous (categorical) variables come out as factor and cant be merged
  ) %>% 
  
  ## collapse the list of count outputs in to one data frame
  bind_rows() %>% 
  
  ## merge with the outputs of the regression 
  bind_cols(., models) %>% 
  
  ## only keep columns interested in 
  select(term, 2:3, estimate, conf.low, conf.high, p.value) %>% 
  
  ## round decimal places
  mutate(across(where(is.numeric), round, digits = 2))  
## Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
## ℹ Please use `all_of(var)` (or `any_of(var)`) instead of `.data[[var]]`
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## ℹ Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(.x)
## 
##   # Now:
##   data %>% select(all_of(.x))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
univ_tab <- dbvirsimica %>% 
  dplyr::select(explanatory_vars, status) %>% ## select variables of interest
  
  tbl_uvregression(                         ## produce univariate table
    method = glm,                           ## define regression want to run (generalised linear model)
    y = status,                            ## define outcome variable
    method.args = list(family = binomial),  ## define what type of glm want to run (logistic)
    exponentiate = TRUE                     ## exponentiate to produce odds ratios (rather than log odds)
  )
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## ℹ Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(explanatory_vars)
## 
##   # Now:
##   data %>% select(all_of(explanatory_vars))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## view univariate results table 
univ_tab  
Characteristic N OR1 95% CI1 p-value
LUMBALGIA 36
    Negative
    Positive 4.00 1.02, 17.6 0.053
ASTENIA 38
    Negative
    Positive 6.43 1.62, 30.3 0.012
COMOR_VIH 38
    Negative
    Positive 20.0 3.12, 398 0.008
EXA_PAPULA 36
    Negative
    Positive 6.75 1.38, 50.8 0.030
1 OR = Odds Ratio, CI = Confidence Interval
## combine with univariate results 
tbl_merge(
  tbls = list(univ_tab, mv_tab),                          # combine
  tab_spanner = c("**Univariate**", "**Multivariable**")) # set header names
Characteristic Univariate Multivariable
N OR1 95% CI1 p-value OR1 95% CI1 p-value
LUMBALGIA 36
    Negative
    Positive 4.00 1.02, 17.6 0.053 2.03 0.26, 15.7 0.5
ASTENIA 38
    Negative
    Positive 6.43 1.62, 30.3 0.012 4.17 0.57, 40.5 0.2
COMOR_VIH 38
    Negative
    Positive 20.0 3.12, 398 0.008 29.6 2.87, 1,126 0.018
EXA_PAPULA 36
    Negative
    Positive 6.75 1.38, 50.8 0.030 7.35 0.82, 172 0.11
1 OR = Odds Ratio, CI = Confidence Interval

ROC CURVES

#dbsimicaroc<-read_excel("C:/Users/fidel/OneDrive - CINVESTAV/Proyecto colaboración SSA/base de datos/Viruelasimica/dbvirsimica.xlsx")

#str(dbsimicaroc)