path="/Users/mauriciogutierrez/Library/Mobile Documents/com~apple~CloudDocs/estadisticas";
pathfunctions=paste(path,"/general_functions_new.R",sep="")
pathdatabase=paste(path,"/orellano/planilla2.xlsx",sep="")

source(pathfunctions)
## Loading required package: XLConnectJars
## XLConnect 0.2-12 by Mirai Solutions GmbH [aut],
##   Martin Studer [cre],
##   The Apache Software Foundation [ctb, cph] (Apache POI, Apache Commons
##     Codec),
##   Stephen Colebourne [ctb, cph] (Joda-Time Java library),
##   Graph Builder [ctb, cph] (Curvesapi Java library)
## http://www.mirai-solutions.com ,
## http://miraisolutions.wordpress.com
data=readexcel(pathdatabase,"Dtos")
data$edad=as.numeric(data$edad)
labeledad=c("Menor a 50","Entre 50 y 70","Mayor a 70")
labelsexo=c("Masculino","Femenino")
labeldicotomico=c("No","Si")
labetipodiabetes=c("DM2","DM1")
labeltratamientos=c("ADO","ADO+IR","IR")
labelHba1c=c("Menor a 7%","Entre 7% y 9%","Mas 9%","Codigo 3")
labellabelvasculopatia=c("No","Si","No valorable")
labellocalizacion=c("0",
                    "0 y 0",
                    "0 y Cara plantar metatarsiano",
                    "Cara plantar metatarsiano",
                    "Cara plantar metatarsiano y Otras",
                    "talon",
                    "talon  y muñon", 
                    "muñon",
                    "Muñon y muñon",
                    "Otras")
labelcultivos=c("Esteril","Germen especifico","FPM")
labeltexas=c("1a","1b","1c","2a","2b","2c","2d","3b","3c","3d")

freq (data,data$edad,labeledad,using_na = T)

## 
##               absoluta relativa acumulada intervalo confianza inferior
## Menor a 50           7    14.29     14.29                         5.94
## Entre 50 y 70       31    63.27     77.55                        48.29
## Mayor a 70          11    22.45       100                        11.77
## Total               49   100.00                                       
##               intervalo confianza inferior
## Menor a 50                           27.24
## Entre 50 y 70                        76.58
## Mayor a 70                           36.62
## Total
freq (data,data$sexo,labelsexo,using_na = T)

