¿Qué son los modelos de regresión de Poisson?

Los modelos de regresión de Poisson se utilizan mejor para modelar eventos donde los resultados son conteos. O, más específicamente, contar datos : datos discretos con valores enteros no negativos que cuentan algo, como la cantidad de veces que ocurre un evento durante un período de tiempo determinado o la cantidad de personas en la fila en la tienda de comestibles.

Los datos de conteo también se pueden expresar como datos de tasa , ya que la cantidad de veces que ocurre un evento dentro de un período de tiempo se puede expresar como un conteo sin procesar (es decir, “En un día, comemos tres comidas”) o como una tasa (“Comemos en una tarifa de 0,125 comidas por hora”).

La regresión de Poisson nos ayuda a analizar tanto los datos de conteo como los datos de tasa al permitirnos determinar qué variables explicativas (valores X) tienen un efecto en una variable de respuesta dada (valor Y, el conteo o una tasa). Por ejemplo, una tienda de comestibles podría aplicar la regresión de Poisson para comprender y predecir mejor la cantidad de personas en una fila.

library(readxl)

library(readxl)
Base <- read_excel("C:/Users/wsand/Dropbox/Centro Oriente/Diario de Sintomas/Base_regresion.xlsx")
library(DT)
DT::datatable(Base)
library(ggplot2)
library(plotly)
# Install the package jtools if not already installed
#install.packages("jtools")

# you may be asked to install 'broom' and 'ggstance' packages as well
#install.packages("broom")
#install.packages("ggstance")
library(jtools)
library(broom)
library(ggstance)

Modelo Tos

q=ggplot(data=Base,aes(x=`casos TOS`))+
  geom_histogram(bins = 30, fill="steelblue")
ggplotly(q)
mean(Base$`casos TOS`) # calcular la media
## [1] 0.6747182
var(Base$`casos TOS`)
## [1] 1.294021

Ajustemos el modelo de Poisson

tos.model<-glm(Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + Base$`TIPO VIVIENDA NIÑO`+
                 Base$`PESO MENOS 2,5 KG`+ Base$`LACTANCIA MATERNA` +Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
summary(tos.model)
## 
## Call:
## glm(formula = Base$`casos TOS` ~ Base$Exposición + Base$Estrato + 
##     Base$SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`LACTANCIA MATERNA` + Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5813  -1.1657  -1.0411   0.3936   4.2950  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                  -1.063618
## Base$ExposiciónRiesgo bajo                                    0.193659
## Base$Estrato2                                                 0.151804
## Base$Estrato3                                                 0.044395
## Base$Estrato4                                                -0.933306
## Base$SEXOMasculino                                            0.120935
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  -0.105172
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                -0.007519
## Base$`TIPO VIVIENDA NIÑO`Habitación                         -14.911259
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.481308
## Base$`PESO MENOS 2,5 KG`2                                     0.082162
## Base$`LACTANCIA MATERNA`2                                     0.082008
## Base$`DX PADRES ENF.RESPIRATORIA`2                           -0.060142
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           1.291977
## Base$`MADRE CONTACTO FUMADORES`2                             -0.416252
## Base$`MADRE FUMÓ EMBARAZO`2                                  -0.185382
## Base$`DX MALNUTRICIÓN`2                                      -0.308058
##                                                             Std. Error z value
## (Intercept)                                                   0.839234  -1.267
## Base$ExposiciónRiesgo bajo                                    0.099294   1.950
## Base$Estrato2                                                 0.173155   0.877
## Base$Estrato3                                                 0.180401   0.246
## Base$Estrato4                                                 0.448994  -2.079
## Base$SEXOMasculino                                            0.098936   1.222
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.218449  -0.481
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.106926  -0.070
## Base$`TIPO VIVIENDA NIÑO`Habitación                         516.828788  -0.029
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.460968   1.044
## Base$`PESO MENOS 2,5 KG`2                                     0.387721   0.212
## Base$`LACTANCIA MATERNA`2                                     0.182265   0.450
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.218763  -0.275
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.642298   2.011
## Base$`MADRE CONTACTO FUMADORES`2                              0.149342  -2.787
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.703348  -0.264
## Base$`DX MALNUTRICIÓN`2                                       0.424363  -0.726
##                                                             Pr(>|z|)   
## (Intercept)                                                  0.20502   
## Base$ExposiciónRiesgo bajo                                   0.05113 . 
## Base$Estrato2                                                0.38065   
## Base$Estrato3                                                0.80561   
## Base$Estrato4                                                0.03765 * 
## Base$SEXOMasculino                                           0.22157   
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  0.63020   
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                0.94394   
## Base$`TIPO VIVIENDA NIÑO`Habitación                          0.97698   
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         0.29643   
## Base$`PESO MENOS 2,5 KG`2                                    0.83218   
## Base$`LACTANCIA MATERNA`2                                    0.65275   
## Base$`DX PADRES ENF.RESPIRATORIA`2                           0.78338   
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                          0.04427 * 
## Base$`MADRE CONTACTO FUMADORES`2                             0.00532 **
## Base$`MADRE FUMÓ EMBARAZO`2                                  0.79211   
## Base$`DX MALNUTRICIÓN`2                                      0.46788   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 962.18  on 620  degrees of freedom
## Residual deviance: 924.11  on 604  degrees of freedom
## AIC: 1518.4
## 
## Number of Fisher Scoring iterations: 13
library(MASS)  # Para poder usar la funcion stepAIC
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:plotly':
## 
##     select
modback <- stepAIC(tos.model, trace=TRUE, direction="backward")
## Start:  AIC=1518.43
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + Base$`LACTANCIA MATERNA` + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`            1   924.15 1516.5
## - Base$`MADRE FUMÓ EMBARAZO`          1   924.17 1516.5
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   924.18 1516.5
## - Base$`LACTANCIA MATERNA`            1   924.31 1516.6
## - Base$`DX MALNUTRICIÓN`              1   924.59 1516.9
## - Base$SEXO                           1   925.60 1517.9
## <none>                                    924.11 1518.4
## - Base$`TIPO VIVIENDA NIÑO`           4   933.49 1519.8
## - Base$Exposición                     1   927.93 1520.2
## - Base$Estrato                        3   933.68 1522.0
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   929.74 1522.1
## - Base$`MADRE CONTACTO FUMADORES`     1   931.15 1523.5
## 
## Step:  AIC=1516.48
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`          1   924.21 1514.5
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   924.23 1514.5
## - Base$`LACTANCIA MATERNA`            1   924.33 1514.7
## - Base$`DX MALNUTRICIÓN`              1   924.66 1515.0
## - Base$SEXO                           1   925.64 1516.0
## <none>                                    924.15 1516.5
## - Base$`TIPO VIVIENDA NIÑO`           4   933.54 1517.9
## - Base$Exposición                     1   927.97 1518.3
## - Base$Estrato                        3   933.72 1520.0
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   929.81 1520.1
## - Base$`MADRE CONTACTO FUMADORES`     1   931.15 1521.5
## 
## Step:  AIC=1514.54
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   924.30 1512.6
## - Base$`LACTANCIA MATERNA`            1   924.38 1512.7
## - Base$`DX MALNUTRICIÓN`              1   924.95 1513.3
## - Base$SEXO                           1   925.67 1514.0
## <none>                                    924.21 1514.5
## - Base$`TIPO VIVIENDA NIÑO`           4   933.58 1515.9
## - Base$Exposición                     1   928.13 1516.5
## - Base$Estrato                        3   933.81 1518.1
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   930.53 1518.8
## - Base$`MADRE CONTACTO FUMADORES`     1   931.62 1520.0
## 
## Step:  AIC=1512.62
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`LACTANCIA MATERNA`            1   924.46 1510.8
## - Base$`DX MALNUTRICIÓN`              1   925.05 1511.4
## - Base$SEXO                           1   925.78 1512.1
## <none>                                    924.30 1512.6
## - Base$`TIPO VIVIENDA NIÑO`           4   933.66 1514.0
## - Base$Exposición                     1   928.21 1514.5
## - Base$Estrato                        3   933.85 1516.2
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   930.53 1516.8
## - Base$`MADRE CONTACTO FUMADORES`     1   931.66 1518.0
## 
## Step:  AIC=1510.78
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX MALNUTRICIÓN`              1   925.28 1509.6
## - Base$SEXO                           1   925.90 1510.2
## <none>                                    924.46 1510.8
## - Base$`TIPO VIVIENDA NIÑO`           4   933.82 1512.2
## - Base$Exposición                     1   928.40 1512.7
## - Base$Estrato                        3   934.05 1514.4
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   930.59 1514.9
## - Base$`MADRE CONTACTO FUMADORES`     1   931.78 1516.1
## 
## Step:  AIC=1509.6
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES`
## 
##                                      Df Deviance    AIC
## - Base$SEXO                           1   926.74 1509.1
## <none>                                    925.28 1509.6
## - Base$`TIPO VIVIENDA NIÑO`           4   934.69 1511.0
## - Base$Exposición                     1   929.39 1511.7
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   930.97 1513.3
## - Base$Estrato                        3   935.22 1513.5
## - Base$`MADRE CONTACTO FUMADORES`     1   932.73 1515.1
## 
## Step:  AIC=1509.06
## Base$`casos TOS` ~ Base$Exposición + Base$Estrato + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES`
## 
##                                      Df Deviance    AIC
## <none>                                    926.74 1509.1
## - Base$`TIPO VIVIENDA NIÑO`           4   936.35 1510.7
## - Base$Exposición                     1   930.92 1511.2
## - Base$Estrato                        3   936.47 1512.8
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   932.49 1512.8
## - Base$`MADRE CONTACTO FUMADORES`     1   933.89 1514.2
modback
## 
## Call:  glm(formula = Base$`casos TOS` ~ Base$Exposición + Base$Estrato + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES`, family = poisson(link = "log"), 
##     data = Base)
## 
## Coefficients:
##                                                 (Intercept)  
##                                                   -1.340720  
##                                  Base$ExposiciónRiesgo bajo  
##                                                    0.201679  
##                                               Base$Estrato2  
##                                                    0.147956  
##                                               Base$Estrato3  
##                                                    0.031750  
##                                               Base$Estrato4  
##                                                   -0.943328  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  
##                                                   -0.087262  
##               Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)  
##                                                   -0.008997  
##                         Base$`TIPO VIVIENDA NIÑO`Habitación  
##                                                  -14.945635  
##                        Base$`TIPO VIVIENDA NIÑO`Inquilinato  
##                                                    0.485891  
##                         Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2  
##                                                    1.169826  
##                            Base$`MADRE CONTACTO FUMADORES`2  
##                                                   -0.411168  
## 
## Degrees of Freedom: 620 Total (i.e. Null);  610 Residual
## Null Deviance:       962.2 
## Residual Deviance: 926.7     AIC: 1509
modback <- update(modback, Base$`casos TOS` ~ Base$Exposición + Base$Estrato +
                      Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
                    Base$`MADRE CONTACTO FUMADORES`)
summary(modback)
## 
## Call:
## glm(formula = Base$`casos TOS` ~ Base$Exposición + Base$Estrato + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5334  -1.1817  -1.0620   0.4202   4.2116  
## 
## Coefficients:
##                                     Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                         -1.29500    0.59738  -2.168  0.03017 * 
## Base$ExposiciónRiesgo bajo           0.21370    0.09865   2.166  0.03029 * 
## Base$Estrato2                        0.14259    0.17201   0.829  0.40714   
## Base$Estrato3                        0.02142    0.17766   0.121  0.90403   
## Base$Estrato4                       -0.98292    0.43870  -2.241  0.02506 * 
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2  1.10053    0.58710   1.875  0.06086 . 
## Base$`MADRE CONTACTO FUMADORES`2    -0.39989    0.14587  -2.741  0.00612 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 962.18  on 620  degrees of freedom
## Residual deviance: 936.35  on 614  degrees of freedom
## AIC: 1510.7
## 
## Number of Fisher Scoring iterations: 6

Modelo reducido para casos de tos

summary(modback)
## 
## Call:
## glm(formula = Base$`casos TOS` ~ Base$Exposición + Base$Estrato + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5334  -1.1817  -1.0620   0.4202   4.2116  
## 
## Coefficients:
##                                     Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                         -1.29500    0.59738  -2.168  0.03017 * 
## Base$ExposiciónRiesgo bajo           0.21370    0.09865   2.166  0.03029 * 
## Base$Estrato2                        0.14259    0.17201   0.829  0.40714   
## Base$Estrato3                        0.02142    0.17766   0.121  0.90403   
## Base$Estrato4                       -0.98292    0.43870  -2.241  0.02506 * 
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2  1.10053    0.58710   1.875  0.06086 . 
## Base$`MADRE CONTACTO FUMADORES`2    -0.39989    0.14587  -2.741  0.00612 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 962.18  on 620  degrees of freedom
## Residual deviance: 936.35  on 614  degrees of freedom
## AIC: 1510.7
## 
## Number of Fisher Scoring iterations: 6
library(sandwich)
library(lmtest)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ tibble  3.1.8     ✔ dplyr   1.0.9
## ✔ tidyr   1.2.0     ✔ stringr 1.4.0
## ✔ readr   2.1.2     ✔ forcats 0.5.1
## ✔ purrr   0.3.4     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter()            masks plotly::filter(), stats::filter()
## ✖ ggstance::geom_errorbarh() masks ggplot2::geom_errorbarh()
## ✖ dplyr::lag()               masks stats::lag()
## ✖ dplyr::select()            masks MASS::select(), plotly::select()
library(lmtest)
library(sandwich)


results <- coeftest(modback)
results
## 
## z test of coefficients:
## 
##                                      Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                         -1.294997   0.597378 -2.1678 0.030174 * 
## Base$ExposiciónRiesgo bajo           0.213697   0.098649  2.1662 0.030294 * 
## Base$Estrato2                        0.142587   0.172011  0.8289 0.407138   
## Base$Estrato3                        0.021420   0.177658  0.1206 0.904031   
## Base$Estrato4                       -0.982916   0.438698 -2.2405 0.025057 * 
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2  1.100535   0.587101  1.8745 0.060858 . 
## Base$`MADRE CONTACTO FUMADORES`2    -0.399889   0.145868 -2.7414 0.006117 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Podemos ver en el resumen anterior que para exposición Riesgo Alto, se ha hecho la base y no se muestra en el resumen. De manera similar, para el estrato,““1 se ha convertido en la categoría base.

Para ver qué variables explicativas tienen un efecto sobre la variable de respuesta, veremos los valores p. Si la p es menor que 0.05 entonces, la variable tiene un efecto sobre la variable de respuesta. Observe cómo la salida de R usó *** al final de cada variable. El número de estrellas significa significancia

Nariz Tapada

nariz_tapada.model<-glm(Base$`Casos Nariz tapada` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                  Base$`LACTANCIA MATERNA`+
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
## Warning: glm.fit: fitted rates numerically 0 occurred
summary(nariz_tapada.model)
## 
## Call:
## glm(formula = Base$`Casos Nariz tapada` ~ Exposición + Estrato + 
##     SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3263  -0.8073  -0.7228  -0.4501   3.8194  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                  -29.20995
## ExposiciónRiesgo bajo                                         -0.09051
## Estrato2                                                       0.24455
## Estrato3                                                       0.25255
## Estrato4                                                       0.16101
## SEXOMasculino                                                  0.22103
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   -1.05791
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 -0.07149
## Base$`TIPO VIVIENDA NIÑO`Habitación                            0.79847
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           1.00269
## Base$`PESO MENOS 2,5 KG`2                                     -0.14527
## Base$`LACTANCIA MATERNA`2                                      0.24339
## Base$`DX PADRES ENF.RESPIRATORIA`2                            -0.44866
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           15.08978
## Base$`MADRE CONTACTO FUMADORES`2                              -0.35201
## Base$`MADRE FUMÓ EMBARAZO`2                                  -14.51778
## Base$`DX MALNUTRICIÓN`2                                       28.06048
##                                                             Std. Error z value
## (Intercept)                                                 1163.90780  -0.025
## ExposiciónRiesgo bajo                                          0.14947  -0.606
## Estrato2                                                       0.27246   0.898
## Estrato3                                                       0.28084   0.899
## Estrato4                                                       0.52878   0.304
## SEXOMasculino                                                  0.14981   1.475
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.47032  -2.249
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.16216  -0.441
## Base$`TIPO VIVIENDA NIÑO`Habitación                            0.51211   1.559
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           0.58962   1.701
## Base$`PESO MENOS 2,5 KG`2                                      0.52803  -0.275
## Base$`LACTANCIA MATERNA`2                                      0.26846   0.907
## Base$`DX PADRES ENF.RESPIRATORIA`2                             0.28998  -1.547
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                          761.64939   0.020
## Base$`MADRE CONTACTO FUMADORES`2                               0.22996  -1.531
## Base$`MADRE FUMÓ EMBARAZO`2                                  761.65013  -0.019
## Base$`DX MALNUTRICIÓN`2                                     1163.90810   0.024
##                                                             Pr(>|z|)  
## (Intercept)                                                   0.9800  
## ExposiciónRiesgo bajo                                         0.5448  
## Estrato2                                                      0.3694  
## Estrato3                                                      0.3685  
## Estrato4                                                      0.7607  
## SEXOMasculino                                                 0.1401  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.0245 *
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.6593  
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.1190  
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.0890 .
## Base$`PESO MENOS 2,5 KG`2                                     0.7832  
## Base$`LACTANCIA MATERNA`2                                     0.3646  
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.1218  
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.9842  
## Base$`MADRE CONTACTO FUMADORES`2                              0.1258  
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.9848  
## Base$`DX MALNUTRICIÓN`2                                       0.9808  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 641.09  on 620  degrees of freedom
## Residual deviance: 613.28  on 604  degrees of freedom
## AIC: 925.48
## 
## Number of Fisher Scoring iterations: 15
modback2 <- stepAIC(nariz_tapada.model, trace=TRUE, direction="backward")
## Start:  AIC=925.48
## Base$`Casos Nariz tapada` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Estrato                             3   614.24 920.44
## - Base$`PESO MENOS 2,5 KG`            1   613.35 923.55
## - Exposición                          1   613.64 923.85
## - Base$`LACTANCIA MATERNA`            1   614.05 924.25
## - Base$`MADRE FUMÓ EMBARAZO`          1   614.87 925.08
## <none>                                    613.28 925.48
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   615.41 925.62
## - Base$`MADRE CONTACTO FUMADORES`     1   615.43 925.63
## - SEXO                                1   615.47 925.67
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   617.62 927.82
## - Base$`TIPO VIVIENDA NIÑO`           4   624.65 928.86
## - Base$`DX MALNUTRICIÓN`              1   618.68 928.89
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=920.44
## Base$`Casos Nariz tapada` ~ Exposición + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`            1   614.34 918.54
## - Exposición                          1   614.62 918.82
## - Base$`LACTANCIA MATERNA`            1   615.00 919.20
## - Base$`MADRE FUMÓ EMBARAZO`          1   615.89 920.10
## - SEXO                                1   616.20 920.40
## <none>                                    614.24 920.44
## - Base$`MADRE CONTACTO FUMADORES`     1   616.37 920.58
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   616.56 920.77
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   618.79 922.99
## - Base$`DX MALNUTRICIÓN`              1   619.58 923.79
## - Base$`TIPO VIVIENDA NIÑO`           4   626.08 924.28
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=918.54
## Base$`Casos Nariz tapada` ~ Exposición + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Exposición                          1   614.72 916.92
## - Base$`LACTANCIA MATERNA`            1   615.21 917.41
## - Base$`MADRE FUMÓ EMBARAZO`          1   616.09 918.29
## - SEXO                                1   616.32 918.52
## <none>                                    614.34 918.54
## - Base$`MADRE CONTACTO FUMADORES`     1   616.54 918.74
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   616.65 918.86
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   618.92 921.13
## - Base$`DX MALNUTRICIÓN`              1   619.80 922.00
## - Base$`TIPO VIVIENDA NIÑO`           4   626.10 922.31
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=916.92
## Base$`Casos Nariz tapada` ~ SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`LACTANCIA MATERNA`            1   615.58 915.78
## - Base$`MADRE FUMÓ EMBARAZO`          1   616.39 916.59
## - SEXO                                1   616.67 916.88
## <none>                                    614.72 916.92
## - Base$`MADRE CONTACTO FUMADORES`     1   616.89 917.09
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   616.98 917.19
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   619.17 919.37
## - Base$`DX MALNUTRICIÓN`              1   620.15 920.36
## - Base$`TIPO VIVIENDA NIÑO`           4   626.52 920.73
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=915.78
## Base$`Casos Nariz tapada` ~ SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`          1   617.32 915.53
## - SEXO                                1   617.41 915.62
## <none>                                    615.58 915.78
## - Base$`MADRE CONTACTO FUMADORES`     1   617.70 915.90
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   617.77 915.97
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   619.92 918.12
## - Base$`DX MALNUTRICIÓN`              1   620.92 919.13
## - Base$`TIPO VIVIENDA NIÑO`           4   627.27 919.47
## 
## Step:  AIC=915.53
## Base$`Casos Nariz tapada` ~ SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - SEXO                                1   619.15 915.35
## <none>                                    617.32 915.53
## - Base$`MADRE CONTACTO FUMADORES`     1   619.58 915.78
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   619.91 916.12
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   620.08 916.28
## - Base$`DX MALNUTRICIÓN`              1   621.04 917.24
## - Base$`TIPO VIVIENDA NIÑO`           4   628.97 919.17
## 
## Step:  AIC=915.35
## Base$`Casos Nariz tapada` ~ Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## <none>                                    619.15 915.35
## - Base$`MADRE CONTACTO FUMADORES`     1   621.27 915.47
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   621.90 916.11
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   622.03 916.23
## - Base$`DX MALNUTRICIÓN`              1   622.82 917.03
## - Base$`TIPO VIVIENDA NIÑO`           4   630.79 918.99
modback2
## 
## Call:  glm(formula = Base$`Casos Nariz tapada` ~ Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`, 
##     family = poisson(link = "log"), data = Base)
## 
## Coefficients:
##                                                 (Intercept)  
##                                                   -16.49215  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  
##                                                    -1.06382  
##               Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)  
##                                                    -0.06894  
##                         Base$`TIPO VIVIENDA NIÑO`Habitación  
##                                                     0.73814  
##                        Base$`TIPO VIVIENDA NIÑO`Inquilinato  
##                                                     0.92235  
##                          Base$`DX PADRES ENF.RESPIRATORIA`2  
##                                                    -0.49833  
##                         Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2  
##                                                     1.37812  
##                            Base$`MADRE CONTACTO FUMADORES`2  
##                                                    -0.34506  
##                                     Base$`DX MALNUTRICIÓN`2  
##                                                    14.74739  
## 
## Degrees of Freedom: 620 Total (i.e. Null);  612 Residual
## Null Deviance:       641.1 
## Residual Deviance: 619.1     AIC: 915.4
modback2 <- update(modback2, Base$`Casos Nariz tapada` ~ Base$`TIPO VIVIENDA NIÑO`)
summary(modback2)
## 
## Call:
## glm(formula = Base$`Casos Nariz tapada` ~ Base$`TIPO VIVIENDA NIÑO`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1547  -0.7888  -0.7708  -0.4564   3.6600  
## 
## Coefficients:
##                                                             Estimate Std. Error
## (Intercept)                                                 -1.16761    0.09449
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal) -1.09416    0.45709
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)               -0.04632    0.15999
## Base$`TIPO VIVIENDA NIÑO`Habitación                          0.76214    0.50885
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         0.65678    0.58503
##                                                             z value Pr(>|z|)
## (Intercept)                                                 -12.357   <2e-16
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  -2.394   0.0167
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                -0.290   0.7722
## Base$`TIPO VIVIENDA NIÑO`Habitación                           1.498   0.1342
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          1.123   0.2616
##                                                                
## (Intercept)                                                 ***
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal) *  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  
## Base$`TIPO VIVIENDA NIÑO`Habitación                            
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 641.09  on 620  degrees of freedom
## Residual deviance: 629.60  on 616  degrees of freedom
## AIC: 917.8
## 
## Number of Fisher Scoring iterations: 6