## 
##           absoluta relativa acumulada intervalo confianza inferior
## Masculino       37    75.51     75.51                        61.13
## Femenino        12    24.49       100                        13.34
## Total           49   100.00                                       
##           intervalo confianza inferior
## Masculino                        86.66
## Femenino                         38.87
## Total
freq (data,data$DM,labetipodiabetes,using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## DM2         45    91.84     91.84                         80.4
## DM1          4     8.16       100                         2.27
## Total       49   100.00                                       
##       intervalo confianza inferior
## DM2                          97.73
## DM1                           19.6
## Total
freq (data,data$Tto,labeltratamientos,using_na = T)

## 
##        absoluta relativa acumulada intervalo confianza inferior
## ADO          21    42.86     42.86                        28.82
## ADO+IR       16    32.65     75.51                        19.95
## IR           12    24.49       100                        13.34
## Total        49   100.00                                       
##        intervalo confianza inferior
## ADO                           57.79
## ADO+IR                        47.54
## IR                            38.87
## Total
freq (data,data$Hba1c,labelHba1c,using_na=T)

## 
##               absoluta relativa acumulada intervalo confianza inferior
## Menor a 7%           7    14.29     14.29                         5.94
## Entre 7% y 9%       12    24.49     38.78                        13.34
## Mas 9%              16    32.65     71.43                        19.95
## Codigo 3            14    28.57       100                        16.58
## Total               49   100.00                                       
##               intervalo confianza inferior
## Menor a 7%                           27.24
## Entre 7% y 9%                        38.87
## Mas 9%                               47.54
## Codigo 3                             43.26
## Total
freq (data,data$vasculopatia.CLINICA,labellabelvasculopatia,using_na=T)

## 
##              absoluta relativa acumulada intervalo confianza inferior
## No                 29    59.18     59.18                        44.21
## Si                 19    38.78     97.96                         25.2
## No valorable        1     2.04       100                         0.05
## Total              49   100.00                                       
##              intervalo confianza inferior
## No                                     73
## Si                                  53.76
## No valorable                        10.85
## Total
freq (data,data$dopplerpositivoaoc,c("Si"))

## 
##           absoluta relativa acumulada intervalo confianza inferior
## Si              22     44.9      44.9                        30.67
## Ausencias       27     55.1    100.00                        40.23
## Total           22   100.00                                       
##           intervalo confianza inferior
## Si                               59.77
## Ausencias                        69.33
## Total
freq (data,data$dopplernegatiivoaoc,c("Si"))

## 
##           absoluta relativa acumulada intervalo confianza inferior
## Si               2     4.08      4.08                          0.5
## Ausencias       47    95.92    100.00                        86.02
## Total            2   100.00                                       
##           intervalo confianza inferior
## Si                               13.98
## Ausencias                         99.5
## Total
freq (data,data$retinopatia,c("No","Si","Sin dato"),using_na=T)

## 
##          absoluta relativa acumulada intervalo confianza inferior
## No             18    36.73     36.73                        23.42
## Si             25    51.02     87.76                        36.34
## Sin dato        6    12.24       100                         4.63
## Total          49   100.00                                       
##          intervalo confianza inferior
## No                              51.71
## Si                              65.58
## Sin dato                        24.77
## Total
freq (data,data$IRC,c("No","Si","Sin dato"),using_na=T)

## 
##          absoluta relativa acumulada intervalo confianza inferior
## No             30    61.22     61.22                        46.24
## Si             17    34.69     95.92                        21.67
## Sin dato        2     4.08       100                          0.5
## Total          49   100.00                                       
##          intervalo confianza inferior
## No                               74.8
## Si                              49.64
## Sin dato                        13.98
## Total
freq (data,data$CHARCOT,labeldicotomico,using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          46    93.88     93.88                        83.13
## Si           3     6.12       100                         1.28
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           98.72
## Si                           16.87
## Total
freq (data,data$Ulceras.PREVIAS,c("No","Si","Sin dato"),using_na = T)

## 
##          absoluta relativa acumulada intervalo confianza inferior
## No             18    36.73     36.73                        23.42
## Si             28    57.14     93.88                        42.21
## Sin dato        3     6.12       100                         1.28
## Total          49   100.00                                       
##          intervalo confianza inferior
## No                              51.71
## Si                              71.18
## Sin dato                        16.87
## Total
freq (data,data$amputaciones_previas,c("No","Si","Sin dato"),using_na = T)

## 
##          absoluta relativa acumulada intervalo confianza inferior
## No             34    69.39     69.39                        54.58
## Si             14    28.57     97.96                        16.58
## Sin dato        1     2.04       100                         0.05
## Total          49   100.00                                       
##          intervalo confianza inferior
## No                              81.75
## Si                              43.26
## Sin dato                        10.85
## Total
freq (data,data$localizacion.ulcera.actual,using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## 0           20    40.82     40.82                           27
## 0 y 0        1     2.04     42.86                         0.05
## 0 y 1        2     4.08     46.94                          0.5
## 1            7    14.29     61.22                         5.94
## 1 y 4        1     2.04     63.27                         0.05
## 2            1     2.04     65.31                         0.05
## 2 y 3        1     2.04     67.35                         0.05
## 3           13    26.53     93.88                        14.95
## 3 y 3        1     2.04     95.92                         0.05
## 4            2     4.08       100                          0.5
## Total       49   100.00                                       
##       intervalo confianza inferior
## 0                            55.79
## 0 y 0                        10.85
## 0 y 1                        13.98
## 1                            27.24
## 1 y 4                        10.85
## 2                            10.85
## 2 y 3                        10.85
## 3                            41.08
## 3 y 3                        10.85
## 4                            13.98
## Total
freq (data,data$localizacion,labellocalizacion,using_na = T)

## 
##                                   absoluta relativa acumulada
## 0                                       20    40.82     40.82
## 0 y 0                                    1     2.04     42.86
## 0 y Cara plantar metatarsiano            2     4.08     46.94
## Cara plantar metatarsiano                7    14.29     61.22
## Cara plantar metatarsiano y Otras        1     2.04     63.27
## talon                                    1     2.04     65.31
## talon  y muñon                           1     2.04     67.35
## muñon                                   13    26.53     93.88
## Muñon y muñon                            1     2.04     95.92
## Otras                                    2     4.08       100
## Total                                   49   100.00          
##                                   intervalo confianza inferior
## 0                                                           27
## 0 y 0                                                     0.05
## 0 y Cara plantar metatarsiano                              0.5
## Cara plantar metatarsiano                                 5.94
## Cara plantar metatarsiano y Otras                         0.05
## talon                                                     0.05
## talon  y muñon                                            0.05
## muñon                                                    14.95
## Muñon y muñon                                             0.05
## Otras                                                      0.5
## Total                                                         
##                                   intervalo confianza inferior
## 0                                                        55.79
## 0 y 0                                                    10.85
## 0 y Cara plantar metatarsiano                            13.98
## Cara plantar metatarsiano                                27.24
## Cara plantar metatarsiano y Otras                        10.85
## talon                                                    10.85
## talon  y muñon                                           10.85
## muñon                                                    41.08
## Muñon y muñon                                            10.85
## Otras                                                    13.98
## Total
#freq (data,data$X.infeccion_clinica_cultivo,labeldicotomico,using_na = T)
freq (data,data$masadeunaulcera,labeldicotomico,using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          43    87.76     87.76                        75.23
## Si           6    12.24       100                         4.63
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           95.37
## Si                           24.77
## Total
freq (data,data$cultivos,labelcultivos, using_na = T)

## 
##                   absoluta relativa acumulada intervalo confianza inferior
## Esteril                  1     8.33      8.33                         0.21
## Germen especifico        6       50     58.33                        21.09
## FPM                      5    41.67       100                        15.17
## Total                   12   100.00                                       
##                   intervalo confianza inferior
## Esteril                                  38.48
## Germen especifico                        78.91
## FPM                                      72.33
## Total
freq (data,data$X.RX,labeldicotomico, using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          25    51.02     51.02                        36.34
## Si          24    48.98       100                        34.42
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           65.58
## Si                           63.66
## Total
freq (data,data$osteomelitis_segun_rx,labeldicotomico, using_na = T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          19    79.17     79.17                        57.85
## Si           5    20.83       100                         7.13
## Total       24   100.00                                       
##       intervalo confianza inferior
## No                           92.87
## Si                           42.15
## Total
freq (data,data$X.RNM,labeldicotomico,using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          45    91.84     91.84                         80.4
## Si           4     8.16       100                         2.27
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           97.73
## Si                            19.6
## Total
freq (data,data$Osteomelitis_segun_rnm,labeldicotomico,using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No           3       75        75                        19.41
## Si           1       25       100                         0.63
## Total        4   100.00                                       
##       intervalo confianza inferior
## No                           99.37
## Si                           80.59
## Total
freq (data,data$centellograma_oseo,labeldicotomico,using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          48    97.96     97.96                        89.15
## Si           1     2.04       100                         0.05
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           99.95
## Si                           10.85
## Total
#freq (data,data$Osteomelitis_segun_co,c("No"),using_na=T) ## El unico que se hizo dio negativo

freq (data,data$Atb,labeldicotomico,using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          17    34.69     34.69                        21.67
## Si          32    65.31       100                        50.36
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           49.64
## Si                           78.33
## Total
freq (data,data$Wagner+1,using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## 1           19    38.78     38.78                         25.2
## 2           10    20.41     59.18                        10.24
## 3           17    34.69     93.88                        21.67
## 4            3     6.12       100                         1.28
## Total       49   100.00                                       
##       intervalo confianza inferior
## 1                            53.76
## 2                            34.34
## 3                            49.64
## 4                            16.87
## Total
freq (data,data$texas,c(labeltexas),using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## 1a          14    28.57     28.57                        16.58
## 1b           5     10.2     38.78                          3.4
## 1c           3     6.12      44.9                         1.28
## 2a           5     10.2      55.1                          3.4
## 2b           6    12.24     67.35                         4.63
## 2c           1     2.04     69.39                         0.05
## 2d           1     2.04     71.43                         0.05
## 3b           8    16.33     87.76                         7.32
## 3c           1     2.04      89.8                         0.05
## 3d           5     10.2       100                          3.4
## Total       49   100.00                                       
##       intervalo confianza inferior
## 1a                           43.26
## 1b                           22.23
## 1c                           16.87
## 2a                           22.23
## 2b                           24.77
## 2c                           10.85
## 2d                           10.85
## 3b                           29.66
## 3c                           10.85
## 3d                           22.23
## Total
freq(data,data$revascularizacion,c("Perdido","No","si"),using_na=T)

## 
##         absoluta relativa acumulada intervalo confianza inferior
## Perdido       40    81.63     81.63                        67.98
## No             7    14.29     95.92                         5.94
## si             2     4.08       100                          0.5
## Total         49   100.00                                       
##         intervalo confianza inferior
## Perdido                        91.24
## No                             27.24
## si                             13.98
## Total
#freq(data,data$revascularizacion)
freq(data,data$evolucion,c("Perdidos","Continuaron","Dejaron de concurrir"),using_na=T)

## 
##                      absoluta relativa acumulada
## Perdidos                    5     10.2      10.2
## Continuaron                29    59.18     69.39
## Dejaron de concurrir       15    30.61       100
## Total                      49   100.00          
##                      intervalo confianza inferior
## Perdidos                                      3.4
## Continuaron                                 44.21
## Dejaron de concurrir                        18.25
## Total                                            
##                      intervalo confianza inferior
## Perdidos                                    22.23
## Continuaron                                    73
## Dejaron de concurrir                        45.42
## Total
#freq(data,data$convinua.visita.evolucion,c(0,"Cierre","Proceso de Epitelizacion"),using_na=T)

#freq(data,data$amputacio_menor_actual,labeldicotomico,using_na=T)
#freq(data,data$anputacion_mayor_actual,labeldicotomico,using_na=T)

freq (data,data$reulceracion,c("No","Si","?"),using_na=T)

## 
##       absoluta relativa acumulada intervalo confianza inferior
## No          28    57.14     57.14                        42.21
## Si          10    20.41     77.55                        10.24
## ?           11    22.45       100                        11.77
## Total       49   100.00                                       
##       intervalo confianza inferior
## No                           71.18
## Si                           34.34
## ?                            36.62
## Total
freq (data,data$Cierre_tiempo,c("Menos 1 mes","1 a 6 meses","codigo 2"),using_na=T)

## 
##             absoluta relativa acumulada intervalo confianza inferior
## Menos 1 mes        5       25        25                         8.66
## 1 a 6 meses        8       40        65                        19.12
## codigo 2           7       35       100                        15.39
## Total             20   100.00                                       
##             intervalo confianza inferior
## Menos 1 mes                         49.1
## 1 a 6 meses                        63.95
## codigo 2                           59.22
## Total
freq(data,data$ulcera_recurrente,labeldicotomico)

## 
##           absoluta relativa acumulada intervalo confianza inferior
## No              20    40.82     40.82                           27
## Si               2     4.08      44.9                          0.5
## Ausencias       27     55.1    100.00                        40.23
## Total           22   100.00                                       
##           intervalo confianza inferior
## No                               55.79
## Si                               13.98
## Ausencias                        69.33
## Total
freq(data,data$segundaamputacion,labeldicotomico)

## 
##           absoluta relativa acumulada intervalo confianza inferior
## No              11    22.45     22.45                        11.77
## Ausencias       38    77.55    100.00                        63.38
## Total           11   100.00                                       
##           intervalo confianza inferior
## No                               36.62
## Ausencias                        88.23
## Total
freq(data,data$segundaamputacionmayor,labeldicotomico)

## 
##           absoluta relativa acumulada intervalo confianza inferior
## No              11    22.45     22.45                        11.77
## Ausencias       38    77.55    100.00                        63.38
## Total           11   100.00                                       
##           intervalo confianza inferior
## No                               36.62
## Ausencias                        88.23
## Total
freq(data,data$continenciafamiliar)

## 
##           absoluta relativa acumulada intervalo confianza inferior
## 0               15    30.61     30.61                        18.25
## 1               23    46.94     77.55                        32.53
## 3               11    22.45       100                        11.77
## Ausencias        0        0    100.00                            0
## Total           49   100.00                                       
##           intervalo confianza inferior
## 0                                45.42
## 1                                61.73
## 3                                36.62
## Ausencias                         7.25
## Total
tables(data,data$Wagner+1,data$texas,labely=labeltexas)
## 
##           texas
## Wagner + 1 1a 1b 1c 2a 2b 2c 2d 3b 3c 3d Sum
##        1   14  3  1  1  0  0  0  0  0  0  19
##        2    0  1  0  4  4  1  0  0  0  0  10
##        3    0  1  2  0  2  0  0  7  1  4  17
##        4    0  0  0  0  0  0  1  1  0  1   3
##        Sum 14  5  3  5  6  1  1  8  1  5  49
## 
## por Fila (%)
##      1a    1b    1c    2a    2b    2c    2d    3b   3c    3d
## 1 73.68 15.78  5.26  5.26  0.00  0.00  0.00  0.00 0.00  0.00
## 2  0.00 10.00  0.00 40.00 40.00 10.00  0.00  0.00 0.00  0.00
## 3  0.00  5.88 11.76  0.00 11.76  0.00  0.00 41.17 5.88 23.52
## 4  0.00  0.00  0.00  0.00  0.00  0.00 33.33 33.33 0.00 33.33
##   28.57 10.20  6.12 10.20 12.24  2.04  2.04 16.32 2.04 10.20
## 
## por Columna (%)
##    1a 1b    1c 2a    2b  2c  2d   3b  3c 3d      
## 1 100 60 33.33 20  0.00   0   0  0.0   0  0 38.77
## 2   0 20  0.00 80 66.66 100   0  0.0   0  0 20.40
## 3   0 20 66.66  0 33.33   0   0 87.5 100 80 34.69
## 4   0  0  0.00  0  0.00   0 100 12.5   0 20  6.12
## 
## Fischer Test  p < 0.001

tables(data,data$Wagner+1,data$reulceracion)
## 
##           reulceracion
## Wagner + 1  0  1  2 Sum
##        1   13  4  2  19
##        2    6  0  4  10
##        3    7  6  4  17
##        4    2  0  1   3
##        Sum 28 10 11  49
## 
## por Fila (%)
##       0     1     2
## 1 68.42 21.05 10.52
## 2 60.00  0.00 40.00
## 3 41.17 35.29 23.52
## 4 66.66  0.00 33.33
##   57.14 20.40 22.44
## 
## por Columna (%)
##       0  1     2      
## 1 46.42 40 18.18 38.77
## 2 21.42  0 36.36 20.40
## 3 25.00 60 36.36 34.69
## 4  7.14  0  9.09  6.12
## 
## Fischer Test  p = 0.177

tables(data,data$texas,data$reulceracion)
## 
##      reulceracion
## texas  0  1  2 Sum
##   0    9  4  1  14
##   1    3  0  2   5
##   3    1  0  2   3
##   4    3  0  2   5
##   5    4  0  2   6
##   6    1  0  0   1
##   7    1  0  0   1
##   9    4  3  1   8
##   10   1  0  0   1
##   11   1  3  1   5
##   Sum 28 10 11  49
## 
## por Fila (%)
##         0     1     2
## 0   64.28 28.57  7.14
## 1   60.00  0.00 40.00
## 3   33.33  0.00 66.66
## 4   60.00  0.00 40.00
## 5   66.66  0.00 33.33
## 6  100.00  0.00  0.00
## 7  100.00  0.00  0.00
## 9   50.00 37.50 12.50
## 10 100.00  0.00  0.00
## 11  20.00 60.00 20.00
##     57.14 20.40 22.44
## 
## por Columna (%)
##        0  1     2      
## 0  32.14 40  9.09 28.57
## 1  10.71  0 18.18 10.20
## 3   3.57  0 18.18  6.12
## 4  10.71  0 18.18 10.20
## 5  14.28  0 18.18 12.24
## 6   3.57  0  0.00  2.04
## 7   3.57  0  0.00  2.04
## 9  14.28 30  9.09 16.32
## 10  3.57  0  0.00  2.04
## 11  3.57 30  9.09 10.20
## 
## Fischer Test  p = 0.336

tables(data,data$Wagner+1,data$Cierre_tiempo)
## 
##           Cierre_tiempo
## Wagner + 1  0  1  2 Sum
##        1    4  5  1  10
##        2    0  1  4   5
##        3    1  1  2   4
##        4    0  1  0   1
##        Sum  5  8  7  20
## 
## por Fila (%)
##    0   1  2
## 1 40  50 10
## 2  0  20 80
## 3 25  25 50
## 4  0 100  0
##   25  40 35
## 
## por Columna (%)
##    0    1     2   
## 1 80 62.5 14.28 50
## 2  0 12.5 57.14 25
## 3 20 12.5 28.57 20
## 4  0 12.5  0.00  5
## 
## Fischer Test  p = 0.111

tables(data,data$texas,data$Cierre_tiempo)
## 
##      Cierre_tiempo
## texas  0  1  2 Sum
##   0    3  4  0   7
##   1    0  2  1   3
##   3    0  0  0   0
##   4    1  0  1   2
##   5    0  1  3   4
##   6    0  0  0   0
##   7    0  0  0   0
##   9    1  1  2   4
##   10   0  0  0   0
##   11   0  0  0   0
##   Sum  5  8  7  20
## 
## por Fila (%)
##        0     1     2
## 0  42.85 57.14  0.00
## 1   0.00 66.66 33.33
## 3    NaN   NaN   NaN
## 4  50.00  0.00 50.00
## 5   0.00 25.00 75.00
## 6    NaN   NaN   NaN
## 7    NaN   NaN   NaN
## 9  25.00 25.00 50.00
## 10   NaN   NaN   NaN
## 11   NaN   NaN   NaN
##    25.00 40.00 35.00
## 
## por Columna (%)
##     0    1     2   
## 0  60 50.0  0.00 35
## 1   0 25.0 14.28 15
## 3   0  0.0  0.00  0
## 4  20  0.0 14.28 10
## 5   0 12.5 42.85 20
## 6   0  0.0  0.00  0
## 7   0  0.0  0.00  0
## 9  20 12.5 28.57 20
## 10  0  0.0  0.00  0
## 11  0  0.0  0.00  0
## 
## Fischer Test  p = 0.186

tables(data,data$Wagner+1,data$Atb)
## 
##           Atb
## Wagner + 1  0  1 Sum
##        1   15  4  19
##        2    2  8  10
##        3    0 17  17
##        4    0  3   3
##        Sum 17 32  49
## 
## por Fila (%)
##       0      1
## 1 78.94  21.05
## 2 20.00  80.00
## 3  0.00 100.00
## 4  0.00 100.00
##   34.69  65.30
## 
## por Columna (%)
##       0     1      
## 1 88.23 12.50 38.77
## 2 11.76 25.00 20.40
## 3  0.00 53.12 34.69
## 4  0.00  9.37  6.12
## 
## Fischer Test  p < 0.001

tables(data,data$texas,data$Atb)
## 
##      Atb
## texas  0  1 Sum
##   0   14  0  14
##   1    0  5   5
##   3    0  3   3
##   4    2  3   5
##   5    0  6   6
##   6    1  0   1
##   7    0  1   1
##   9    0  8   8
##   10   0  1   1
##   11   0  5   5
##   Sum 17 32  49
## 
## por Fila (%)
##         0     1
## 0  100.00   0.0
## 1    0.00 100.0
## 3    0.00 100.0
## 4   40.00  60.0
## 5    0.00 100.0
## 6  100.00   0.0
## 7    0.00 100.0
## 9    0.00 100.0
## 10   0.00 100.0
## 11   0.00 100.0
##     34.69  65.3
## 
## por Columna (%)
##        0     1      
## 0  82.35  0.00 28.57
## 1   0.00 15.62 10.20
## 3   0.00  9.37  6.12
## 4  11.76  9.37 10.20
## 5   0.00 18.75 12.24
## 6   5.88  0.00  2.04
## 7   0.00  3.12  2.04
## 9   0.00 25.00 16.32
## 10  0.00  3.12  2.04
## 11  0.00 15.62 10.20
## 
## Fischer Test  p < 0.001

tables(data,data$Wagner+1,data$Tto)
## 
##           Tto
## Wagner + 1  0  1  2 Sum
##        1    6  9  4  19
##        2    4  5  1  10
##        3   10  2  5  17
##        4    1  0  2   3
##        Sum 21 16 12  49
## 
## por Fila (%)
##       0     1     2
## 1 31.57 47.36 21.05
## 2 40.00 50.00 10.00
## 3 58.82 11.76 29.41
## 4 33.33  0.00 66.66
##   42.85 32.65 24.48
## 
## por Columna (%)
##       0     1     2      
## 1 28.57 56.25 33.33 38.77
## 2 19.04 31.25  8.33 20.40
## 3 47.61 12.50 41.66 34.69
## 4  4.76  0.00 16.66  6.12
## 
## Fischer Test  p = 0.1

tables(data,data$texas,data$Tto)
## 
##      Tto
## texas  0  1  2 Sum
##   0    6  5  3  14
##   1    0  5  0   5
##   3    2  1  0   3
##   4    1  2  2   5
##   5    3  2  1   6
##   6    1  0  0   1
##   7    0  0  1   1
##   9    8  0  0   8
##   10   0  0  1   1
##   11   0  1  4   5
##   Sum 21 16 12  49
## 
## por Fila (%)
##         0      1      2
## 0   42.85  35.71  21.42
## 1    0.00 100.00   0.00
## 3   66.66  33.33   0.00
## 4   20.00  40.00  40.00
## 5   50.00  33.33  16.66
## 6  100.00   0.00   0.00
## 7    0.00   0.00 100.00
## 9  100.00   0.00   0.00
## 10   0.00   0.00 100.00
## 11   0.00  20.00  80.00
##     42.85  32.65  24.48
## 
## por Columna (%)
##        0     1     2      
## 0  28.57 31.25 25.00 28.57
## 1   0.00 31.25  0.00 10.20
## 3   9.52  6.25  0.00  6.12
## 4   4.76 12.50 16.66 10.20
## 5  14.28 12.50  8.33 12.24
## 6   4.76  0.00  0.00  2.04
## 7   0.00  0.00  8.33  2.04
## 9  38.09  0.00  0.00 16.32
## 10  0.00  0.00  8.33  2.04
## 11  0.00  6.25 33.33 10.20
## 
## Fischer Test  p < 0.001

#tables(data,data$Wagner+1,data$segundaamputacion)
tables(data,data$texas,data$Hba1c)
## 
##      Hba1c
## texas  0  1  2  3 Sum
##   0    2  3  5  4  14
##   1    0  3  1  1   5
##   3    0  0  2  1   3
##   4    2  0  2  1   5
##   5    1  3  1  1   6
##   6    0  0  1  0   1
##   7    0  0  0  1   1
##   9    2  2  3  1   8
##   10   0  0  0  1   1
##   11   0  1  1  3   5
##   Sum  7 12 16 14  49
## 
## por Fila (%)
##        0     1      2      3
## 0  14.28 21.42  35.71  28.57
## 1   0.00 60.00  20.00  20.00
## 3   0.00  0.00  66.66  33.33
## 4  40.00  0.00  40.00  20.00
## 5  16.66 50.00  16.66  16.66
## 6   0.00  0.00 100.00   0.00
## 7   0.00  0.00   0.00 100.00
## 9  25.00 25.00  37.50  12.50
## 10  0.00  0.00   0.00 100.00
## 11  0.00 20.00  20.00  60.00
##    14.28 24.48  32.65  28.57
## 
## por Columna (%)
##        0     1     2     3      
## 0  28.57 25.00 31.25 28.57 28.57
## 1   0.00 25.00  6.25  7.14 10.20
## 3   0.00  0.00 12.50  7.14  6.12
## 4  28.57  0.00 12.50  7.14 10.20
## 5  14.28 25.00  6.25  7.14 12.24
## 6   0.00  0.00  6.25  0.00  2.04
## 7   0.00  0.00  0.00  7.14  2.04
## 9  28.57 16.66 18.75  7.14 16.32
## 10  0.00  0.00  0.00  7.14  2.04
## 11  0.00  8.33  6.25 21.42 10.20
## 
## Fischer Test  p = 0.835

tables(data,data$Wagner+1,data$Hba1c)
## 
##           Hba1c
## Wagner + 1  0  1  2  3 Sum
##        1    3  5  7  4  19
##        2    2  3  3  2  10
##        3    2  4  6  5  17
##        4    0  0  0  3   3
##        Sum  7 12 16 14  49
## 
## por Fila (%)
##       0     1     2      3
## 1 15.78 26.31 36.84  21.05
## 2 20.00 30.00 30.00  20.00
## 3 11.76 23.52 35.29  29.41
## 4  0.00  0.00  0.00 100.00
##   14.28 24.48 32.65  28.57
## 
## por Columna (%)
##       0     1     2     3      
## 1 42.85 41.66 43.75 28.57 38.77
## 2 28.57 25.00 18.75 14.28 20.40
## 3 28.57 33.33 37.50 35.71 34.69
## 4  0.00  0.00  0.00 21.42  6.12
## 
## Fischer Test  p = 0.753

means(data,data$texas)
## 
##                             texas
## n                              49
## Media                        4.37
## Mediana                         4
## DS                           3.99
## Min                             0
## Max                            11
## Rango                          11
## Q1                              0
## Q3                              9
## RIQ                             9
## Normal                          0
## ICI                          3.22
## ICS                          5.51
## Resumen Mediana[Q1-Q3]  -->4(0-9)

means(data,data$Wagner+1)
## 
##                        Wagner + 1
## n                              49
## Media                        2.08
## Mediana                         2
## DS                              1
## Min                             1
## Max                             4
## Rango                           3
## Q1                              1
## Q3                              3
## RIQ                             2
## Normal                          0
## ICI                           1.8
## ICS                          2.37
## Resumen Mediana[Q1-Q3]  -->2(1-3)

tables(data,data$edad,data$texas,labeledad,labeltexas)
## 
##                texas
## edad            1a 1b 1c 2a 2b 2c 2d 3b 3c 3d Sum
##   Menor a 50     1  1  0  1  1  1  0  1  0  1   7
##   Entre 50 y 70 10  2  2  4  3  0  0  6  1  3  31
##   Mayor a 70     3  2  1  0  2  0  1  1  0  1  11
##   Sum           14  5  3  5  6  1  1  8  1  5  49
## 
## por Fila (%)
##                  1a    1b   1c    2a    2b    2c   2d    3b   3c    3d
## Menor a 50    14.28 14.28 0.00 14.28 14.28 14.28 0.00 14.28 0.00 14.28
## Entre 50 y 70 32.25  6.45 6.45 12.90  9.67  0.00 0.00 19.35 3.22  9.67
## Mayor a 70    27.27 18.18 9.09  0.00 18.18  0.00 9.09  9.09 0.00  9.09
##               28.57 10.20 6.12 10.20 12.24  2.04 2.04 16.32 2.04 10.20
## 
## por Columna (%)
##                  1a 1b    1c 2a    2b  2c  2d   3b  3c 3d      
## Menor a 50     7.14 20  0.00 20 16.66 100   0 12.5   0 20 14.28
## Entre 50 y 70 71.42 40 66.66 80 50.00   0   0 75.0 100 60 63.26
## Mayor a 70    21.42 40 33.33  0 33.33   0 100 12.5   0 20 22.44
## 
## Fischer Test  p = 0.741