Modelo Reducido Nariz Tapada

summary(modback2)
## 
## Call:
## glm(formula = Base$`Casos Nariz tapada` ~ Base$`TIPO VIVIENDA NIÑO`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1547  -0.7888  -0.7708  -0.4564   3.6600  
## 
## Coefficients:
##                                                             Estimate Std. Error
## (Intercept)                                                 -1.16761    0.09449
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal) -1.09416    0.45709
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)               -0.04632    0.15999
## Base$`TIPO VIVIENDA NIÑO`Habitación                          0.76214    0.50885
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         0.65678    0.58503
##                                                             z value Pr(>|z|)
## (Intercept)                                                 -12.357   <2e-16
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  -2.394   0.0167
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                -0.290   0.7722
## Base$`TIPO VIVIENDA NIÑO`Habitación                           1.498   0.1342
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          1.123   0.2616
##                                                                
## (Intercept)                                                 ***
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal) *  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  
## Base$`TIPO VIVIENDA NIÑO`Habitación                            
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 641.09  on 620  degrees of freedom
## Residual deviance: 629.60  on 616  degrees of freedom
## AIC: 917.8
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback2)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Mocos por la Nariz

mocos_nariz.model<-glm(Base$`Casos Mocos por la nariz` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
summary(mocos_nariz.model)
## 
## Call:
## glm(formula = Base$`Casos Mocos por la nariz` ~ Exposición + 
##     Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9583  -1.5716  -0.3433   0.6042   4.4235  
## 
## Coefficients:
##                                                              Estimate
## (Intercept)                                                 -1.027074
## ExposiciónRiesgo bajo                                        0.012140
## Estrato2                                                     0.063484
## Estrato3                                                    -0.190812
## Estrato4                                                    -0.526041
## SEXOMasculino                                                0.091501
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  0.059261
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                0.003846
## Base$`TIPO VIVIENDA NIÑO`Habitación                          0.073879
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         0.393665
## Base$`PESO MENOS 2,5 KG`2                                    0.004704
## Base$`DX PADRES ENF.RESPIRATORIA`2                          -0.047553
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                          0.179926
## Base$`MADRE CONTACTO FUMADORES`2                            -0.248129
## Base$`MADRE FUMÓ EMBARAZO`2                                  0.523475
## Base$`DX MALNUTRICIÓN`2                                      0.768370
##                                                             Std. Error z value
## (Intercept)                                                   0.780039  -1.317
## ExposiciónRiesgo bajo                                         0.074198   0.164
## Estrato2                                                      0.122872   0.517
## Estrato3                                                      0.130537  -1.462
## Estrato4                                                      0.266781  -1.972
## SEXOMasculino                                                 0.073972   1.237
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.156350   0.379
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.080919   0.048
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.357543   0.207
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.362950   1.085
## Base$`PESO MENOS 2,5 KG`2                                     0.283421   0.017
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.168560  -0.282
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.369020   0.488
## Base$`MADRE CONTACTO FUMADORES`2                              0.118340  -2.097
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.674802   0.776
## Base$`DX MALNUTRICIÓN`2                                       0.513220   1.497
##                                                             Pr(>|z|)  
## (Intercept)                                                   0.1879  
## ExposiciónRiesgo bajo                                         0.8700  
## Estrato2                                                      0.6054  
## Estrato3                                                      0.1438  
## Estrato4                                                      0.0486 *
## SEXOMasculino                                                 0.2161  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.7047  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.9621  
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.8363  
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.2781  
## Base$`PESO MENOS 2,5 KG`2                                     0.9868  
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.7779  
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.6258  
## Base$`MADRE CONTACTO FUMADORES`2                              0.0360 *
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.4379  
## Base$`DX MALNUTRICIÓN`2                                       0.1344  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 1274.0  on 620  degrees of freedom
## Residual deviance: 1248.3  on 605  degrees of freedom
## AIC: 2116.2
## 
## Number of Fisher Scoring iterations: 6
modback3 <- stepAIC(mocos_nariz.model, trace=TRUE, direction="backward")
## Start:  AIC=2116.21
## Base$`Casos Mocos por la nariz` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`TIPO VIVIENDA NIÑO`           4   1249.5 2109.4
## - Base$`PESO MENOS 2,5 KG`            1   1248.3 2114.2
## - Exposición                          1   1248.3 2114.2
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   1248.4 2114.3
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   1248.5 2114.5
## - Base$`MADRE FUMÓ EMBARAZO`          1   1248.9 2114.9
## - SEXO                                1   1249.8 2115.8
## <none>                                    1248.3 2116.2
## - Base$`DX MALNUTRICIÓN`              1   1251.1 2117.1
## - Base$`MADRE CONTACTO FUMADORES`     1   1252.4 2118.4
## - Estrato                             3   1262.2 2124.2
## 
## Step:  AIC=2109.42
## Base$`Casos Mocos por la nariz` ~ Exposición + Estrato + SEXO + 
##     Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`            1   1249.5 2107.4
## - Exposición                          1   1249.5 2107.5
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   1249.6 2107.5
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   1249.7 2107.6
## - Base$`MADRE FUMÓ EMBARAZO`          1   1250.2 2108.2
## - SEXO                                1   1251.0 2108.9
## <none>                                    1249.5 2109.4
## - Base$`DX MALNUTRICIÓN`              1   1251.8 2109.8
## - Base$`MADRE CONTACTO FUMADORES`     1   1253.4 2111.3
## - Estrato                             3   1263.9 2117.8
## 
## Step:  AIC=2107.42
## Base$`Casos Mocos por la nariz` ~ Exposición + Estrato + SEXO + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Exposición                          1   1249.5 2105.5
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   1249.6 2105.5
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   1249.7 2105.6
## - Base$`MADRE FUMÓ EMBARAZO`          1   1250.2 2106.2
## - SEXO                                1   1251.0 2106.9
## <none>                                    1249.5 2107.4
## - Base$`DX MALNUTRICIÓN`              1   1251.8 2107.8
## - Base$`MADRE CONTACTO FUMADORES`     1   1253.4 2109.3
## - Estrato                             3   1263.9 2115.9
## 
## Step:  AIC=2105.46
## Base$`Casos Mocos por la nariz` ~ Estrato + SEXO + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   1249.6 2103.5
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   1249.7 2103.7
## - Base$`MADRE FUMÓ EMBARAZO`          1   1250.3 2104.2
## - SEXO                                1   1251.0 2105.0
## <none>                                    1249.5 2105.5
## - Base$`DX MALNUTRICIÓN`              1   1251.9 2105.8
## - Base$`MADRE CONTACTO FUMADORES`     1   1253.5 2107.4
## - Estrato                             3   1264.0 2113.9
## 
## Step:  AIC=2103.54
## Base$`Casos Mocos por la nariz` ~ Estrato + SEXO + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   1249.8 2101.7
## - Base$`MADRE FUMÓ EMBARAZO`          1   1250.3 2102.2
## - SEXO                                1   1251.1 2103.1
## <none>                                    1249.6 2103.5
## - Base$`DX MALNUTRICIÓN`              1   1251.9 2103.8
## - Base$`MADRE CONTACTO FUMADORES`     1   1253.5 2105.4
## - Estrato                             3   1264.0 2111.9
## 
## Step:  AIC=2101.73
## Base$`Casos Mocos por la nariz` ~ Estrato + SEXO + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                   Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`       1   1251.2 2101.2
## - SEXO                             1   1251.3 2101.3
## <none>                                 1249.8 2101.7
## - Base$`DX MALNUTRICIÓN`           1   1252.2 2102.1
## - Base$`MADRE CONTACTO FUMADORES`  1   1253.5 2103.4
## - Estrato                          3   1264.2 2110.2
## 
## Step:  AIC=2101.17
## Base$`Casos Mocos por la nariz` ~ Estrato + SEXO + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                   Df Deviance    AIC
## - SEXO                             1   1252.9 2100.8
## <none>                                 1251.2 2101.2
## - Base$`MADRE CONTACTO FUMADORES`  1   1254.2 2102.1
## - Base$`DX MALNUTRICIÓN`           1   1254.4 2102.3
## - Estrato                          3   1265.3 2109.2
## 
## Step:  AIC=2100.81
## Base$`Casos Mocos por la nariz` ~ Estrato + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                   Df Deviance    AIC
## <none>                                 1252.9 2100.8
## - Base$`MADRE CONTACTO FUMADORES`  1   1255.6 2101.5
## - Base$`DX MALNUTRICIÓN`           1   1256.0 2101.9
## - Estrato                          3   1267.3 2109.3
modback3 <- update(modback3, Base$`Casos Mocos por la nariz` ~ Estrato  +
                     Base$`MADRE CONTACTO FUMADORES` )
summary(modback3)
## 
## Call:
## glm(formula = Base$`Casos Mocos por la nariz` ~ Estrato + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7815  -1.5854  -0.2866   0.5547   4.5551  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                       0.41687    0.14879   2.802  0.00508 **
## Estrato2                          0.04495    0.12182   0.369  0.71214   
## Estrato3                         -0.20758    0.12830  -1.618  0.10566   
## Estrato4                         -0.50299    0.25534  -1.970  0.04886 * 
## Base$`MADRE CONTACTO FUMADORES`2 -0.18832    0.11389  -1.654  0.09822 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 1274  on 620  degrees of freedom
## Residual deviance: 1256  on 616  degrees of freedom
## AIC: 2101.9
## 
## Number of Fisher Scoring iterations: 6

Modelo Reducido Mocos por la Nariz

summary(modback3)
## 
## Call:
## glm(formula = Base$`Casos Mocos por la nariz` ~ Estrato + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7815  -1.5854  -0.2866   0.5547   4.5551  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                       0.41687    0.14879   2.802  0.00508 **
## Estrato2                          0.04495    0.12182   0.369  0.71214   
## Estrato3                         -0.20758    0.12830  -1.618  0.10566   
## Estrato4                         -0.50299    0.25534  -1.970  0.04886 * 
## Base$`MADRE CONTACTO FUMADORES`2 -0.18832    0.11389  -1.654  0.09822 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 1274  on 620  degrees of freedom
## Residual deviance: 1256  on 616  degrees of freedom
## AIC: 2101.9
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback3)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Fiebre

fiebre.model<-glm(Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
summary(fiebre.model)
## 
## Call:
## glm(formula = Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5939  -0.8069  -0.6663  -0.4298   3.8979  
## 
## Coefficients:
##                                                              Estimate
## (Intercept)                                                 -15.63878
## ExposiciónRiesgo bajo                                        -0.35615
## Estrato2                                                      0.33762
## Estrato3                                                     -0.25880
## Estrato4                                                     -0.86636
## SEXOMasculino                                                 0.16086
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.29612
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.07429
## Base$`TIPO VIVIENDA NIÑO`Habitación                          -0.03236
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                        -14.30203
## Base$`PESO MENOS 2,5 KG`2                                    -0.33305
## Base$`LACTANCIA MATERNA`2                                    -0.16538
## Base$`DX PADRES ENF.RESPIRATORIA`2                           -0.01110
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.90344
## Base$`MADRE CONTACTO FUMADORES`2                             -0.65395
## Base$`MADRE FUMÓ EMBARAZO`2                                  -0.29539
## Base$`DX MALNUTRICIÓN`2                                      14.70829
##                                                             Std. Error z value
## (Intercept)                                                  656.51811  -0.024
## ExposiciónRiesgo bajo                                          0.15205  -2.342
## Estrato2                                                       0.26181   1.290
## Estrato3                                                       0.28632  -0.904
## Estrato4                                                       0.65135  -1.330
## SEXOMasculino                                                  0.14924   1.078
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.30902   0.958
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.16107   0.461
## Base$`TIPO VIVIENDA NIÑO`Habitación                            0.71669  -0.045
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         763.89283  -0.019
## Base$`PESO MENOS 2,5 KG`2                                      0.46963  -0.709
## Base$`LACTANCIA MATERNA`2                                      0.30537  -0.542
## Base$`DX PADRES ENF.RESPIRATORIA`2                             0.35577  -0.031
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                            1.02060   0.885
## Base$`MADRE CONTACTO FUMADORES`2                               0.20603  -3.174
## Base$`MADRE FUMÓ EMBARAZO`2                                    1.46475  -0.202
## Base$`DX MALNUTRICIÓN`2                                      656.51762   0.022
##                                                             Pr(>|z|)   
## (Intercept)                                                   0.9810   
## ExposiciónRiesgo bajo                                         0.0192 * 
## Estrato2                                                      0.1972   
## Estrato3                                                      0.3661   
## Estrato4                                                      0.1835   
## SEXOMasculino                                                 0.2811   
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.3379   
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.6446   
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.9640   
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.9851   
## Base$`PESO MENOS 2,5 KG`2                                     0.4782   
## Base$`LACTANCIA MATERNA`2                                     0.5881   
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.9751   
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.3760   
## Base$`MADRE CONTACTO FUMADORES`2                              0.0015 **
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.8402   
## Base$`DX MALNUTRICIÓN`2                                       0.9821   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 595.96  on 620  degrees of freedom
## Residual deviance: 552.84  on 604  degrees of freedom
## AIC: 886.79
## 
## Number of Fisher Scoring iterations: 14
modback4 <- stepAIC(fiebre.model, trace=TRUE, direction="backward")
## Start:  AIC=886.79
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`TIPO VIVIENDA NIÑO`           4   555.91 881.87
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   552.84 884.79
## - Base$`MADRE FUMÓ EMBARAZO`          1   552.88 884.83
## - Base$`LACTANCIA MATERNA`            1   553.15 885.10
## - Base$`PESO MENOS 2,5 KG`            1   553.30 885.25
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   553.89 885.84
## - SEXO                                1   554.01 885.96
## <none>                                    552.84 886.79
## - Base$`DX MALNUTRICIÓN`              1   556.52 888.47
## - Exposición                          1   558.43 890.38
## - Base$`MADRE CONTACTO FUMADORES`     1   561.61 893.57
## - Estrato                             3   568.74 896.69
## 
## Step:  AIC=881.87
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`LACTANCIA MATERNA` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   555.94 879.89
## - Base$`MADRE FUMÓ EMBARAZO`          1   555.97 879.92
## - Base$`LACTANCIA MATERNA`            1   556.19 880.15
## - Base$`PESO MENOS 2,5 KG`            1   556.43 880.38
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   557.05 881.00
## - SEXO                                1   557.14 881.09
## <none>                                    555.91 881.87
## - Base$`DX MALNUTRICIÓN`              1   559.75 883.70
## - Exposición                          1   561.70 885.65
## - Base$`MADRE CONTACTO FUMADORES`     1   564.56 888.51
## - Estrato                             3   570.91 890.86
## 
## Step:  AIC=879.89
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`LACTANCIA MATERNA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`          1   556.01 877.96
## - Base$`LACTANCIA MATERNA`            1   556.22 878.17
## - Base$`PESO MENOS 2,5 KG`            1   556.45 878.40
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   557.07 879.02
## - SEXO                                1   557.18 879.13
## <none>                                    555.94 879.89
## - Base$`DX MALNUTRICIÓN`              1   559.76 881.71
## - Exposición                          1   561.72 883.67
## - Base$`MADRE CONTACTO FUMADORES`     1   564.56 886.51
## - Estrato                             3   570.94 888.90
## 
## Step:  AIC=877.96
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`LACTANCIA MATERNA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`LACTANCIA MATERNA`            1   556.29 876.24
## - Base$`PESO MENOS 2,5 KG`            1   556.56 876.51
## - SEXO                                1   557.24 877.19
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   557.37 877.32
## <none>                                    556.01 877.96
## - Base$`DX MALNUTRICIÓN`              1   559.84 879.79
## - Exposición                          1   561.72 881.67
## - Base$`MADRE CONTACTO FUMADORES`     1   564.66 884.61
## - Estrato                             3   571.25 887.21
## 
## Step:  AIC=876.24
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`            1   556.74 874.69
## - SEXO                                1   557.56 875.52
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   557.83 875.78
## <none>                                    556.29 876.24
## - Base$`DX MALNUTRICIÓN`              1   560.17 878.13
## - Exposición                          1   561.98 879.93
## - Base$`MADRE CONTACTO FUMADORES`     1   565.18 883.13
## - Estrato                             3   571.39 885.34
## 
## Step:  AIC=874.69
## Base$`Casos fiebre` ~ Exposición + Estrato + SEXO + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - SEXO                                1   558.05 874.00
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   558.17 874.12
## <none>                                    556.74 874.69
## - Base$`DX MALNUTRICIÓN`              1   560.67 876.62
## - Exposición                          1   562.41 878.37
## - Base$`MADRE CONTACTO FUMADORES`     1   566.07 882.03
## - Estrato                             3   571.92 883.88
## 
## Step:  AIC=874
## Base$`Casos fiebre` ~ Exposición + Estrato + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   559.54 873.49
## <none>                                    558.05 874.00
## - Base$`DX MALNUTRICIÓN`              1   561.95 875.91
## - Exposición                          1   563.56 877.51
## - Base$`MADRE CONTACTO FUMADORES`     1   567.06 881.02
## - Estrato                             3   573.37 883.32
## 
## Step:  AIC=873.49
## Base$`Casos fiebre` ~ Exposición + Estrato + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                   Df Deviance    AIC
## <none>                                 559.54 873.49
## - Base$`DX MALNUTRICIÓN`           1   563.70 875.65
## - Exposición                       1   565.08 877.04
## - Base$`MADRE CONTACTO FUMADORES`  1   567.26 879.22
## - Estrato                          3   575.11 883.06
modback4 <- update(modback4,Base$`Casos fiebre` ~ Exposición + 
                     Base$`MADRE CONTACTO FUMADORES` )

summary(modback4)
## 
## Call:
## glm(formula = Base$`Casos fiebre` ~ Exposición + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1199  -0.8113  -0.6587  -0.6587   4.2269  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                       -0.4667     0.1901  -2.456  0.01406 * 
## ExposiciónRiesgo bajo             -0.4166     0.1504  -2.771  0.00559 **
## Base$`MADRE CONTACTO FUMADORES`2  -0.6447     0.1970  -3.273  0.00106 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 595.96  on 620  degrees of freedom
## Residual deviance: 579.01  on 618  degrees of freedom
## AIC: 884.97
## 
## Number of Fisher Scoring iterations: 6

Modelo reducido Fiebre

summary(modback4)
## 
## Call:
## glm(formula = Base$`Casos fiebre` ~ Exposición + Base$`MADRE CONTACTO FUMADORES`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1199  -0.8113  -0.6587  -0.6587   4.2269  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)   
## (Intercept)                       -0.4667     0.1901  -2.456  0.01406 * 
## ExposiciónRiesgo bajo             -0.4166     0.1504  -2.771  0.00559 **
## Base$`MADRE CONTACTO FUMADORES`2  -0.6447     0.1970  -3.273  0.00106 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 595.96  on 620  degrees of freedom
## Residual deviance: 579.01  on 618  degrees of freedom
## AIC: 884.97
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback4)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Expectoración

expectoracion.model<-glm(Base$`Casos expectoración` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
## Warning: glm.fit: fitted rates numerically 0 occurred
summary(expectoracion.model)
## 
## Call:
## glm(formula = Base$`Casos expectoración` ~ Exposición + Estrato + 
##     SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3981  -0.4776  -0.3790  -0.2786   3.2759  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                  -17.24620
## ExposiciónRiesgo bajo                                          0.47287
## Estrato2                                                       0.63830
## Estrato3                                                      -0.14252
## Estrato4                                                     -16.82062
## SEXOMasculino                                                 -0.26429
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.33447
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 -0.29728
## Base$`TIPO VIVIENDA NIÑO`Habitación                          -16.86465
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           1.67524
## Base$`LACTANCIA MATERNA`2                                    -16.99592
## Base$`PESO MENOS 2,5 KG`2                                     -2.04317
## Base$`DX PADRES ENF.RESPIRATORIA`2                            -0.78173
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           -0.07226
## Base$`MADRE CONTACTO FUMADORES`2                              -0.10978
## Base$`MADRE FUMÓ EMBARAZO`2                                   17.26374
## Base$`DX MALNUTRICIÓN`2                                        0.18002
##                                                             Std. Error z value
## (Intercept)                                                 4364.37915  -0.004
## ExposiciónRiesgo bajo                                          0.27611   1.713
## Estrato2                                                       0.53221   1.199
## Estrato3                                                       0.57471  -0.248
## Estrato4                                                    1683.27609  -0.010
## SEXOMasculino                                                  0.27002  -0.979
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.50270   0.665
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.31198  -0.953
## Base$`TIPO VIVIENDA NIÑO`Habitación                         3709.04854  -0.005
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           0.66668   2.513
## Base$`LACTANCIA MATERNA`2                                   1224.88957  -0.014
## Base$`PESO MENOS 2,5 KG`2                                      0.50475  -4.048
## Base$`DX PADRES ENF.RESPIRATORIA`2                             0.48257  -1.620
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                            1.39696  -0.052
## Base$`MADRE CONTACTO FUMADORES`2                               0.43184  -0.254
## Base$`MADRE FUMÓ EMBARAZO`2                                 4364.37905   0.004
## Base$`DX MALNUTRICIÓN`2                                        1.41160   0.128
##                                                             Pr(>|z|)    
## (Intercept)                                                   0.9968    
## ExposiciónRiesgo bajo                                         0.0868 .  
## Estrato2                                                      0.2304    
## Estrato3                                                      0.8042    
## Estrato4                                                      0.9920    
## SEXOMasculino                                                 0.3277    
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.5058    
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.3406    
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.9964    
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.0120 *  
## Base$`LACTANCIA MATERNA`2                                     0.9889    
## Base$`PESO MENOS 2,5 KG`2                                   5.17e-05 ***
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.1052    
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.9587    
## Base$`MADRE CONTACTO FUMADORES`2                              0.7993    
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.9968    
## Base$`DX MALNUTRICIÓN`2                                       0.8985    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 317.66  on 620  degrees of freedom
## Residual deviance: 270.22  on 604  degrees of freedom
## AIC: 400
## 
## Number of Fisher Scoring iterations: 17
modback41 <- stepAIC(expectoracion.model, trace=TRUE, direction="backward")
## Start:  AIC=400
## Base$`Casos expectoración` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   270.22 398.01
## - Base$`DX MALNUTRICIÓN`              1   270.24 398.02
## - Base$`MADRE CONTACTO FUMADORES`     1   270.29 398.07
## - SEXO                                1   271.19 398.97
## - Base$`MADRE FUMÓ EMBARAZO`          1   271.23 399.01
## - Base$`TIPO VIVIENDA NIÑO`           4   277.47 399.25
## <none>                                    270.22 400.00
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   272.39 400.17
## - Exposición                          1   273.23 401.01
## - Estrato                             3   283.22 407.00
## - Base$`PESO MENOS 2,5 KG`            1   280.96 408.75
## - Base$`LACTANCIA MATERNA`            1   281.05 408.83
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=398.01
## Base$`Casos expectoración` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`DX MALNUTRICIÓN`             1   270.24 396.02
## - Base$`MADRE CONTACTO FUMADORES`    1   270.29 396.07
## - SEXO                               1   271.19 396.97
## - Base$`MADRE FUMÓ EMBARAZO`         1   271.30 397.08
## - Base$`TIPO VIVIENDA NIÑO`          4   277.80 397.58
## <none>                                   270.22 398.01
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   272.39 398.17
## - Exposición                         1   273.23 399.01
## - Estrato                            3   283.26 405.04
## - Base$`PESO MENOS 2,5 KG`           1   280.96 406.75
## - Base$`LACTANCIA MATERNA`           1   281.05 406.83
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=396.02
## Base$`Casos expectoración` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`MADRE CONTACTO FUMADORES`    1   270.31 394.09
## - SEXO                               1   271.26 395.04
## - Base$`MADRE FUMÓ EMBARAZO`         1   271.38 395.16
## - Base$`TIPO VIVIENDA NIÑO`          4   278.21 395.99
## <none>                                   270.24 396.02
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   272.40 396.18
## - Exposición                         1   273.24 397.02
## - Estrato                            3   283.29 403.07
## - Base$`PESO MENOS 2,5 KG`           1   280.99 404.77
## - Base$`LACTANCIA MATERNA`           1   281.12 404.90
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=394.09
## Base$`Casos expectoración` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ EMBARAZO`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - SEXO                               1   271.36 393.14
## - Base$`MADRE FUMÓ EMBARAZO`         1   271.38 393.17
## - Base$`TIPO VIVIENDA NIÑO`          4   278.21 393.99
## <none>                                   270.31 394.09
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   272.44 394.22
## - Exposición                         1   273.27 395.06
## - Estrato                            3   283.59 401.37
## - Base$`LACTANCIA MATERNA`           1   281.34 403.12
## - Base$`PESO MENOS 2,5 KG`           1   281.76 403.54
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=393.14
## Base$`Casos expectoración` ~ Exposición + Estrato + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ EMBARAZO`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`         1   272.40 392.18
## <none>                                   271.36 393.14
## - Base$`TIPO VIVIENDA NIÑO`          4   279.38 393.16
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   273.43 393.21
## - Exposición                         1   274.24 394.02
## - Estrato                            3   284.40 400.18
## - Base$`LACTANCIA MATERNA`           1   282.40 402.18
## - Base$`PESO MENOS 2,5 KG`           1   282.99 402.77
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=392.18
## Base$`Casos expectoración` ~ Exposición + Estrato + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   274.26 392.04
## <none>                                   272.40 392.18
## - Base$`TIPO VIVIENDA NIÑO`          4   280.61 392.39
## - Exposición                         1   275.08 392.86
## - Estrato                            3   285.12 398.90
## - Base$`PESO MENOS 2,5 KG`           1   284.09 401.87
## - Base$`LACTANCIA MATERNA`           1   285.70 403.48
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=392.04
## Base$`Casos expectoración` ~ Exposición + Estrato + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                             Df Deviance    AIC
## - Base$`TIPO VIVIENDA NIÑO`  4   282.15 391.93
## <none>                           274.26 392.04
## - Exposición                 1   276.94 392.72
## - Estrato                    3   286.66 398.44
## - Base$`PESO MENOS 2,5 KG`   1   285.49 401.27
## - Base$`LACTANCIA MATERNA`   1   286.84 402.62
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=391.93
## Base$`Casos expectoración` ~ Exposición + Estrato + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                            Df Deviance    AIC
## <none>                          282.15 391.93
## - Exposición                1   285.49 393.28
## - Estrato                   3   294.19 397.97
## - Base$`PESO MENOS 2,5 KG`  1   293.64 401.42
## - Base$`LACTANCIA MATERNA`  1   295.19 402.97
modback41 <- update(modback41, Base$`Casos expectoración` ~ Exposición +
                     Base$`PESO MENOS 2,5 KG`)

summary(modback41)
## 
## Call:
## glm(formula = Base$`Casos expectoración` ~ Exposición + Base$`PESO MENOS 2,5 KG`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0460  -0.4617  -0.3659  -0.3659   3.7734  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                -1.0683     0.4812  -2.220 0.026413 *  
## ExposiciónRiesgo bajo       0.4651     0.2707   1.718 0.085774 .  
## Base$`PESO MENOS 2,5 KG`2  -1.6357     0.4680  -3.495 0.000473 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 317.66  on 620  degrees of freedom
## Residual deviance: 306.46  on 618  degrees of freedom
## AIC: 408.24
## 
## Number of Fisher Scoring iterations: 6

modelo Reducido Expectoración

summary(modback41)
## 
## Call:
## glm(formula = Base$`Casos expectoración` ~ Exposición + Base$`PESO MENOS 2,5 KG`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0460  -0.4617  -0.3659  -0.3659   3.7734  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                -1.0683     0.4812  -2.220 0.026413 *  
## ExposiciónRiesgo bajo       0.4651     0.2707   1.718 0.085774 .  
## Base$`PESO MENOS 2,5 KG`2  -1.6357     0.4680  -3.495 0.000473 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 317.66  on 620  degrees of freedom
## Residual deviance: 306.46  on 618  degrees of freedom
## AIC: 408.24
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback41)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Ojos Rojos

ojos_rojos.model<-glm(Base$`Casos ojos rojos` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
## Warning: glm.fit: fitted rates numerically 0 occurred
summary(ojos_rojos.model)
## 
## Call:
## glm(formula = Base$`Casos ojos rojos` ~ Exposición + Estrato + 
##     SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5958  -0.3649  -0.2671  -0.2044   3.1215  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                  -66.21770
## ExposiciónRiesgo bajo                                          0.43305
## Estrato2                                                       0.17467
## Estrato3                                                       0.01958
## Estrato4                                                       0.17171
## SEXOMasculino                                                  0.90226
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   -0.80557
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 -0.25676
## Base$`TIPO VIVIENDA NIÑO`Habitación                          -16.19977
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         -16.07697
## Base$`LACTANCIA MATERNA`2                                     -0.63194
## Base$`PESO MENOS 2,5 KG`2                                     15.88906
## Base$`DX PADRES ENF.RESPIRATORIA`2                            16.03387
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           15.75877
## Base$`MADRE CONTACTO FUMADORES`2                              -0.54756
## Base$`MADRE FUMÓ EMBARAZO`2                                   -0.25452
## Base$`DX MALNUTRICIÓN`2                                       15.55172
##                                                             Std. Error z value
## (Intercept)                                                 5277.70038  -0.013
## ExposiciónRiesgo bajo                                          0.38957   1.112
## Estrato2                                                       0.63539   0.275
## Estrato3                                                       0.67284   0.029
## Estrato4                                                       1.21788   0.141
## SEXOMasculino                                                  0.42148   2.141
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    1.08744  -0.741
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.42401  -0.606
## Base$`TIPO VIVIENDA NIÑO`Habitación                         3703.46830  -0.004
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                        3813.60758  -0.004
## Base$`LACTANCIA MATERNA`2                                      1.02045  -0.619
## Base$`PESO MENOS 2,5 KG`2                                   2509.33737   0.006
## Base$`DX PADRES ENF.RESPIRATORIA`2                          1494.68397   0.011
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                         2699.81539   0.006
## Base$`MADRE CONTACTO FUMADORES`2                               0.54481  -1.005
## Base$`MADRE FUMÓ EMBARAZO`2                                 4551.73339   0.000
## Base$`DX MALNUTRICIÓN`2                                     3662.22439   0.004
##                                                             Pr(>|z|)  
## (Intercept)                                                   0.9900  
## ExposiciónRiesgo bajo                                         0.2663  
## Estrato2                                                      0.7834  
## Estrato3                                                      0.9768  
## Estrato4                                                      0.8879  
## SEXOMasculino                                                 0.0323 *
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.4588  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.5448  
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.9965  
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.9966  
## Base$`LACTANCIA MATERNA`2                                     0.5357  
## Base$`PESO MENOS 2,5 KG`2                                     0.9949  
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.9914  
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.9953  
## Base$`MADRE CONTACTO FUMADORES`2                              0.3149  
## Base$`MADRE FUMÓ EMBARAZO`2                                   1.0000  
## Base$`DX MALNUTRICIÓN`2                                       0.9966  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 181.87  on 620  degrees of freedom
## Residual deviance: 166.21  on 604  degrees of freedom
## AIC: 252.05
## 
## Number of Fisher Scoring iterations: 17
modback5 <- stepAIC(ojos_rojos.model, trace=TRUE, direction="backward")
## Start:  AIC=252.05
## Base$`Casos ojos rojos` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`TIPO VIVIENDA NIÑO`           4   168.06 245.90
## - Estrato                             3   166.38 246.22
## - Base$`MADRE FUMÓ EMBARAZO`          1   166.21 250.05
## - Base$`DX MALNUTRICIÓN`              1   166.45 250.29
## - Base$`LACTANCIA MATERNA`            1   166.68 250.52
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   166.82 250.66
## - Base$`MADRE CONTACTO FUMADORES`     1   167.10 250.94
## - Base$`PESO MENOS 2,5 KG`            1   167.12 250.96
## - Exposición                          1   167.47 251.31
## <none>                                    166.21 252.05
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   169.10 252.95
## - SEXO                                1   171.26 255.10
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=245.9
## Base$`Casos ojos rojos` ~ Exposición + Estrato + SEXO + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Estrato                             3   168.33 240.17
## - Base$`MADRE FUMÓ EMBARAZO`          1   168.06 243.90
## - Base$`DX MALNUTRICIÓN`              1   168.39 244.23
## - Base$`LACTANCIA MATERNA`            1   168.50 244.34
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   168.62 244.46
## - Base$`PESO MENOS 2,5 KG`            1   169.00 244.84
## - Base$`MADRE CONTACTO FUMADORES`     1   169.12 244.97
## - Exposición                          1   169.25 245.09
## <none>                                    168.06 245.90
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   171.06 246.91
## - SEXO                                1   173.31 249.15
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=240.17
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ EMBARAZO`          1   168.33 238.17
## - Base$`DX MALNUTRICIÓN`              1   168.66 238.50
## - Base$`LACTANCIA MATERNA`            1   168.77 238.61
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   168.94 238.78
## - Base$`PESO MENOS 2,5 KG`            1   169.25 239.10
## - Base$`MADRE CONTACTO FUMADORES`     1   169.43 239.27
## - Exposición                          1   169.45 239.29
## <none>                                    168.33 240.17
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   171.43 241.27
## - SEXO                                1   173.68 243.52
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=238.17
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`LACTANCIA MATERNA`            1   168.77 236.61
## - Base$`DX MALNUTRICIÓN`              1   168.78 236.62
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   169.06 236.90
## - Base$`PESO MENOS 2,5 KG`            1   169.25 237.10
## - Base$`MADRE CONTACTO FUMADORES`     1   169.43 237.27
## - Exposición                          1   169.45 237.29
## <none>                                    168.33 238.17
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   171.43 239.27
## - SEXO                                1   173.68 241.52
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=236.61
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`DX MALNUTRICIÓN`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`DX MALNUTRICIÓN`              1   169.31 235.15
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   169.51 235.35
## - Base$`PESO MENOS 2,5 KG`            1   169.81 235.66
## - Base$`MADRE CONTACTO FUMADORES`     1   169.87 235.71
## - Exposición                          1   169.91 235.75
## <none>                                    168.77 236.61
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   171.82 237.66
## - SEXO                                1   174.28 240.12
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=235.15
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                      Df Deviance    AIC
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   170.20 234.04
## - Base$`PESO MENOS 2,5 KG`            1   170.34 234.18
## - Exposición                          1   170.38 234.22
## - Base$`MADRE CONTACTO FUMADORES`     1   170.39 234.24
## <none>                                    169.31 235.15
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   172.43 236.27
## - SEXO                                1   174.89 238.73
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=234.04
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE CONTACTO FUMADORES`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`MADRE CONTACTO FUMADORES`    1   171.05 232.89
## - Base$`PESO MENOS 2,5 KG`           1   171.20 233.04
## - Exposición                         1   171.36 233.20
## <none>                                   170.20 234.04
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   173.55 235.39
## - SEXO                               1   175.84 237.68
## Warning: glm.fit: fitted rates numerically 0 occurred
## 
## Step:  AIC=232.89
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA`
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
##                                     Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`           1   172.00 231.84
## - Exposición                         1   172.23 232.07
## <none>                                   171.05 232.89
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   174.42 234.26
## - SEXO                               1   176.48 236.32
## 
## Step:  AIC=231.84
## Base$`Casos ojos rojos` ~ Exposición + SEXO + Base$`DX PADRES ENF.RESPIRATORIA`
## 
##                                     Df Deviance    AIC
## - Exposición                         1   173.20 231.04
## <none>                                   172.00 231.84
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   175.37 233.21
## - SEXO                               1   177.44 235.28
## 
## Step:  AIC=231.04
## Base$`Casos ojos rojos` ~ SEXO + Base$`DX PADRES ENF.RESPIRATORIA`
## 
##                                     Df Deviance    AIC
## <none>                                   173.20 231.04
## - Base$`DX PADRES ENF.RESPIRATORIA`  1   176.52 232.36
## - SEXO                               1   178.72 234.56
modback5 <- update(modback5, Base$`Casos ojos rojos` ~ SEXO )

summary(modback5)
## 
## Call:
## glm(formula = Base$`Casos ojos rojos` ~ SEXO, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.3592  -0.3592  -0.2268  -0.2268   3.1409  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    -3.6604     0.3536 -10.353   <2e-16 ***
## SEXOMasculino   0.9195     0.4183   2.198   0.0279 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 181.87  on 620  degrees of freedom
## Residual deviance: 176.52  on 619  degrees of freedom
## AIC: 232.36
## 
## Number of Fisher Scoring iterations: 6

Modelo Reducido Ojos Rojos

summary(modback5)
## 
## Call:
## glm(formula = Base$`Casos ojos rojos` ~ SEXO, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.3592  -0.3592  -0.2268  -0.2268   3.1409  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    -3.6604     0.3536 -10.353   <2e-16 ***
## SEXOMasculino   0.9195     0.4183   2.198   0.0279 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 181.87  on 620  degrees of freedom
## Residual deviance: 176.52  on 619  degrees of freedom
## AIC: 232.36
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback5)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results)  

Fiebre y tos

fiebre_tos.model<-glm(Base$`Fiebre y tos` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
## Warning: glm.fit: fitted rates numerically 0 occurred
summary(fiebre_tos.model)
## 
## Call:
## glm(formula = Base$`Fiebre y tos` ~ Exposición + Estrato + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8901  -0.4670  -0.3877  -0.2969   3.0848  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                  -34.19932
## ExposiciónRiesgo bajo                                         -0.53388
## Estrato2                                                       0.57029
## Estrato3                                                       0.03789
## Estrato4                                                      -0.84292
## SEXOMasculino                                                 -0.24669
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.75777
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 -0.37212
## Base$`TIPO VIVIENDA NIÑO`Habitación                          -16.16826
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         -15.22720
## Base$`LACTANCIA MATERNA`2                                     -0.13274
## Base$`PESO MENOS 2,5 KG`2                                      0.07362
## Base$`DX PADRES ENF.RESPIRATORIA`2                             1.09155
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           15.73359
## Base$`MADRE CONTACTO FUMADORES`2                              -0.52477
## Base$`MADRE FUMÓ EMBARAZO`2                                    0.03500
## Base$`DX MALNUTRICIÓN`2                                       15.53632
##                                                             Std. Error z value
## (Intercept)                                                 2807.65310  -0.012
## ExposiciónRiesgo bajo                                          0.27455  -1.945
## Estrato2                                                       0.52812   1.080
## Estrato3                                                       0.56342   0.067
## Estrato4                                                       1.16872  -0.721
## SEXOMasculino                                                  0.26372  -0.935
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.43801   1.730
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.31356  -1.187
## Base$`TIPO VIVIENDA NIÑO`Habitación                         2146.46290  -0.008
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                        1960.76436  -0.008
## Base$`LACTANCIA MATERNA`2                                      0.52254  -0.254
## Base$`PESO MENOS 2,5 KG`2                                      1.02228   0.072
## Base$`DX PADRES ENF.RESPIRATORIA`2                             1.01602   1.074
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                         1583.90142   0.010
## Base$`MADRE CONTACTO FUMADORES`2                               0.38735  -1.355
## Base$`MADRE FUMÓ EMBARAZO`2                                 2822.01318   0.000
## Base$`DX MALNUTRICIÓN`2                                     1913.29702   0.008
##                                                             Pr(>|z|)  
## (Intercept)                                                   0.9903  
## ExposiciónRiesgo bajo                                         0.0518 .
## Estrato2                                                      0.2802  
## Estrato3                                                      0.9464  
## Estrato4                                                      0.4708  
## SEXOMasculino                                                 0.3496  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.0836 .
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.2353  
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.9940  
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.9938  
## Base$`LACTANCIA MATERNA`2                                     0.7995  
## Base$`PESO MENOS 2,5 KG`2                                     0.9426  
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.2827  
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.9921  
## Base$`MADRE CONTACTO FUMADORES`2                              0.1755  
## Base$`MADRE FUMÓ EMBARAZO`2                                   1.0000  
## Base$`DX MALNUTRICIÓN`2                                       0.9935  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 289.88  on 620  degrees of freedom
## Residual deviance: 266.36  on 604  degrees of freedom
## AIC: 412.58
## 
## Number of Fisher Scoring iterations: 16
modback6 <- stepAIC(fiebre_tos.model, trace=FALSE, direction="backward")
## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred

## Warning: glm.fit: fitted rates numerically 0 occurred
modback6 <- update(modback6, Base$`Fiebre y tos` ~ Exposición )

summary(modback6)
## 
## Call:
## glm(formula = Base$`Fiebre y tos` ~ Exposición, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4967  -0.4967  -0.3663  -0.3663   3.6597  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            -2.0925     0.1622  -12.90   <2e-16 ***
## ExposiciónRiesgo bajo  -0.6092     0.2719   -2.24   0.0251 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 289.88  on 620  degrees of freedom
## Residual deviance: 284.64  on 619  degrees of freedom
## AIC: 400.86
## 
## Number of Fisher Scoring iterations: 6

Modelo Reducido Fiebre y tos

summary(modback6)
## 
## Call:
## glm(formula = Base$`Fiebre y tos` ~ Exposición, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4967  -0.4967  -0.3663  -0.3663   3.6597  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            -2.0925     0.1622  -12.90   <2e-16 ***
## ExposiciónRiesgo bajo  -0.6092     0.2719   -2.24   0.0251 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 289.88  on 620  degrees of freedom
## Residual deviance: 284.64  on 619  degrees of freedom
## AIC: 400.86
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback6)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

Nariz Tapada o mocos y tos

nartapada_mocos_tos.model<-glm(Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
summary(nartapada_mocos_tos.model)
## 
## Call:
## glm(formula = Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + 
##     Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2831  -0.9944  -0.8868   0.5541   4.9593  
## 
## Coefficients:
##                                                              Estimate
## (Intercept)                                                 -15.69271
## ExposiciónRiesgo bajo                                        -0.08868
## Estrato2                                                      0.09408
## Estrato3                                                     -0.01031
## Estrato4                                                     -0.50132
## SEXOMasculino                                                 0.12709
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.12777
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                -0.29115
## Base$`TIPO VIVIENDA NIÑO`Habitación                          -0.48017
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         -0.08828
## Base$`LACTANCIA MATERNA`2                                    -0.14329
## Base$`PESO MENOS 2,5 KG`2                                     0.45871
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.19049
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           1.50461
## Base$`MADRE CONTACTO FUMADORES`2                             -0.32711
## Base$`MADRE FUMÓ EMBARAZO`2                                  13.62840
## Base$`DX MALNUTRICIÓN`2                                      -0.50528
##                                                             Std. Error z value
## (Intercept)                                                  473.14285  -0.033
## ExposiciónRiesgo bajo                                          0.11962  -0.741
## Estrato2                                                       0.20722   0.454
## Estrato3                                                       0.21618  -0.048
## Estrato4                                                       0.44271  -1.132
## SEXOMasculino                                                  0.11943   1.064
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)    0.23168   0.551
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                  0.13795  -2.111
## Base$`TIPO VIVIENDA NIÑO`Habitación                            0.71224  -0.674
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                           0.72011  -0.123
## Base$`LACTANCIA MATERNA`2                                      0.24145  -0.593
## Base$`PESO MENOS 2,5 KG`2                                      0.58451   0.785
## Base$`DX PADRES ENF.RESPIRATORIA`2                             0.29853   0.638
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                            1.02011   1.475
## Base$`MADRE CONTACTO FUMADORES`2                               0.18813  -1.739
## Base$`MADRE FUMÓ EMBARAZO`2                                  473.14190   0.029
## Base$`DX MALNUTRICIÓN`2                                        0.51974  -0.972
##                                                             Pr(>|z|)  
## (Intercept)                                                   0.9735  
## ExposiciónRiesgo bajo                                         0.4585  
## Estrato2                                                      0.6498  
## Estrato3                                                      0.9619  
## Estrato4                                                      0.2575  
## SEXOMasculino                                                 0.2873  
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)   0.5813  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                 0.0348 *
## Base$`TIPO VIVIENDA NIÑO`Habitación                           0.5002  
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                          0.9024  
## Base$`LACTANCIA MATERNA`2                                     0.5529  
## Base$`PESO MENOS 2,5 KG`2                                     0.4326  
## Base$`DX PADRES ENF.RESPIRATORIA`2                            0.5234  
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                           0.1402  
## Base$`MADRE CONTACTO FUMADORES`2                              0.0821 .
## Base$`MADRE FUMÓ EMBARAZO`2                                   0.9770  
## Base$`DX MALNUTRICIÓN`2                                       0.3310  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 796.79  on 620  degrees of freedom
## Residual deviance: 775.18  on 604  degrees of freedom
## AIC: 1222.2
## 
## Number of Fisher Scoring iterations: 13
modback7 <- stepAIC(nartapada_mocos_tos.model, trace=TRUE, direction="backward")
## Start:  AIC=1222.17
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + Estrato + 
##     SEXO + Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + 
##     Base$`PESO MENOS 2,5 KG` + Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Estrato                             3   777.99 1219.0
## - Base$`TIPO VIVIENDA NIÑO`           4   781.12 1220.1
## - Base$`LACTANCIA MATERNA`            1   775.54 1220.5
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   775.61 1220.6
## - Exposición                          1   775.73 1220.7
## - Base$`PESO MENOS 2,5 KG`            1   775.89 1220.9
## - Base$`DX MALNUTRICIÓN`              1   776.00 1221.0
## - SEXO                                1   776.31 1221.3
## <none>                                    775.18 1222.2
## - Base$`MADRE FUMÓ EMBARAZO`          1   777.55 1222.5
## - Base$`MADRE CONTACTO FUMADORES`     1   777.97 1223.0
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   778.77 1223.8
## 
## Step:  AIC=1218.99
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + SEXO + 
##     Base$`TIPO VIVIENDA NIÑO` + Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##     Base$`DX PADRES ENF.RESPIRATORIA` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`TIPO VIVIENDA NIÑO`           4   783.48 1216.5
## - Base$`LACTANCIA MATERNA`            1   778.30 1217.3
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   778.51 1217.5
## - Base$`PESO MENOS 2,5 KG`            1   778.76 1217.8
## - Exposición                          1   778.81 1217.8
## - Base$`DX MALNUTRICIÓN`              1   778.98 1218.0
## - SEXO                                1   779.10 1218.1
## <none>                                    777.99 1219.0
## - Base$`MADRE FUMÓ EMBARAZO`          1   780.32 1219.3
## - Base$`MADRE CONTACTO FUMADORES`     1   781.03 1220.0
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   781.86 1220.8
## 
## Step:  AIC=1216.47
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + SEXO + 
##     Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`LACTANCIA MATERNA`            1   783.70 1214.7
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   784.24 1215.2
## - Base$`PESO MENOS 2,5 KG`            1   784.26 1215.3
## - Exposición                          1   784.39 1215.4
## - Base$`DX MALNUTRICIÓN`              1   784.61 1215.6
## - SEXO                                1   784.66 1215.7
## <none>                                    783.48 1216.5
## - Base$`MADRE FUMÓ EMBARAZO`          1   785.82 1216.8
## - Base$`MADRE CONTACTO FUMADORES`     1   786.46 1217.5
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   787.03 1218.0
## 
## Step:  AIC=1214.7
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + SEXO + 
##     Base$`PESO MENOS 2,5 KG` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX PADRES ENF.RESPIRATORIA`   1   784.43 1213.4
## - Base$`PESO MENOS 2,5 KG`            1   784.58 1213.6
## - Exposición                          1   784.64 1213.6
## - Base$`DX MALNUTRICIÓN`              1   784.73 1213.7
## - SEXO                                1   784.92 1213.9
## <none>                                    783.70 1214.7
## - Base$`MADRE FUMÓ EMBARAZO`          1   785.99 1215.0
## - Base$`MADRE CONTACTO FUMADORES`     1   786.72 1215.7
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   787.27 1216.3
## 
## Step:  AIC=1213.43
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + SEXO + 
##     Base$`PESO MENOS 2,5 KG` + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`PESO MENOS 2,5 KG`            1   785.27 1212.3
## - Base$`DX MALNUTRICIÓN`              1   785.35 1212.3
## - Exposición                          1   785.37 1212.4
## - SEXO                                1   785.59 1212.6
## <none>                                    784.43 1213.4
## - Base$`MADRE FUMÓ EMBARAZO`          1   786.74 1213.7
## - Base$`MADRE CONTACTO FUMADORES`     1   787.56 1214.6
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   787.92 1214.9
## 
## Step:  AIC=1212.27
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Exposición + SEXO + 
##     Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##     Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Exposición                          1   786.20 1211.2
## - Base$`DX MALNUTRICIÓN`              1   786.20 1211.2
## - SEXO                                1   786.42 1211.4
## <none>                                    785.27 1212.3
## - Base$`MADRE FUMÓ EMBARAZO`          1   787.63 1212.6
## - Base$`MADRE CONTACTO FUMADORES`     1   788.24 1213.2
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   788.69 1213.7
## 
## Step:  AIC=1211.2
## Base$`Agrupados Nariz tapada o mocos y tos` ~ SEXO + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO` + 
##     Base$`DX MALNUTRICIÓN`
## 
##                                      Df Deviance    AIC
## - Base$`DX MALNUTRICIÓN`              1   787.08 1210.1
## - SEXO                                1   787.32 1210.3
## <none>                                    786.20 1211.2
## - Base$`MADRE FUMÓ EMBARAZO`          1   788.68 1211.7
## - Base$`MADRE CONTACTO FUMADORES`     1   789.15 1212.1
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   789.47 1212.5
## 
## Step:  AIC=1210.08
## Base$`Agrupados Nariz tapada o mocos y tos` ~ SEXO + Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO`
## 
##                                      Df Deviance    AIC
## - SEXO                                1   788.25 1209.2
## - Base$`MADRE FUMÓ EMBARAZO`          1   789.02 1210.0
## <none>                                    787.08 1210.1
## - Base$`MADRE CONTACTO FUMADORES`     1   789.90 1210.9
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   789.96 1211.0
## 
## Step:  AIC=1209.24
## Base$`Agrupados Nariz tapada o mocos y tos` ~ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES` + Base$`MADRE FUMÓ EMBARAZO`
## 
##                                      Df Deviance    AIC
## <none>                                    788.25 1209.2
## - Base$`MADRE FUMÓ EMBARAZO`          1   790.27 1209.3
## - Base$`MADRE CONTACTO FUMADORES`     1   790.94 1209.9
## - Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`  1   791.14 1210.1
modback7 <- update( modback7, Base$`Agrupados Nariz tapada o mocos y tos` ~ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` )
summary(modback7)
## 
## Call:
## glm(formula = Base$`Agrupados Nariz tapada o mocos y tos` ~ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1030  -0.9518  -0.9518   0.6999   5.0235  
## 
## Coefficients:
##                                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)                          -2.2229     1.0010  -2.221   0.0264 *
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2   1.7258     1.0089   1.711   0.0872 .
## Base$`MADRE CONTACTO FUMADORES`2     -0.2949     0.1864  -1.582   0.1136  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 796.79  on 620  degrees of freedom
## Residual deviance: 790.27  on 618  degrees of freedom
## AIC: 1209.3
## 
## Number of Fisher Scoring iterations: 6

Modelo reducido Nariz Tapada o mocos y tos

summary(modback7)
## 
## Call:
## glm(formula = Base$`Agrupados Nariz tapada o mocos y tos` ~ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + 
##     Base$`MADRE CONTACTO FUMADORES`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1030  -0.9518  -0.9518   0.6999   5.0235  
## 
## Coefficients:
##                                     Estimate Std. Error z value Pr(>|z|)  
## (Intercept)                          -2.2229     1.0010  -2.221   0.0264 *
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2   1.7258     1.0089   1.711   0.0872 .
## Base$`MADRE CONTACTO FUMADORES`2     -0.2949     0.1864  -1.582   0.1136  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 796.79  on 620  degrees of freedom
## Residual deviance: 790.27  on 618  degrees of freedom
## AIC: 1209.3
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback7)


model_results <- round(cbind(Beta=results[,1], 
                       RR = exp(results[,1]),
                       LCI = exp(results[,1] +
                                   qnorm(0.05/2)*results[,2]),
                       UCI = exp(results[,1] -
                                   qnorm(0.05/2)*results[,2]),
                       P = results[,4]),5)


DT::datatable( model_results) 

nariz tapada mocos o fiebre

nartapada_mocos_fiebre.model<-glm(Base$`Agrupados Nariz tapada o mocos y fiebre` ~ Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO`+ Base$`LACTANCIA MATERNA`+
                 Base$`PESO MENOS 2,5 KG`+Base$`TIPO VIVIENDA NIÑO`+ 
                 Base$`DX PADRES ENF.RESPIRATORIA`+ Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`+
                 Base$`MADRE CONTACTO FUMADORES`+ Base$`MADRE FUMÓ EMBARAZO`+
                 Base$`DX MALNUTRICIÓN`, data=Base, family = poisson(link = "log"))
summary(nartapada_mocos_fiebre.model)
## 
## Call:
## glm(formula = Base$`Agrupados Nariz tapada o mocos y fiebre` ~ 
##     Exposición + Estrato + SEXO + Base$`TIPO VIVIENDA NIÑO` + 
##         Base$`LACTANCIA MATERNA` + Base$`PESO MENOS 2,5 KG` + 
##         Base$`TIPO VIVIENDA NIÑO` + Base$`DX PADRES ENF.RESPIRATORIA` + 
##         Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)` + Base$`MADRE CONTACTO FUMADORES` + 
##         Base$`MADRE FUMÓ EMBARAZO` + Base$`DX MALNUTRICIÓN`, 
##     family = poisson(link = "log"), data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.9537  -0.5634  -0.4003  -0.3157   3.3816  
## 
## Coefficients:
##                                                               Estimate
## (Intercept)                                                 -3.042e+01
## ExposiciónRiesgo bajo                                       -8.549e-01
## Estrato2                                                    -1.716e-01
## Estrato3                                                    -5.663e-01
## Estrato4                                                    -1.585e+00
## SEXOMasculino                                                5.278e-04
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  7.697e-01
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)               -9.204e-02
## Base$`TIPO VIVIENDA NIÑO`Habitación                         -1.532e+01
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                        -1.438e+01
## Base$`LACTANCIA MATERNA`2                                   -9.856e-02
## Base$`PESO MENOS 2,5 KG`2                                    3.253e-01
## Base$`DX PADRES ENF.RESPIRATORIA`2                          -1.192e-01
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                          5.706e-01
## Base$`MADRE CONTACTO FUMADORES`2                            -9.608e-01
## Base$`MADRE FUMÓ EMBARAZO`2                                  1.452e+01
## Base$`DX MALNUTRICIÓN`2                                      1.450e+01
##                                                             Std. Error z value
## (Intercept)                                                  1.956e+03  -0.016
## ExposiciónRiesgo bajo                                        2.552e-01  -3.350
## Estrato2                                                     3.555e-01  -0.483
## Estrato3                                                     3.891e-01  -1.455
## Estrato4                                                     1.088e+00  -1.456
## SEXOMasculino                                                2.307e-01   0.002
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal)  4.076e-01   1.889
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)                2.613e-01  -0.352
## Base$`TIPO VIVIENDA NIÑO`Habitación                          1.242e+03  -0.012
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                         1.298e+03  -0.011
## Base$`LACTANCIA MATERNA`2                                    4.686e-01  -0.210
## Base$`PESO MENOS 2,5 KG`2                                    1.019e+00   0.319
## Base$`DX PADRES ENF.RESPIRATORIA`2                           5.244e-01  -0.227
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                          1.043e+00   0.547
## Base$`MADRE CONTACTO FUMADORES`2                             3.004e-01  -3.198
## Base$`MADRE FUMÓ EMBARAZO`2                                  1.613e+03   0.009
## Base$`DX MALNUTRICIÓN`2                                      1.106e+03   0.013
##                                                             Pr(>|z|)    
## (Intercept)                                                 0.987593    
## ExposiciónRiesgo bajo                                       0.000807 ***
## Estrato2                                                    0.629380    
## Estrato3                                                    0.145573    
## Estrato4                                                    0.145335    
## SEXOMasculino                                               0.998175    
## Base$`TIPO VIVIENDA NIÑO`Apartamento (Propiedad horizontal) 0.058938 .  
## Base$`TIPO VIVIENDA NIÑO`Casa (Independiente)               0.724635    
## Base$`TIPO VIVIENDA NIÑO`Habitación                         0.990155    
## Base$`TIPO VIVIENDA NIÑO`Inquilinato                        0.991158    
## Base$`LACTANCIA MATERNA`2                                   0.833410    
## Base$`PESO MENOS 2,5 KG`2                                   0.749467    
## Base$`DX PADRES ENF.RESPIRATORIA`2                          0.820176    
## Base$`MADRE FUMÓ DOS AÑOS NIÑO(A)`2                         0.584193    
## Base$`MADRE CONTACTO FUMADORES`2                            0.001383 ** 
## Base$`MADRE FUMÓ EMBARAZO`2                                 0.992819    
## Base$`DX MALNUTRICIÓN`2                                     0.989539    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 373.02  on 620  degrees of freedom
## Residual deviance: 338.69  on 604  degrees of freedom
## AIC: 499.74
## 
## Number of Fisher Scoring iterations: 15
modback8 <- stepAIC(nartapada_mocos_fiebre.model, trace=FALSE, direction="backward")

Modelo reducido

summary(modback8)
## 
## Call:
## glm(formula = Base$`Agrupados Nariz tapada o mocos y fiebre` ~ 
##     Exposición + Base$`MADRE CONTACTO FUMADORES`, family = poisson(link = "log"), 
##     data = Base)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8517  -0.5583  -0.3525  -0.3525   3.4723  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       -1.0142     0.2690  -3.770 0.000163 ***
## ExposiciónRiesgo bajo             -0.9198     0.2529  -3.636 0.000276 ***
## Base$`MADRE CONTACTO FUMADORES`2  -0.8447     0.2882  -2.931 0.003382 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 373.02  on 620  degrees of freedom
## Residual deviance: 351.40  on 618  degrees of freedom
## AIC: 484.45
## 
## Number of Fisher Scoring iterations: 6
results <- coeftest(modback8)


model_results <- round(cbind(Beta=results[,1], exp(cbind(RR = results[,1], 
                                       LCI = results[,1] + qnorm(0.05/2)*results[,2],
                                       UCI = results[,1] - qnorm(0.05/2)*results[,2])),
                                       P = results[,4]),5)


DT::datatable( model_results)