0. Contexto

Una empresa ubicada en Carolina del Norte, Estados Unidos, se dedica a gestionar reclamaciones de compensaciones laborales. Como parte de sus operaciones, ha recolectado una cantidad significativa de datos e información. Sin embargo, para poder aprovecharla es necesario realizar un análisis intensivo de la base de datos de las reclamaciones que ha gestionado en los últimos años. Los resultados, permitirán, entre otras cosas, identificar qué factores influyen mayormente en el costo y tiempo de procesamiento de las reclamaciones, con el objetivo principal de mejorar el servicio a los clientes, y reducir costos para la compañía y sus clientes.

El proceso de limpieza, y análisis se muestra a continuación, en donde se utilizaron árboles de decisión, clusterización, modelos de regresión lineal, entre otros.

# Código para conocer la ubicación del archivo 
#file.choose()
# Se cargan las librerías que se van a utilizar 
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(cluster)
library(factoextra)
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(rpart)
library(rpart.plot)

1. Importar la base de datos

Base de datos Transacciones (transactions)

transactions <- read.csv("/Users/andreasanchezgomez/Documents/R/TransactionsSummary2018.csv")

Base de datos Reclamaciones (claims)

claims <- read.csv("/Users/andreasanchezgomez/Documents/R/ClaimsData2018.csv")

Conjuntar ambas bases de datos en una sola (bd)

# La operación se hace de acuerdo a la columna "Claim ID"
bd <- merge(transactions, claims, by = "ClaimID", all = TRUE)
bd <- data.frame(bd)

2. Entender la base de datos

# Se utiliza la función summary para revisar NA's, las variables que se incluyen en la base de datos, así como su tipo.
summary(bd)
##     ClaimID         BillReviewALE        Hospital         PhysicianOutpatient
##  Min.   :  633915   Min.   : -456.0   Min.   : -12570.4   Min.   :  -4655.7  
##  1st Qu.:  810246   1st Qu.:   16.0   1st Qu.:    193.9   1st Qu.:    107.6  
##  Median :  856915   Median :   32.0   Median :    559.1   Median :    221.6  
##  Mean   :12344572   Mean   :  191.2   Mean   :   4394.7   Mean   :   1752.3  
##  3rd Qu.:22716420   3rd Qu.:   80.0   3rd Qu.:   2253.4   3rd Qu.:    710.5  
##  Max.   :62246496   Max.   :56475.3   Max.   :2759604.0   Max.   :1481468.5  
##                     NA's   :139865    NA's   :145262      NA's   :84986      
##        Rx             TotalPaid       TotalReserves     TotalRecovery      
##  Min.   :  -469.5   Min.   :   -270   Min.   :      0   Min.   :     0.00  
##  1st Qu.:    23.3   1st Qu.:     60   1st Qu.:      0   1st Qu.:     0.00  
##  Median :    58.3   Median :    235   Median :      0   Median :     0.00  
##  Mean   :  1140.4   Mean   :   6746   Mean   :   2233   Mean   :    68.88  
##  3rd Qu.:   174.5   3rd Qu.:    938   3rd Qu.:      0   3rd Qu.:     0.00  
##  Max.   :631635.5   Max.   :4527291   Max.   :2069575   Max.   :130541.03  
##  NA's   :145752     NA's   :52673     NA's   :52673     NA's   :52673      
##  IndemnityPaid      OtherPaid       ClaimStatus        IncidentDate      
##  Min.   :  -475   Min.   :  -7820   Length:186677      Length:186677     
##  1st Qu.:     0   1st Qu.:     58   Class :character   Class :character  
##  Median :     0   Median :    230   Mode  :character   Mode  :character  
##  Mean   :  3061   Mean   :   3685                                        
##  3rd Qu.:     0   3rd Qu.:    855                                        
##  Max.   :640732   Max.   :4129915                                        
##  NA's   :52673    NA's   :52673                                          
##  IncidentDescription ReturnToWorkDate   AverageWeeklyWage  ClaimantOpenedDate
##  Length:186677       Length:186677      Length:186677      Length:186677     
##  Class :character    Class :character   Class :character   Class :character  
##  Mode  :character    Mode  :character   Mode  :character   Mode  :character  
##                                                                              
##                                                                              
##                                                                              
##                                                                              
##  ClaimantClosedDate EmployerNotificationDate ReceivedDate          IsDenied    
##  Length:186677      Length:186677            Length:186677      Min.   :0.00   
##  Class :character   Class :character         Class :character   1st Qu.:0.00   
##  Mode  :character   Mode  :character         Mode  :character   Median :0.00   
##                                                                 Mean   :0.04   
##                                                                 3rd Qu.:0.00   
##                                                                 Max.   :1.00   
##                                                                 NA's   :52673  
##  ClaimantAge_at_DOI    Gender          ClaimantType       InjuryNature      
##  Length:186677      Length:186677      Length:186677      Length:186677     
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##  BodyPartRegion       BodyPart            X             X.1         
##  Length:186677      Length:186677      Mode:logical   Mode:logical  
##  Class :character   Class :character   NA's:186677    NA's:186677   
##  Mode  :character   Mode  :character                                
##                                                                     
##                                                                     
##                                                                     
##                                                                     
##    X.2            X.3            X.4            X.5            X.6         
##  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
##  NA's:186677    NA's:186677    NA's:186677    NA's:186677    NA's:186677   
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##    X.7            X.8            X.9            X.10           X.11        
##  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
##  NA's:186677    NA's:186677    NA's:186677    NA's:186677    NA's:186677   
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##    X.12           X.13           X.14           X.15           X.16        
##  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
##  NA's:186677    NA's:186677    NA's:186677    NA's:186677    NA's:186677   
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##    X.17           X.18           X.19           X.20           X.21        
##  Mode:logical   Mode:logical   Mode:logical   Mode:logical   Mode:logical  
##  NA's:186677    NA's:186677    NA's:186677    NA's:186677    NA's:186677   
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##                                                                            
##    X.22        
##  Mode:logical  
##  NA's:186677   
##                
##                
##                
##                
## 

Observaciones:

  1. Se observan valores NAs en múltiples variables.

  2. Las columnas con las variables X están vacías (se deben eliminar).

  3. La variables de Fechas se encuentran en formato carácter.

  4. ClaimantAge_at_DOI (Edad) y AverageWeeklyWage (Salario promedio) se encuentran en formato carácter, pero son númericas (se debe hacer la respectiva conversión).

  5. No existe la columna de Costo Total Incurrido (Total_Incurred_Cost).

  6. No existe la columna de Tiempo de Procesamiento

3. Limpieza y tratamiento de la base de datos

Eliminación de las columnas X’s

bd <- bd[, !(names(bd) %in% c("X",  "X.1", "X.2", "X.3", "X.4", "X.5", "X.6", "X.7", "X.8", "X.9", 
"X.10", "X.11", "X.12", "X.13", "X.14", "X.15", "X.16", "X.17", "X.18", "X.19", "X.20", "X.21", "X.22", "BillReviewALE", "Hospital", "PhysicianOutpatient", "Rx"))]
summary(bd) # También se elimina BillReviewALE, Hospital, PhysicianOutpatient y RX porque tienen muchos valores NA
##     ClaimID           TotalPaid       TotalReserves     TotalRecovery      
##  Min.   :  633915   Min.   :   -270   Min.   :      0   Min.   :     0.00  
##  1st Qu.:  810246   1st Qu.:     60   1st Qu.:      0   1st Qu.:     0.00  
##  Median :  856915   Median :    235   Median :      0   Median :     0.00  
##  Mean   :12344572   Mean   :   6746   Mean   :   2233   Mean   :    68.88  
##  3rd Qu.:22716420   3rd Qu.:    938   3rd Qu.:      0   3rd Qu.:     0.00  
##  Max.   :62246496   Max.   :4527291   Max.   :2069575   Max.   :130541.03  
##                     NA's   :52673     NA's   :52673     NA's   :52673      
##  IndemnityPaid      OtherPaid       ClaimStatus        IncidentDate      
##  Min.   :  -475   Min.   :  -7820   Length:186677      Length:186677     
##  1st Qu.:     0   1st Qu.:     58   Class :character   Class :character  
##  Median :     0   Median :    230   Mode  :character   Mode  :character  
##  Mean   :  3061   Mean   :   3685                                        
##  3rd Qu.:     0   3rd Qu.:    855                                        
##  Max.   :640732   Max.   :4129915                                        
##  NA's   :52673    NA's   :52673                                          
##  IncidentDescription ReturnToWorkDate   AverageWeeklyWage  ClaimantOpenedDate
##  Length:186677       Length:186677      Length:186677      Length:186677     
##  Class :character    Class :character   Class :character   Class :character  
##  Mode  :character    Mode  :character   Mode  :character   Mode  :character  
##                                                                              
##                                                                              
##                                                                              
##                                                                              
##  ClaimantClosedDate EmployerNotificationDate ReceivedDate          IsDenied    
##  Length:186677      Length:186677            Length:186677      Min.   :0.00   
##  Class :character   Class :character         Class :character   1st Qu.:0.00   
##  Mode  :character   Mode  :character         Mode  :character   Median :0.00   
##                                                                 Mean   :0.04   
##                                                                 3rd Qu.:0.00   
##                                                                 Max.   :1.00   
##                                                                 NA's   :52673  
##  ClaimantAge_at_DOI    Gender          ClaimantType       InjuryNature      
##  Length:186677      Length:186677      Length:186677      Length:186677     
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##  BodyPartRegion       BodyPart        
##  Length:186677      Length:186677     
##  Class :character   Class :character  
##  Mode  :character   Mode  :character  
##                                       
##                                       
##                                       
## 

Conversión de variables al formato correcto

Variables a tipo Fecha

bd$ReturnToWorkDate <- as.Date(bd$ReturnToWorkDate, format = "%d/%m/%y")
bd$ClaimantOpenedDate <- as.Date(bd$ClaimantOpenedDate, format = "%d/%m/%y")
bd$ClaimantClosedDate <- as.Date(bd$ClaimantClosedDate, format = "%d/%m/%y")
bd$EmployerNotificationDate <- as.Date(bd$EmployerNotificationDate, format = "%d/%m/%y")
bd$ReceivedDate <- as.Date(bd$ReceivedDate, format = "%d/%m/%y")
bd$IncidentDate <- as.Date(bd$IncidentDate, format = "%d/%m/%y")

Variables a tipo Número

bd$AverageWeeklyWage <- as.numeric(bd$AverageWeeklyWage)
## Warning: NAs introduced by coercion
bd$ClaimantAge_at_DOI <- as.numeric(bd$ClaimantAge_at_DOI)
## Warning: NAs introduced by coercion

Columna Costo Total Incurrido (TotalIncurredCost)

bd$TotalIncurredCost <- bd$TotalReserves + bd$TotalPaid - bd$TotalRecovery

Columna Tiempo de Procesamiento (TiempoDeProcesamiento)

bd$TiempoDeProcesamiento <- as.integer(bd$ClaimantClosedDate - bd$ClaimantOpenedDate)

Borrar datos atípicos

Se eliminarán los datos aípicos del Tiempo de Procesamiento y Costo Total Incurrido.

Tiempo de Procesamiento

### TiempoDeProcesamiento
# Gráfica de boxplot para identificar si existen datos atípicos en la variable TiempoDeProcesamiento
boxplot(bd$TiempoDeProcesamiento, main="Tiempo de Procesamiento", ylab="Valores")

Dado que se han identificado outliers, se eliminarán los valores menores a 0 en el Tiempo de Procesamiento. Cabe mencionar que no se aplicará la fórmula del cálculo del Límite Inferior y Superior, ya que para poder ejecutarla, se necesita una base de datos sin valores NA, y el borrarlos desde un principio reducirá las filas de la base de datos de manera muy abrupta. Por eso, sólo se realizará de acuerdo a la boxplot.

# Eliminación de las filas cuyo TiempoDeProcesamiento sea menor a 0
bd <- bd[bd$TiempoDeProcesamiento > 0, ]
# Revisión de la operación anterior e identificación de nuevos outliers. 
# Gráfica de boxplot 
boxplot(bd$TiempoDeProcesamiento, main="Tiempo de Procesamiento", ylab="Valores")

Se observa que los datos atípicos en el Tiempo de Procesamiento comienzan aproximadamente a partir de 8000. Entonces se elimarán las filas cuyo Tiempo de Procesamiento sea mayor a este dato.

# Eliminación de las filas cuyo TiempoDeProcesamiento sea mayor a 8000
bd <- bd[bd$TiempoDeProcesamiento < 8000, ]
# Revisión de la operación anterior
# Gráfica de boxplot 
boxplot(bd$TiempoDeProcesamiento, main="Tiempo de Procesamiento", ylab="Valores")

Ya no se observan datos atípicos significativos, sin embargo, se volverá a hacer una revisión en la parte de clusterización.

Costo Total Incurrido

### TotalIncurredCost
# Gráfica de boxplot para identificar si existen datos atípicos en la variable TotalIncurredCost
boxplot(bd$TotalIncurredCost, main="Costo Total Incurrido", ylab="Valores")

Se observa que los datos atípicos en el Costo Total Incurrido comienzan aproximadamente a partir de 60,000. Entonces se eliminarán las filas cuyo Costo Total Incurrido sea mayor a este dato, y menor a 0.

# Filtrar las filas cuyo Costo Total Incurrido sea menor a 60,000 y mayor a 0
bd <- bd[bd$TotalIncurredCost < 60000 & bd$TotalIncurredCost > 0, ]
# Revisión de la operación anterior
# Gráfica de boxplot 
boxplot(bd$TotalIncurredCost, main="Costo total incurrido", ylab="Valores")

Como se observa, se ha eliminado la mayor parte de los valores atíícos del Tiempo de Procesamiento y Costo Total Incurrido de la base de datos.

Personalización

# Personas cuyo salario sea mayor o igual a 500
bd <- subset(bd, AverageWeeklyWage >= 500)

Comprobación

# Se comprueba el efecto de las líneas de código anteriores 
summary(bd)
##     ClaimID           TotalPaid        TotalReserves TotalRecovery    
##  Min.   :  650915   Min.   :     3.0   Min.   :0     Min.   :    0.0  
##  1st Qu.:  817932   1st Qu.:   257.4   1st Qu.:0     1st Qu.:    0.0  
##  Median :  835440   Median :  1132.7   Median :0     Median :    0.0  
##  Mean   : 8231238   Mean   :  6868.2   Mean   :0     Mean   :  138.5  
##  3rd Qu.:10512786   3rd Qu.:  6910.0   3rd Qu.:0     3rd Qu.:    0.0  
##  Max.   :61546646   Max.   :127037.7   Max.   :0     Max.   :75000.0  
##                                                                       
##  IndemnityPaid      OtherPaid       ClaimStatus         IncidentDate       
##  Min.   :  -475   Min.   :-7820.5   Length:17295       Min.   :1983-10-21  
##  1st Qu.:     0   1st Qu.:  244.1   Class :character   1st Qu.:2004-04-15  
##  Median :     0   Median :  921.0   Mode  :character   Median :2008-03-07  
##  Mean   :  2837   Mean   : 4031.2                      Mean   :2007-01-01  
##  3rd Qu.:  1966   3rd Qu.: 4085.4                      3rd Qu.:2010-10-12  
##  Max.   :126128   Max.   :82815.2                      Max.   :2014-06-06  
##                                                                            
##  IncidentDescription ReturnToWorkDate     AverageWeeklyWage  
##  Length:17295        Min.   :1983-10-24   Min.   :    500.0  
##  Class :character    1st Qu.:2004-11-18   1st Qu.:    568.2  
##  Mode  :character    Median :2008-07-02   Median :    666.0  
##                      Mean   :2007-05-10   Mean   :   1001.1  
##                      3rd Qu.:2011-01-12   3rd Qu.:    843.0  
##                      Max.   :2014-06-06   Max.   :2024000.0  
##                      NA's   :1755                            
##  ClaimantOpenedDate   ClaimantClosedDate   EmployerNotificationDate
##  Min.   :1994-08-07   Min.   :2005-03-31   Min.   :1983-10-21      
##  1st Qu.:2004-05-30   1st Qu.:2006-04-30   1st Qu.:2004-04-04      
##  Median :2008-04-17   Median :2009-03-09   Median :2008-02-27      
##  Mean   :2007-02-10   Mean   :2009-04-01   Mean   :2006-12-28      
##  3rd Qu.:2010-11-02   3rd Qu.:2011-09-21   3rd Qu.:2010-10-08      
##  Max.   :2014-06-06   Max.   :2014-06-30   Max.   :2014-06-06      
##                                            NA's   :140             
##   ReceivedDate           IsDenied      ClaimantAge_at_DOI    Gender         
##  Min.   :1988-09-11   Min.   :0.0000   Min.   :-7550.00   Length:17295      
##  1st Qu.:2004-05-25   1st Qu.:0.0000   1st Qu.:   37.00   Class :character  
##  Median :2008-04-04   Median :0.0000   Median :   46.00   Mode  :character  
##  Mean   :2007-02-07   Mean   :0.0632   Mean   :   42.72                     
##  3rd Qu.:2010-11-02   3rd Qu.:0.0000   3rd Qu.:   53.00                     
##  Max.   :2014-06-06   Max.   :1.0000   Max.   :   87.00                     
##                                        NA's   :2982                         
##  ClaimantType       InjuryNature       BodyPartRegion       BodyPart        
##  Length:17295       Length:17295       Length:17295       Length:17295      
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##  TotalIncurredCost  TiempoDeProcesamiento
##  Min.   :    0.07   Min.   :   2         
##  1st Qu.:  247.58   1st Qu.: 121         
##  Median : 1071.55   Median : 322         
##  Mean   : 6729.66   Mean   : 781         
##  3rd Qu.: 6709.07   3rd Qu.:1078         
##  Max.   :59987.17   Max.   :6328         
## 

4. Modelación

Clusterización

Subtabla Tiempo de Procesamiento y Costo Total Incurrido

# A partir de la base de datos inicial, se crea una nueva que contiene sólo las columnas a utilizar, en este caso TiempoDeProcesamiento, TotalIncurredCost y el ClaimID para identificar el registro. 
bd1 <- subset(bd, select = c("TiempoDeProcesamiento", "TotalIncurredCost", "ClaimID"))
# Se visualiza si existen valores NA en la nueva base de datos 
sapply(bd1, function(x) sum (is.na(x)))
## TiempoDeProcesamiento     TotalIncurredCost               ClaimID 
##                     0                     0                     0

Dado que no existen, se continúa con el proceso.

# Se nombran a los renglones como el ClaimID, y después se elimina esta variable, ya que sólo funge como identificador. 
rownames(bd1) <- bd1$ClaimID
bd1 <- subset(bd1, select = -c(ClaimID))
# Se observa la base de datos con los cambios, y se comprueba que no hay NA
summary(bd1)
##  TiempoDeProcesamiento TotalIncurredCost 
##  Min.   :   2          Min.   :    0.07  
##  1st Qu.: 121          1st Qu.:  247.58  
##  Median : 322          Median : 1071.55  
##  Mean   : 781          Mean   : 6729.66  
##  3rd Qu.:1078          3rd Qu.: 6709.07  
##  Max.   :6328          Max.   :59987.17

En la sección de Limpieza de Datos se realizó un análisis para identificar outliers en las variables, pero éste fue meramente visual a partir de las boxplot. Por lo tanto, en este paso se eliminarán de acuerdo a los límites superiores, que establecen el rango “normal” para estos valores.

TiempoDeProcesamiento

# Cálculo del IQR 
IQR_TP <- IQR(bd1$TiempoDeProcesamiento)
IQR_TP
## [1] 957
# Se aplica un summary para ver los máximos, mínimos, y cuartiles de cada una de las variables de la base de datos. 
summary(bd1)
##  TiempoDeProcesamiento TotalIncurredCost 
##  Min.   :   2          Min.   :    0.07  
##  1st Qu.: 121          1st Qu.:  247.58  
##  Median : 322          Median : 1071.55  
##  Mean   : 781          Mean   : 6729.66  
##  3rd Qu.:1078          3rd Qu.: 6709.07  
##  Max.   :6328          Max.   :59987.17

Sólo se calculará el Límite Superior, porque para tiempo y costos, el valor cero es la ausencia de la característica, y por lo tanto, el Límite Inferior.

# Cálculo del Límite Superior para el TiempoDeProcesamiento
LS_TP <- 1078 + 1.5 * IQR_TP
LS_TP
## [1] 2513.5

Con esto, se elinarán los valores mayores a 2513.5.

# Eliminación de las filas cuyo TiempoDeProcesamiento sea menor o igual a 2726
bd1 <- bd1[bd1$TiempoDeProcesamiento <= 2513.5, ]
# Se gráfica nuevamente la variable TiempoDeProcesamiento para asegurar que ya no se cuenta con datos atípicos, o fuera del rango establecido.
boxplot(bd1$TiempoDeProcesamiento)

TotalIncurredCost

Debido a que se trata de costos, solo se calculará el Límite Superior, pues los valores menores a 0 sí representan la ausencia de la característica.

# Cálculo del IQR 
IQR_TIC <- IQR(bd1$TotalIncurredCost)
IQR_TIC
## [1] 6444.105
# Se aplica un summary para ver los máximos, mínimos, y cuartiles de cada una de las variables de la base de datos.
summary(bd1)
##  TiempoDeProcesamiento TotalIncurredCost 
##  Min.   :   2.0        Min.   :    0.34  
##  1st Qu.: 113.0        1st Qu.:  258.21  
##  Median : 260.0        Median : 1126.84  
##  Mean   : 534.5        Mean   : 6771.62  
##  3rd Qu.: 746.0        3rd Qu.: 6702.31  
##  Max.   :2513.0        Max.   :59987.17
# Cálculo del Límite Superior para el TotalIncurredCost
LS_TIC <- 6702.31 + 1.5 * IQR_TIC
LS_TIC
## [1] 16368.47

Debido a que se trata de costos, se eliminarán los valores negativos y los que son mayores a 16368.47

bd1 <- bd1[bd1$TotalIncurredCost > 0 & bd1$TotalIncurredCost <= 16368.47, ]
# Se gráfica nuevamente la variable TiempoDeProcesamiento para asegurar que ya no se cuenta con datos atípicos, o fuera del rango establecido.
boxplot(bd1$TotalIncurredCost)

Asignación de Grupos

# Se normalizan las variables
bd1 <- as.data.frame(scale(bd1))
# Se aplica un summary para revisar que funcionaron las indicaciones anteriores. 
summary(bd1)
##  TiempoDeProcesamiento TotalIncurredCost
##  Min.   :-0.7913       Min.   :-0.6663  
##  1st Qu.:-0.6151       1st Qu.:-0.6041  
##  Median :-0.4528       Median :-0.4738  
##  Mean   : 0.0000       Mean   : 0.0000  
##  3rd Qu.: 0.1351       3rd Qu.: 0.1248  
##  Max.   : 3.5894       Max.   : 3.9514
# Se determina el número de grupos 
grupos <- 7
# Se asignan los grupos 
segmentos <- kmeans(bd1,grupos)
# Se revisa la asignación de grupos
asignacion <- cbind(bd1, cluster = segmentos$cluster)

Gráfica

# Graficar resultados
fviz_cluster(segmentos, data = bd1)

Optimización de la cantidad de grupos

#Se optimiza la cantidad de grupos
#set.seed(123)
#optimizacion <- clusGap(bd1, FUN=kmeans, nstart=1, K.max=10)
#plot(optimizacion, xlab = "Número de clusters K")

# El punto más alto de la gráfica indica la cantidad de puntos óptimos 

Intento de análisis de clusters Después del proceso de clusterización, se revisa qué grupo(cluster) es el mejor y cuál es el peor, para fortalecer los hallazgos del análisis.

aggregate(bd1, by=list(segmentos$cluster), FUN=mean)
##   Group.1 TiempoDeProcesamiento TotalIncurredCost
## 1       1           -0.52990534        -0.5402376
## 2       2            1.01760848        -0.1969848
## 3       3            2.84476966        -0.2322263
## 4       4            2.21383341         2.4260370
## 5       5            0.03121063         1.3534067
## 6       6            0.20986013         3.0091071
## 7       7           -0.31502586         0.1558923
bd1 <- data.frame(bd1, segmentos$cluster)

De acuerdo a la gráfica, y a la tabla anterior se observa que el peor cluster (grupo de quejas con mayor tiempo y costo) es el número 1; mientras que “el mejor” es el 3, ya que tiene los valores más pequeños. A contiuación se añadirán la columna del cluster, a la base madre, para poder analizar las reclamaciones.

# Se agrega nuevamente la columna de ClaimID a la base de datos de los clusters
bd1$ClaimID <- rownames(bd1)
summary(bd1)
##  TiempoDeProcesamiento TotalIncurredCost segmentos.cluster   ClaimID         
##  Min.   :-0.7913       Min.   :-0.6663   Min.   :1.000     Length:13261      
##  1st Qu.:-0.6151       1st Qu.:-0.6041   1st Qu.:1.000     Class :character  
##  Median :-0.4528       Median :-0.4738   Median :1.000     Mode  :character  
##  Mean   : 0.0000       Mean   : 0.0000   Mean   :2.649                       
##  3rd Qu.: 0.1351       3rd Qu.: 0.1248   3rd Qu.:5.000                       
##  Max.   : 3.5894       Max.   : 3.9514   Max.   :7.000
colnames(bd1)[colnames(bd1) == "segmentos.cluster"] <- "Cluster"
# Se intenta generar una nueva base de datos con la columna del cluster al que pertenece cada registro, pero no funcionó :(
# bd4 <- merge(bd, bd1$Cluster, by = "ClaimID")
# bd4 <- data.frame(bd4)

Árbol de Decisión

# Se crea una nueva base de datos (copia de la base de datos inicial)
bd2 <- bd

Nueva base de datos

Previo a la creación del árbol, se le dio tratamiento a algunas variables de tipo categórico para realizar el árbol de decisiones.

InjuryNature

# InjuryNature
resumen_conteo <- bd2%>%
count(InjuryNature) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo) # Respuestas a esta columna
##                                                   InjuryNature    n
## 1                                                       Strain 5117
## 2                                                    Contusion 3507
## 3                                                       Sprain 2056
## 4                                                   Laceration 1126
## 5                             All Other Specific Injuries, Noc 1095
## 6                                                     Fracture 1076
## 7                              Multiple Physical Injuries Only  661
## 8                                                     Puncture  461
## 9                                       Carpal Tunnel Syndrome  254
## 10                                                Foreign Body  240
## 11                                                Inflammation  212
## 12                                                  Dermatitis  202
## 13                                                        Burn  162
## 14                                                 Dislocation  127
## 15                                       Respiratory Disorders  113
## 16                                                    Crushing  112
## 17                                          No Physical Injury  107
## 18                                                  Concussion   96
## 19                                                      Hernia   81
## 20                                                   Infection   57
## 21                                           Non-Standard Code   57
## 22                                                     Rupture   49
## 23                                               Mental Stress   40
## 24                                               Not Available   40
## 25                      Poisoning?Chemical (Other Than Metals)   30
## 26                                          Contagious Disease   28
## 27                                            Heat Prostration   22
## 28 Multiple Injuries Including Both Physical and Psychological   20
## 29                                                     Syncope   20
## 30                                              Electric Shock   18
## 31                                                  Amputation   16
## 32                                                  Asbestosis   13
## 33                            All Other Cumulative Injury, NOC   10
## 34                                             Loss of Hearing   10
## 35                                  Hearing Loss Or Impairment    9
## 36                                       Myocardial Infarction    7
## 37             Poisoning?General (NOT OD or Cumulative Injury)    7
## 38                                                 Vision Loss    7
## 39                  All Other Occupational Disease Injury, NOC    5
## 40                                                   Severance    5
## 41                                             Mental Disorder    4
## 42                                           Dust Disease, NOC    3
## 43                                                   Silicosis    3
## 44                                                    Vascular    3
## 45                                                   Radiation    2
## 46                                                        AIDS    1
## 47                                                Asphyxiation    1
## 48                                                      Cancer    1
## 49                                                    Freezing    1
## 50                                         VDT-Related Disease    1

Dado que se trata de una gran cantidad de respuestas diferentes, se añadirá una nueva columna a la base de datos que remplace a la columna en donde existen múltiples respuestas

# Esta línea de código crea una nueva columna en donde si el Injury Nature es Strain, se pondrá esos registros en la categoría Strain, si no, se agregó otra condición que aplique para Contusión (ya que son los regsitros que más filas tienen), y por último, si los registros no entran en las condiciones asignará "Others".
bd2$GroupInjury <- ifelse(bd2$InjuryNature == "Strain", "Strain",
                            ifelse(bd2$InjuryNature == "Contusion", "Contusion", "Others"))

BodyPart

# BodyPart
resumen_conteo <- bd2%>%
count(BodyPart) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo) # Respuestas a esta columna
##                                                       BodyPart    n
## 1                                                         Knee 2094
## 2  Multiple Body Parts (Including Body Systems and Body Parts) 1977
## 3                                              Lower Back Area 1684
## 4                                                    Finger(S) 1118
## 5                                                  Shoulder(S) 1042
## 6                                                         Hand 1000
## 7                                                        Ankle  925
## 8                                                        Wrist  777
## 9                                                         Foot  586
## 10                                                        Eyes  439
## 11                                                   Lower Leg  397
## 12                                                   Lower Arm  383
## 13                                            Soft Tissue-Neck  375
## 14                                                       Thumb  347
## 15                                        Multiple Head Injury  345
## 16                                                       Elbow  324
## 17                                        Multiple Neck Injury  312
## 18                                                   Upper Arm  261
## 19                                                       Chest  255
## 20                                                         Hip  226
## 21                                                     Abdomen  210
## 22         Lumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)  205
## 23                                  Multiple Upper Extremities  205
## 24                                  Multiple Lower Extremities  144
## 25                                                   Upper Leg  130
## 26                                             Upper Back Area  126
## 27                                            Soft Tissue-Head  120
## 28                                                  Disc-Trunk  111
## 29                                                Facial Bones   96
## 30                                          No Physical Injury   95
## 31                                                        Toes   95
## 32                                                       Skull   81
## 33                                                       Lungs   76
## 34                                                      Ear(S)   74
## 35                                           Non-Standard Code   73
## 36         Insufficient Info to Properly Identify?Unclassified   72
## 37                                                        Nose   71
## 38                                                    Buttocks   65
## 39                                                       Teeth   62
## 40                                                       Mouth   60
## 41                                             Internal Organs   47
## 42                      Body Systems and Multiple Body Systems   38
## 43                                              Multiple Trunk   35
## 44                                                   Great Toe   30
## 45                                                      Pelvis   27
## 46                                           Spinal Cord-Trunk   21
## 47                                           Sacrum And Coccyx   12
## 48                                                  Whole Body   11
## 49                                                       Brain   10
## 50                                                       Heart   10
## 51                                                      Larynx    6
## 52                                                   Vertebrae    6
## 53                                                     Trachea    3
## 54                                        Artificial Appliance    1
# Proceso similar al de InjuryNature (que crea una nueva columna a partir de la respuesta de BodyPart)
bd2$GroupBodyPart <- ifelse(bd2$BodyPart == "Knee", "Knee",
                            ifelse(bd2$BodyPart == "Multiple Body Parts (Including Body Systems and Body Parts)", "Multiple Body Parts","Others"))

BodyPartRegion

# BodyPartRegion
resumen_conteo <- bd2%>%
count(BodyPartRegion) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo) # Respuestas a esta columna
##        BodyPartRegion    n
## 1   Upper Extremities 5457
## 2   Lower Extremities 4627
## 3               Trunk 2884
## 4 Multiple Body Parts 2194
## 5                Head 1358
## 6                Neck  702
## 7   Non-Standard Code   73
bd2$GroupBodyPR <- ifelse(bd2$BodyPartRegion == "Upper Extremities", "Upper Extremities",
                            ifelse(bd2$BodyPartRegion == "Lower Extremities", "Lower Extremities","Others"))

Comprobación

A continuación se revisa que las nuevas columnas se hayan creado correctamente.

# Se comprueba la operación anterior 
resumen_conteo <- bd2%>%
count(GroupInjury) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo)
##   GroupInjury    n
## 1      Others 8671
## 2      Strain 5117
## 3   Contusion 3507
# Se comprueba la operación anterior 
resumen_conteo <- bd2%>%
count(GroupBodyPart) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo)
##         GroupBodyPart     n
## 1              Others 13224
## 2                Knee  2094
## 3 Multiple Body Parts  1977
# Se comprueba la operación anterior 
resumen_conteo <- bd2%>%
count(GroupBodyPR) %>%
arrange(desc(n))  # Ordenar por la columna 'n' en orden descendente
print(resumen_conteo)
##         GroupBodyPR    n
## 1            Others 7211
## 2 Upper Extremities 5457
## 3 Lower Extremities 4627

Tiempo de Procesamiento

# Se crea el árbol para el Tiempo de Procesamiento (TiempoDeProcesamiento)
arbol <- rpart(formula = TiempoDeProcesamiento ~ TotalIncurredCost + AverageWeeklyWage + ClaimantAge_at_DOI + Gender + ClaimantType + GroupBodyPR + GroupInjury + GroupBodyPart, data = bd2)
arbol
## n= 17295 
## 
## node), split, n, deviance, yval
##       * denotes terminal node
## 
## 1) root 17295 15686840000  780.9736  
##   2) TotalIncurredCost< 6803.83 12996 11770610000  662.2985  
##     4) GroupBodyPart=Knee,Others 11593  9238594000  603.8415 *
##     5) GroupBodyPart=Multiple Body Parts 1403  2165052000 1145.3290 *
##   3) TotalIncurredCost>=6803.83 4299  3179890000 1139.7320 *
rpart.plot(arbol)

prp(arbol)

Costo Total Incurrido (TotalIncurredCost)

# Se crea el árbol de decisión para el Costo Total Incurrido (TotalIncurredCost)
arbol <- rpart(formula = TotalIncurredCost ~ TiempoDeProcesamiento + AverageWeeklyWage + ClaimantAge_at_DOI + TiempoDeProcesamiento + Gender + ClaimantType + GroupInjury + GroupBodyPart + GroupBodyPR, data = bd2)
arbol
## n= 17295 
## 
## node), split, n, deviance, yval
##       * denotes terminal node
## 
## 1) root 17295 2.408921e+12  6729.6600  
##   2) ClaimantType=Medical Only,Report Only 8618 1.330940e+10   674.6686 *
##   3) ClaimantType=Indemnity 8677 1.765838e+12 12743.4800  
##     6) TiempoDeProcesamiento< 304.5 2375 7.847668e+10  4061.3980 *
##     7) TiempoDeProcesamiento>=304.5 6302 1.440870e+12 16015.4500 *
rpart.plot(arbol)

prp(arbol)

Modelo de Regresión

Nueva base de datos

# Se crea una nueva base de datos con las variables selecionadas para la modelación
bd3 <- subset(bd2, select = c("TiempoDeProcesamiento", "TotalIncurredCost", "TotalPaid", "TotalReserves", "TotalRecovery", "IndemnityPaid", "AverageWeeklyWage", "OtherPaid", "ClaimantAge_at_DOI", "ClaimStatus", "Gender", "ClaimantType", "InjuryNature", "BodyPartRegion", "BodyPart", "IsDenied", "ClaimID", "GroupInjury", "GroupBodyPart", "GroupBodyPR", "ClaimantOpenedDate", "ClaimantClosedDate" ))
# Se aplica la función summary para revisar la base de datos 
summary(bd3)
##  TiempoDeProcesamiento TotalIncurredCost    TotalPaid        TotalReserves
##  Min.   :   2          Min.   :    0.07   Min.   :     3.0   Min.   :0    
##  1st Qu.: 121          1st Qu.:  247.58   1st Qu.:   257.4   1st Qu.:0    
##  Median : 322          Median : 1071.55   Median :  1132.7   Median :0    
##  Mean   : 781          Mean   : 6729.66   Mean   :  6868.2   Mean   :0    
##  3rd Qu.:1078          3rd Qu.: 6709.07   3rd Qu.:  6910.0   3rd Qu.:0    
##  Max.   :6328          Max.   :59987.17   Max.   :127037.7   Max.   :0    
##                                                                           
##  TotalRecovery     IndemnityPaid    AverageWeeklyWage     OtherPaid      
##  Min.   :    0.0   Min.   :  -475   Min.   :    500.0   Min.   :-7820.5  
##  1st Qu.:    0.0   1st Qu.:     0   1st Qu.:    568.2   1st Qu.:  244.1  
##  Median :    0.0   Median :     0   Median :    666.0   Median :  921.0  
##  Mean   :  138.5   Mean   :  2837   Mean   :   1001.1   Mean   : 4031.2  
##  3rd Qu.:    0.0   3rd Qu.:  1966   3rd Qu.:    843.0   3rd Qu.: 4085.4  
##  Max.   :75000.0   Max.   :126128   Max.   :2024000.0   Max.   :82815.2  
##                                                                          
##  ClaimantAge_at_DOI ClaimStatus           Gender          ClaimantType      
##  Min.   :-7550.00   Length:17295       Length:17295       Length:17295      
##  1st Qu.:   37.00   Class :character   Class :character   Class :character  
##  Median :   46.00   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :   42.72                                                           
##  3rd Qu.:   53.00                                                           
##  Max.   :   87.00                                                           
##  NA's   :2982                                                               
##  InjuryNature       BodyPartRegion       BodyPart            IsDenied     
##  Length:17295       Length:17295       Length:17295       Min.   :0.0000  
##  Class :character   Class :character   Class :character   1st Qu.:0.0000  
##  Mode  :character   Mode  :character   Mode  :character   Median :0.0000  
##                                                           Mean   :0.0632  
##                                                           3rd Qu.:0.0000  
##                                                           Max.   :1.0000  
##                                                                           
##     ClaimID         GroupInjury        GroupBodyPart      GroupBodyPR       
##  Min.   :  650915   Length:17295       Length:17295       Length:17295      
##  1st Qu.:  817932   Class :character   Class :character   Class :character  
##  Median :  835440   Mode  :character   Mode  :character   Mode  :character  
##  Mean   : 8231238                                                           
##  3rd Qu.:10512786                                                           
##  Max.   :61546646                                                           
##                                                                             
##  ClaimantOpenedDate   ClaimantClosedDate  
##  Min.   :1994-08-07   Min.   :2005-03-31  
##  1st Qu.:2004-05-30   1st Qu.:2006-04-30  
##  Median :2008-04-17   Median :2009-03-09  
##  Mean   :2007-02-10   Mean   :2009-04-01  
##  3rd Qu.:2010-11-02   3rd Qu.:2011-09-21  
##  Max.   :2014-06-06   Max.   :2014-06-30  
## 
#Se identifican valores NA's
sapply(bd3, function(x) sum (is.na(x)))
## TiempoDeProcesamiento     TotalIncurredCost             TotalPaid 
##                     0                     0                     0 
##         TotalReserves         TotalRecovery         IndemnityPaid 
##                     0                     0                     0 
##     AverageWeeklyWage             OtherPaid    ClaimantAge_at_DOI 
##                     0                     0                  2982 
##           ClaimStatus                Gender          ClaimantType 
##                     0                     0                     0 
##          InjuryNature        BodyPartRegion              BodyPart 
##                     0                     0                     0 
##              IsDenied               ClaimID           GroupInjury 
##                     0                     0                     0 
##         GroupBodyPart           GroupBodyPR    ClaimantOpenedDate 
##                     0                     0                     0 
##    ClaimantClosedDate 
##                     0
# Se eliminan las filas con valores NA, ya que se considera que no afecta significativamente a la base de datos, pues solo están presentes en una columna, que es la de ClaimantAge_at_DOI
bd3 <- na.omit(bd3)
summary(bd3)
##  TiempoDeProcesamiento TotalIncurredCost   TotalPaid       TotalReserves
##  Min.   :   2.0        Min.   :    3.0   Min.   :    3.0   Min.   :0    
##  1st Qu.: 110.0        1st Qu.:  252.5   1st Qu.:  261.6   1st Qu.:0    
##  Median : 236.0        Median : 1063.3   Median : 1118.7   Median :0    
##  Mean   : 520.9        Mean   : 6598.7   Mean   : 6711.6   Mean   :0    
##  3rd Qu.: 637.0        3rd Qu.: 6230.6   3rd Qu.: 6417.9   3rd Qu.:0    
##  Max.   :6328.0        Max.   :59987.2   Max.   :98153.0   Max.   :0    
##  TotalRecovery     IndemnityPaid   AverageWeeklyWage   OtherPaid      
##  Min.   :    0.0   Min.   : -475   Min.   :    500   Min.   :    0.0  
##  1st Qu.:    0.0   1st Qu.:    0   1st Qu.:    572   1st Qu.:  248.8  
##  Median :    0.0   Median :    0   Median :    672   Median :  931.5  
##  Mean   :  112.8   Mean   : 2637   Mean   :   1054   Mean   : 4074.9  
##  3rd Qu.:    0.0   3rd Qu.: 1500   3rd Qu.:    859   3rd Qu.: 4014.6  
##  Max.   :75000.0   Max.   :55000   Max.   :2024000   Max.   :65747.1  
##  ClaimantAge_at_DOI ClaimStatus           Gender          ClaimantType      
##  Min.   :-7550.00   Length:14313       Length:14313       Length:14313      
##  1st Qu.:   37.00   Class :character   Class :character   Class :character  
##  Median :   46.00   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :   42.72                                                           
##  3rd Qu.:   53.00                                                           
##  Max.   :   87.00                                                           
##  InjuryNature       BodyPartRegion       BodyPart            IsDenied     
##  Length:14313       Length:14313       Length:14313       Min.   :0.0000  
##  Class :character   Class :character   Class :character   1st Qu.:0.0000  
##  Mode  :character   Mode  :character   Mode  :character   Median :0.0000  
##                                                           Mean   :0.0684  
##                                                           3rd Qu.:0.0000  
##                                                           Max.   :1.0000  
##     ClaimID         GroupInjury        GroupBodyPart      GroupBodyPR       
##  Min.   :  650915   Length:14313       Length:14313       Length:14313      
##  1st Qu.:  820314   Class :character   Class :character   Class :character  
##  Median :  834800   Mode  :character   Mode  :character   Mode  :character  
##  Mean   : 9716801                                                           
##  3rd Qu.:16200449                                                           
##  Max.   :61546646                                                           
##  ClaimantOpenedDate   ClaimantClosedDate  
##  Min.   :1996-03-30   Min.   :2005-03-31  
##  1st Qu.:2006-04-28   1st Qu.:2008-01-31  
##  Median :2009-03-06   Median :2010-01-08  
##  Mean   :2008-07-19   Mean   :2009-12-22  
##  3rd Qu.:2011-05-10   3rd Qu.:2012-03-08  
##  Max.   :2014-06-06   Max.   :2014-06-30
# Se aplica un count con el objetivo de conocer las respuestas a cada una de las variables categoricas.
count(bd3, ClaimStatus, sort=TRUE)
##   ClaimStatus     n
## 1           C 14313
count(bd3, Gender, sort=TRUE)
##          Gender    n
## 1          Male 7377
## 2        Female 6857
## 3 Not Available   79
count(bd3, ClaimantType, sort=TRUE)
##   ClaimantType    n
## 1 Medical Only 7352
## 2    Indemnity 6959
## 3  Report Only    2
count(bd3, InjuryNature, sort=TRUE)
##                                                   InjuryNature    n
## 1                                                       Strain 4325
## 2                                                    Contusion 3003
## 3                                                       Sprain 1819
## 4                                                   Laceration  929
## 5                                                     Fracture  866
## 6                              Multiple Physical Injuries Only  610
## 7                             All Other Specific Injuries, Noc  451
## 8                                                     Puncture  390
## 9                                       Carpal Tunnel Syndrome  200
## 10                                                Foreign Body  200
## 11                                                  Dermatitis  190
## 12                                                Inflammation  186
## 13                                                        Burn  140
## 14                                                 Dislocation  112
## 15                                          No Physical Injury  101
## 16                                       Respiratory Disorders  100
## 17                                                    Crushing   97
## 18                                                  Concussion   86
## 19                                                      Hernia   74
## 20                                           Non-Standard Code   57
## 21                                                   Infection   51
## 22                                                     Rupture   42
## 23                                               Not Available   40
## 24                                               Mental Stress   30
## 25                                          Contagious Disease   24
## 26                      Poisoning?Chemical (Other Than Metals)   23
## 27                                            Heat Prostration   21
## 28 Multiple Injuries Including Both Physical and Psychological   18
## 29                                                     Syncope   17
## 30                                              Electric Shock   16
## 31                                                  Amputation   15
## 32                                                  Asbestosis   12
## 33                            All Other Cumulative Injury, NOC   10
## 34                                  Hearing Loss Or Impairment    8
## 35                                             Loss of Hearing    7
## 36                                       Myocardial Infarction    7
## 37             Poisoning?General (NOT OD or Cumulative Injury)    7
## 38                                                 Vision Loss    6
## 39                  All Other Occupational Disease Injury, NOC    5
## 40                                                   Severance    4
## 41                                           Dust Disease, NOC    3
## 42                                                    Vascular    3
## 43                                             Mental Disorder    2
## 44                                                   Silicosis    2
## 45                                                        AIDS    1
## 46                                                Asphyxiation    1
## 47                                                    Freezing    1
## 48                                                   Radiation    1
count(bd3, BodyPartRegion, sort=TRUE)
##        BodyPartRegion    n
## 1   Upper Extremities 4548
## 2   Lower Extremities 3925
## 3               Trunk 2390
## 4 Multiple Body Parts 1593
## 5                Head 1159
## 6                Neck  626
## 7   Non-Standard Code   72
count(bd3, BodyPart, sort=TRUE)
##                                                       BodyPart    n
## 1                                                         Knee 1778
## 2  Multiple Body Parts (Including Body Systems and Body Parts) 1397
## 3                                              Lower Back Area 1370
## 4                                                  Shoulder(S)  964
## 5                                                    Finger(S)  900
## 6                                                         Hand  831
## 7                                                        Ankle  790
## 8                                                        Wrist  631
## 9                                                         Foot  508
## 10                                            Soft Tissue-Neck  369
## 11                                                        Eyes  360
## 12                                                   Lower Arm  352
## 13                                                   Lower Leg  344
## 14                                                       Elbow  282
## 15                                        Multiple Head Injury  281
## 16                                                       Thumb  277
## 17                                        Multiple Neck Injury  244
## 18                                                       Chest  220
## 19                                                     Abdomen  191
## 20                                                         Hip  184
## 21                                                   Upper Arm  179
## 22         Lumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)  171
## 23                                  Multiple Upper Extremities  132
## 24                                            Soft Tissue-Head  120
## 25                                                   Upper Leg  113
## 26                                             Upper Back Area  110
## 27                                  Multiple Lower Extremities  102
## 28                                          No Physical Injury   87
## 29                                                Facial Bones   83
## 30                                                       Skull   80
## 31                                                        Toes   77
## 32                                           Non-Standard Code   72
## 33                                                  Disc-Trunk   70
## 34                                                       Lungs   69
## 35                                                    Buttocks   64
## 36                                                      Ear(S)   64
## 37         Insufficient Info to Properly Identify?Unclassified   60
## 38                                                       Teeth   58
## 39                                                        Nose   55
## 40                                                       Mouth   48
## 41                      Body Systems and Multiple Body Systems   37
## 42                                             Internal Organs   33
## 43                                                   Great Toe   29
## 44                                              Multiple Trunk   28
## 45                                                      Pelvis   23
## 46                                           Spinal Cord-Trunk   21
## 47                                           Sacrum And Coccyx   11
## 48                                                  Whole Body   11
## 49                                                       Brain   10
## 50                                                       Heart    9
## 51                                                      Larynx    5
## 52                                                   Vertebrae    5
## 53                                                     Trachea    3
## 54                                        Artificial Appliance    1
count(bd3, GroupInjury, sort=TRUE)
##   GroupInjury    n
## 1      Others 6985
## 2      Strain 4325
## 3   Contusion 3003
count(bd3, GroupBodyPart, sort=TRUE)
##         GroupBodyPart     n
## 1              Others 11138
## 2                Knee  1778
## 3 Multiple Body Parts  1397
count(bd3, GroupBodyPR, sort=TRUE)
##         GroupBodyPR    n
## 1            Others 5840
## 2 Upper Extremities 4548
## 3 Lower Extremities 3925

Se observa que la variable ClaimStatus sólo tiene una categoría, y por lo tanto, no se incluirá en el análisis de regresión.

# Eliminación de outliers
# Cálculo del IQR 
IQR_TP <- IQR(bd3$TiempoDeProcesamiento)
IQR_TP
## [1] 527
# Se aplica un summary para ver los máximos, mínimos, y cuartiles de cada una de las variables de la base de datos. 
summary(bd3$TiempoDeProcesamiento)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     2.0   110.0   236.0   520.9   637.0  6328.0

Sólo se calculará el Límite Superior, porque para tiempo y costos, el valor cero es la ausencia de la característica, y por lo tanto, el Límite Inferior.

# Cálculo del Límite Superior para el TiempoDeProcesamiento
LS_TP <- 637 + 1.5 * IQR_TP
LS_TP
## [1] 1427.5

Con esto, se eliminarán los valores mayores a 1427.5.

bd3 <- bd3[bd3$TiempoDeProcesamiento > 0 & bd3$TiempoDeProcesamiento <= 1427.5, ]
# Eliminación de outliers
# Cálculo del IQR TotalIncurredCost
IQR_TP <- IQR(bd3$TotalIncurredCost)
IQR_TP
## [1] 4919.73
summary(bd3$TotalIncurredCost)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     3.0   243.5   932.4  5996.7  5163.3 59800.2
# Cálculo del Límite Superior para el TiempoDeProcesamiento
LS_TP <- 5163.5 + 1.5 * IQR_TP
LS_TP
## [1] 12543.1

Con esto, se eliminarán los valores mayores a 12543.1

bd3 <- bd3[bd3$TotalIncurredCost > 0 & bd3$TotalIncurredCost <= 12543.1, ]

TiempoDeProcesamiento

Creación del modelo

# Se crea el modelo de regresión
regresiontp <- lm(TiempoDeProcesamiento ~ TotalIncurredCost + AverageWeeklyWage + ClaimantAge_at_DOI + Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + IsDenied + GroupInjury + GroupBodyPart + GroupBodyPR, data = bd3)
summary(regresiontp)
## 
## Call:
## lm(formula = TiempoDeProcesamiento ~ TotalIncurredCost + AverageWeeklyWage + 
##     ClaimantAge_at_DOI + Gender + ClaimantType + InjuryNature + 
##     BodyPartRegion + BodyPart + IsDenied + GroupInjury + GroupBodyPart + 
##     GroupBodyPR, data = bd3)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -583.22 -143.51  -71.93   49.01 1266.06 
## 
## Coefficients: (12 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                              5.878e+01
## TotalIncurredCost                                                        3.118e-02
## AverageWeeklyWage                                                       -9.589e-05
## ClaimantAge_at_DOI                                                      -4.637e-02
## GenderMale                                                               2.108e+01
## GenderNot Available                                                      2.371e+01
## ClaimantTypeMedical Only                                                -9.718e+01
## ClaimantTypeReport Only                                                 -1.176e+02
## InjuryNatureAll Other Cumulative Injury, NOC                             1.610e+02
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.968e+02
## InjuryNatureAll Other Specific Injuries, Noc                             2.562e+02
## InjuryNatureAmputation                                                  -4.077e+01
## InjuryNatureAsbestosis                                                   1.386e+02
## InjuryNatureAsphyxiation                                                 1.153e+02
## InjuryNatureBurn                                                         2.139e+02
## InjuryNatureCarpal Tunnel Syndrome                                       2.945e+02
## InjuryNatureConcussion                                                   1.580e+02
## InjuryNatureContagious Disease                                           1.703e+02
## InjuryNatureContusion                                                    2.457e+02
## InjuryNatureCrushing                                                     1.452e+02
## InjuryNatureDermatitis                                                   1.665e+02
## InjuryNatureDislocation                                                  2.616e+02
## InjuryNatureDust Disease, NOC                                            3.684e+02
## InjuryNatureElectric Shock                                               1.976e+02
## InjuryNatureForeign Body                                                 2.200e+02
## InjuryNatureFracture                                                     2.117e+02
## InjuryNatureFreezing                                                     1.096e+02
## InjuryNatureHearing Loss Or Impairment                                   1.245e+02
## InjuryNatureHeat Prostration                                             7.344e+01
## InjuryNatureHernia                                                       1.186e+02
## InjuryNatureInfection                                                    2.137e+02
## InjuryNatureInflammation                                                 1.833e+02
## InjuryNatureLaceration                                                   2.218e+02
## InjuryNatureLoss of Hearing                                              6.492e+01
## InjuryNatureMental Disorder                                              2.090e+02
## InjuryNatureMental Stress                                                3.217e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  4.995e+01
## InjuryNatureMultiple Physical Injuries Only                              2.072e+02
## InjuryNatureMyocardial Infarction                                       -9.611e+01
## InjuryNatureNo Physical Injury                                           1.797e+02
## InjuryNatureNon-Standard Code                                            2.381e+02
## InjuryNatureNot Available                                                1.368e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       1.825e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.116e+02
## InjuryNaturePuncture                                                     2.273e+02
## InjuryNatureRadiation                                                    3.622e+01
## InjuryNatureRespiratory Disorders                                        2.008e+02
## InjuryNatureRupture                                                      8.715e+01
## InjuryNatureSeverance                                                    9.754e+01
## InjuryNatureSilicosis                                                    2.763e+02
## InjuryNatureSprain                                                       1.910e+02
## InjuryNatureStrain                                                       2.306e+02
## InjuryNatureSyncope                                                      8.046e+01
## InjuryNatureVascular                                                     5.348e+02
## InjuryNatureVision Loss                                                  3.299e+02
## BodyPartRegionLower Extremities                                         -3.788e+01
## BodyPartRegionMultiple Body Parts                                       -1.395e+02
## BodyPartRegionNeck                                                       2.542e+02
## BodyPartRegionNon-Standard Code                                         -6.589e+01
## BodyPartRegionTrunk                                                     -4.425e+01
## BodyPartRegionUpper Extremities                                         -4.016e-01
## BodyPartAnkle                                                            4.310e+01
## BodyPartArtificial Appliance                                            -8.454e+01
## BodyPartBody Systems and Multiple Body Systems                           1.856e+02
## BodyPartBrain                                                           -1.585e+02
## BodyPartButtocks                                                        -6.297e+00
## BodyPartChest                                                            2.943e+01
## BodyPartDisc-Trunk                                                       7.679e+01
## BodyPartEar(S)                                                           3.804e+01
## BodyPartElbow                                                           -3.004e+01
## BodyPartEyes                                                            -4.950e+00
## BodyPartFacial Bones                                                    -4.801e+01
## BodyPartFinger(S)                                                       -1.190e+01
## BodyPartFoot                                                             7.525e+00
## BodyPartGreat Toe                                                        1.335e+01
## BodyPartHand                                                            -1.531e+01
## BodyPartHeart                                                            2.871e+02
## BodyPartHip                                                             -5.598e+00
## BodyPartInsufficient Info to Properly Identify?Unclassified              1.629e+02
## BodyPartInternal Organs                                                  7.747e+01
## BodyPartKnee                                                             2.103e+01
## BodyPartLarynx                                                           9.240e+00
## BodyPartLower Arm                                                       -1.933e+01
## BodyPartLower Back Area                                                  4.013e+01
## BodyPartLower Leg                                                        1.984e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              6.139e+01
## BodyPartLungs                                                            1.202e+02
## BodyPartMouth                                                            8.309e+01
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      2.033e+02
## BodyPartMultiple Head Injury                                             2.033e+01
## BodyPartMultiple Lower Extremities                                       3.523e+01
## BodyPartMultiple Neck Injury                                            -1.921e+02
## BodyPartMultiple Trunk                                                  -8.605e+00
## BodyPartMultiple Upper Extremities                                       5.478e+01
## BodyPartNo Physical Injury                                               2.204e+02
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                            -4.552e+01
## BodyPartPelvis                                                           1.303e+02
## BodyPartSacrum And Coccyx                                               -3.288e+00
## BodyPartShoulder(S)                                                     -1.719e+01
## BodyPartSkull                                                           -8.788e+01
## BodyPartSoft Tissue-Head                                                -1.086e+02
## BodyPartSoft Tissue-Neck                                                -3.113e+02
## BodyPartSpinal Cord-Trunk                                                3.762e+02
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                           -2.365e+01
## BodyPartToes                                                            -1.127e+01
## BodyPartTrachea                                                         -1.686e+02
## BodyPartUpper Arm                                                        3.219e+01
## BodyPartUpper Back Area                                                  5.334e+01
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                -5.606e-01
## GroupInjuryOthers                                                               NA
## GroupInjuryStrain                                                               NA
## GroupBodyPartMultiple Body Parts                                                NA
## GroupBodyPartOthers                                                             NA
## GroupBodyPROthers                                                               NA
## GroupBodyPRUpper Extremities                                                    NA
##                                                                         Std. Error
## (Intercept)                                                              2.672e+02
## TotalIncurredCost                                                        1.174e-03
## AverageWeeklyWage                                                        1.074e-04
## ClaimantAge_at_DOI                                                       2.093e-02
## GenderMale                                                               5.214e+00
## GenderNot Available                                                      3.026e+01
## ClaimantTypeMedical Only                                                 6.471e+00
## ClaimantTypeReport Only                                                  1.862e+02
## InjuryNatureAll Other Cumulative Injury, NOC                             2.790e+02
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.959e+02
## InjuryNatureAll Other Specific Injuries, Noc                             2.652e+02
## InjuryNatureAmputation                                                   3.051e+02
## InjuryNatureAsbestosis                                                   2.763e+02
## InjuryNatureAsphyxiation                                                 3.707e+02
## InjuryNatureBurn                                                         2.657e+02
## InjuryNatureCarpal Tunnel Syndrome                                       2.657e+02
## InjuryNatureConcussion                                                   2.667e+02
## InjuryNatureContagious Disease                                           2.708e+02
## InjuryNatureContusion                                                    2.648e+02
## InjuryNatureCrushing                                                     2.662e+02
## InjuryNatureDermatitis                                                   2.654e+02
## InjuryNatureDislocation                                                  2.671e+02
## InjuryNatureDust Disease, NOC                                            3.056e+02
## InjuryNatureElectric Shock                                               2.750e+02
## InjuryNatureForeign Body                                                 2.659e+02
## InjuryNatureFracture                                                     2.650e+02
## InjuryNatureFreezing                                                     3.728e+02
## InjuryNatureHearing Loss Or Impairment                                   2.883e+02
## InjuryNatureHeat Prostration                                             2.703e+02
## InjuryNatureHernia                                                       2.676e+02
## InjuryNatureInfection                                                    2.673e+02
## InjuryNatureInflammation                                                 2.656e+02
## InjuryNatureLaceration                                                   2.650e+02
## InjuryNatureLoss of Hearing                                              2.981e+02
## InjuryNatureMental Disorder                                              3.839e+02
## InjuryNatureMental Stress                                                2.678e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.763e+02
## InjuryNatureMultiple Physical Injuries Only                              2.650e+02
## InjuryNatureMyocardial Infarction                                        3.052e+02
## InjuryNatureNo Physical Injury                                           2.646e+02
## InjuryNatureNon-Standard Code                                            2.672e+02
## InjuryNatureNot Available                                                2.683e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.706e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.815e+02
## InjuryNaturePuncture                                                     2.652e+02
## InjuryNatureRadiation                                                    3.737e+02
## InjuryNatureRespiratory Disorders                                        2.669e+02
## InjuryNatureRupture                                                      2.721e+02
## InjuryNatureSeverance                                                    3.727e+02
## InjuryNatureSilicosis                                                    3.236e+02
## InjuryNatureSprain                                                       2.649e+02
## InjuryNatureStrain                                                       2.648e+02
## InjuryNatureSyncope                                                      2.723e+02
## InjuryNatureVascular                                                     3.052e+02
## InjuryNatureVision Loss                                                  2.861e+02
## BodyPartRegionLower Extremities                                          4.530e+01
## BodyPartRegionMultiple Body Parts                                        9.992e+01
## BodyPartRegionNeck                                                       1.227e+02
## BodyPartRegionNon-Standard Code                                          4.931e+01
## BodyPartRegionTrunk                                                      4.287e+01
## BodyPartRegionUpper Extremities                                          3.835e+01
## BodyPartAnkle                                                            2.936e+01
## BodyPartArtificial Appliance                                             2.783e+02
## BodyPartBody Systems and Multiple Body Systems                           1.044e+02
## BodyPartBrain                                                            1.020e+02
## BodyPartButtocks                                                         4.126e+01
## BodyPartChest                                                            2.972e+01
## BodyPartDisc-Trunk                                                       4.357e+01
## BodyPartEar(S)                                                           5.394e+01
## BodyPartElbow                                                            2.182e+01
## BodyPartEyes                                                             4.070e+01
## BodyPartFacial Bones                                                     4.829e+01
## BodyPartFinger(S)                                                        1.624e+01
## BodyPartFoot                                                             2.994e+01
## BodyPartGreat Toe                                                        5.665e+01
## BodyPartHand                                                             1.593e+01
## BodyPartHeart                                                            1.359e+02
## BodyPartHip                                                              3.496e+01
## BodyPartInsufficient Info to Properly Identify?Unclassified              1.015e+02
## BodyPartInternal Organs                                                  6.119e+01
## BodyPartKnee                                                             2.826e+01
## BodyPartLarynx                                                           1.762e+02
## BodyPartLower Arm                                                        1.974e+01
## BodyPartLower Back Area                                                  2.426e+01
## BodyPartLower Leg                                                        3.112e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              3.269e+01
## BodyPartLungs                                                            4.865e+01
## BodyPartMouth                                                            5.439e+01
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      9.358e+01
## BodyPartMultiple Head Injury                                             4.033e+01
## BodyPartMultiple Lower Extremities                                       4.012e+01
## BodyPartMultiple Neck Injury                                             1.188e+02
## BodyPartMultiple Trunk                                                   5.993e+01
## BodyPartMultiple Upper Extremities                                       3.078e+01
## BodyPartNo Physical Injury                                               9.981e+01
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             5.234e+01
## BodyPartPelvis                                                           6.704e+01
## BodyPartSacrum And Coccyx                                                9.047e+01
## BodyPartShoulder(S)                                                      1.689e+01
## BodyPartSkull                                                            4.810e+01
## BodyPartSoft Tissue-Head                                                 4.380e+01
## BodyPartSoft Tissue-Neck                                                 1.181e+02
## BodyPartSpinal Cord-Trunk                                                6.951e+01
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            2.159e+01
## BodyPartToes                                                             4.150e+01
## BodyPartTrachea                                                          2.201e+02
## BodyPartUpper Arm                                                        2.751e+01
## BodyPartUpper Back Area                                                  3.584e+01
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                 9.784e+00
## GroupInjuryOthers                                                               NA
## GroupInjuryStrain                                                               NA
## GroupBodyPartMultiple Body Parts                                                NA
## GroupBodyPartOthers                                                             NA
## GroupBodyPROthers                                                               NA
## GroupBodyPRUpper Extremities                                                    NA
##                                                                         t value
## (Intercept)                                                               0.220
## TotalIncurredCost                                                        26.573
## AverageWeeklyWage                                                        -0.893
## ClaimantAge_at_DOI                                                       -2.215
## GenderMale                                                                4.043
## GenderNot Available                                                       0.783
## ClaimantTypeMedical Only                                                -15.017
## ClaimantTypeReport Only                                                  -0.632
## InjuryNatureAll Other Cumulative Injury, NOC                              0.577
## InjuryNatureAll Other Occupational Disease Injury, NOC                    1.003
## InjuryNatureAll Other Specific Injuries, Noc                              0.966
## InjuryNatureAmputation                                                   -0.134
## InjuryNatureAsbestosis                                                    0.502
## InjuryNatureAsphyxiation                                                  0.311
## InjuryNatureBurn                                                          0.805
## InjuryNatureCarpal Tunnel Syndrome                                        1.108
## InjuryNatureConcussion                                                    0.593
## InjuryNatureContagious Disease                                            0.629
## InjuryNatureContusion                                                     0.928
## InjuryNatureCrushing                                                      0.545
## InjuryNatureDermatitis                                                    0.628
## InjuryNatureDislocation                                                   0.980
## InjuryNatureDust Disease, NOC                                             1.205
## InjuryNatureElectric Shock                                                0.719
## InjuryNatureForeign Body                                                  0.827
## InjuryNatureFracture                                                      0.799
## InjuryNatureFreezing                                                      0.294
## InjuryNatureHearing Loss Or Impairment                                    0.432
## InjuryNatureHeat Prostration                                              0.272
## InjuryNatureHernia                                                        0.443
## InjuryNatureInfection                                                     0.799
## InjuryNatureInflammation                                                  0.690
## InjuryNatureLaceration                                                    0.837
## InjuryNatureLoss of Hearing                                               0.218
## InjuryNatureMental Disorder                                               0.544
## InjuryNatureMental Stress                                                 1.201
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.181
## InjuryNatureMultiple Physical Injuries Only                               0.782
## InjuryNatureMyocardial Infarction                                        -0.315
## InjuryNatureNo Physical Injury                                            0.679
## InjuryNatureNon-Standard Code                                             0.891
## InjuryNatureNot Available                                                 0.510
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.675
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.752
## InjuryNaturePuncture                                                      0.857
## InjuryNatureRadiation                                                     0.097
## InjuryNatureRespiratory Disorders                                         0.752
## InjuryNatureRupture                                                       0.320
## InjuryNatureSeverance                                                     0.262
## InjuryNatureSilicosis                                                     0.854
## InjuryNatureSprain                                                        0.721
## InjuryNatureStrain                                                        0.871
## InjuryNatureSyncope                                                       0.295
## InjuryNatureVascular                                                      1.752
## InjuryNatureVision Loss                                                   1.153
## BodyPartRegionLower Extremities                                          -0.836
## BodyPartRegionMultiple Body Parts                                        -1.396
## BodyPartRegionNeck                                                        2.071
## BodyPartRegionNon-Standard Code                                          -1.336
## BodyPartRegionTrunk                                                      -1.032
## BodyPartRegionUpper Extremities                                          -0.010
## BodyPartAnkle                                                             1.468
## BodyPartArtificial Appliance                                             -0.304
## BodyPartBody Systems and Multiple Body Systems                            1.777
## BodyPartBrain                                                            -1.554
## BodyPartButtocks                                                         -0.153
## BodyPartChest                                                             0.990
## BodyPartDisc-Trunk                                                        1.763
## BodyPartEar(S)                                                            0.705
## BodyPartElbow                                                            -1.377
## BodyPartEyes                                                             -0.122
## BodyPartFacial Bones                                                     -0.994
## BodyPartFinger(S)                                                        -0.733
## BodyPartFoot                                                              0.251
## BodyPartGreat Toe                                                         0.236
## BodyPartHand                                                             -0.961
## BodyPartHeart                                                             2.112
## BodyPartHip                                                              -0.160
## BodyPartInsufficient Info to Properly Identify?Unclassified               1.605
## BodyPartInternal Organs                                                   1.266
## BodyPartKnee                                                              0.744
## BodyPartLarynx                                                            0.052
## BodyPartLower Arm                                                        -0.979
## BodyPartLower Back Area                                                   1.654
## BodyPartLower Leg                                                         0.638
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               1.878
## BodyPartLungs                                                             2.471
## BodyPartMouth                                                             1.528
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)       2.172
## BodyPartMultiple Head Injury                                              0.504
## BodyPartMultiple Lower Extremities                                        0.878
## BodyPartMultiple Neck Injury                                             -1.617
## BodyPartMultiple Trunk                                                   -0.144
## BodyPartMultiple Upper Extremities                                        1.780
## BodyPartNo Physical Injury                                                2.208
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                             -0.870
## BodyPartPelvis                                                            1.944
## BodyPartSacrum And Coccyx                                                -0.036
## BodyPartShoulder(S)                                                      -1.017
## BodyPartSkull                                                            -1.827
## BodyPartSoft Tissue-Head                                                 -2.479
## BodyPartSoft Tissue-Neck                                                 -2.635
## BodyPartSpinal Cord-Trunk                                                 5.412
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                            -1.096
## BodyPartToes                                                             -0.271
## BodyPartTrachea                                                          -0.766
## BodyPartUpper Arm                                                         1.170
## BodyPartUpper Back Area                                                   1.488
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## IsDenied                                                                 -0.057
## GroupInjuryOthers                                                            NA
## GroupInjuryStrain                                                            NA
## GroupBodyPartMultiple Body Parts                                             NA
## GroupBodyPartOthers                                                          NA
## GroupBodyPROthers                                                            NA
## GroupBodyPRUpper Extremities                                                 NA
##                                                                         Pr(>|t|)
## (Intercept)                                                              0.82591
## TotalIncurredCost                                                        < 2e-16
## AverageWeeklyWage                                                        0.37184
## ClaimantAge_at_DOI                                                       0.02676
## GenderMale                                                              5.31e-05
## GenderNot Available                                                      0.43336
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                  0.52769
## InjuryNatureAll Other Cumulative Injury, NOC                             0.56377
## InjuryNatureAll Other Occupational Disease Injury, NOC                   0.31588
## InjuryNatureAll Other Specific Injuries, Noc                             0.33396
## InjuryNatureAmputation                                                   0.89371
## InjuryNatureAsbestosis                                                   0.61584
## InjuryNatureAsphyxiation                                                 0.75583
## InjuryNatureBurn                                                         0.42080
## InjuryNatureCarpal Tunnel Syndrome                                       0.26776
## InjuryNatureConcussion                                                   0.55352
## InjuryNatureContagious Disease                                           0.52960
## InjuryNatureContusion                                                    0.35354
## InjuryNatureCrushing                                                     0.58545
## InjuryNatureDermatitis                                                   0.53033
## InjuryNatureDislocation                                                  0.32730
## InjuryNatureDust Disease, NOC                                            0.22805
## InjuryNatureElectric Shock                                               0.47237
## InjuryNatureForeign Body                                                 0.40800
## InjuryNatureFracture                                                     0.42442
## InjuryNatureFreezing                                                     0.76866
## InjuryNatureHearing Loss Or Impairment                                   0.66584
## InjuryNatureHeat Prostration                                             0.78585
## InjuryNatureHernia                                                       0.65767
## InjuryNatureInfection                                                    0.42407
## InjuryNatureInflammation                                                 0.48999
## InjuryNatureLaceration                                                   0.40243
## InjuryNatureLoss of Hearing                                              0.82761
## InjuryNatureMental Disorder                                              0.58614
## InjuryNatureMental Stress                                                0.22972
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  0.85657
## InjuryNatureMultiple Physical Injuries Only                              0.43445
## InjuryNatureMyocardial Infarction                                        0.75280
## InjuryNatureNo Physical Injury                                           0.49692
## InjuryNatureNon-Standard Code                                            0.37301
## InjuryNatureNot Available                                                0.61011
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       0.49993
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              0.45228
## InjuryNaturePuncture                                                     0.39132
## InjuryNatureRadiation                                                    0.92279
## InjuryNatureRespiratory Disorders                                        0.45197
## InjuryNatureRupture                                                      0.74879
## InjuryNatureSeverance                                                    0.79354
## InjuryNatureSilicosis                                                    0.39325
## InjuryNatureSprain                                                       0.47091
## InjuryNatureStrain                                                       0.38383
## InjuryNatureSyncope                                                      0.76766
## InjuryNatureVascular                                                     0.07977
## InjuryNatureVision Loss                                                  0.24889
## BodyPartRegionLower Extremities                                          0.40308
## BodyPartRegionMultiple Body Parts                                        0.16280
## BodyPartRegionNeck                                                       0.03835
## BodyPartRegionNon-Standard Code                                          0.18152
## BodyPartRegionTrunk                                                      0.30205
## BodyPartRegionUpper Extremities                                          0.99164
## BodyPartAnkle                                                            0.14217
## BodyPartArtificial Appliance                                             0.76132
## BodyPartBody Systems and Multiple Body Systems                           0.07553
## BodyPartBrain                                                            0.12024
## BodyPartButtocks                                                         0.87871
## BodyPartChest                                                            0.32200
## BodyPartDisc-Trunk                                                       0.07799
## BodyPartEar(S)                                                           0.48062
## BodyPartElbow                                                            0.16866
## BodyPartEyes                                                             0.90319
## BodyPartFacial Bones                                                     0.32016
## BodyPartFinger(S)                                                        0.46383
## BodyPartFoot                                                             0.80152
## BodyPartGreat Toe                                                        0.81375
## BodyPartHand                                                             0.33640
## BodyPartHeart                                                            0.03468
## BodyPartHip                                                              0.87279
## BodyPartInsufficient Info to Properly Identify?Unclassified              0.10859
## BodyPartInternal Organs                                                  0.20556
## BodyPartKnee                                                             0.45681
## BodyPartLarynx                                                           0.95818
## BodyPartLower Arm                                                        0.32758
## BodyPartLower Back Area                                                  0.09815
## BodyPartLower Leg                                                        0.52375
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              0.06041
## BodyPartLungs                                                            0.01349
## BodyPartMouth                                                            0.12659
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      0.02984
## BodyPartMultiple Head Injury                                             0.61425
## BodyPartMultiple Lower Extremities                                       0.37990
## BodyPartMultiple Neck Injury                                             0.10583
## BodyPartMultiple Trunk                                                   0.88583
## BodyPartMultiple Upper Extremities                                       0.07514
## BodyPartNo Physical Injury                                               0.02725
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                             0.38443
## BodyPartPelvis                                                           0.05196
## BodyPartSacrum And Coccyx                                                0.97101
## BodyPartShoulder(S)                                                      0.30899
## BodyPartSkull                                                            0.06771
## BodyPartSoft Tissue-Head                                                 0.01319
## BodyPartSoft Tissue-Neck                                                 0.00842
## BodyPartSpinal Cord-Trunk                                               6.38e-08
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                            0.27321
## BodyPartToes                                                             0.78604
## BodyPartTrachea                                                          0.44368
## BodyPartUpper Arm                                                        0.24202
## BodyPartUpper Back Area                                                  0.13676
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## IsDenied                                                                 0.95431
## GroupInjuryOthers                                                             NA
## GroupInjuryStrain                                                             NA
## GroupBodyPartMultiple Body Parts                                              NA
## GroupBodyPartOthers                                                           NA
## GroupBodyPROthers                                                             NA
## GroupBodyPRUpper Extremities                                                  NA
##                                                                            
## (Intercept)                                                                
## TotalIncurredCost                                                       ***
## AverageWeeklyWage                                                          
## ClaimantAge_at_DOI                                                      *  
## GenderMale                                                              ***
## GenderNot Available                                                        
## ClaimantTypeMedical Only                                                ***
## ClaimantTypeReport Only                                                    
## InjuryNatureAll Other Cumulative Injury, NOC                               
## InjuryNatureAll Other Occupational Disease Injury, NOC                     
## InjuryNatureAll Other Specific Injuries, Noc                               
## InjuryNatureAmputation                                                     
## InjuryNatureAsbestosis                                                     
## InjuryNatureAsphyxiation                                                   
## InjuryNatureBurn                                                           
## InjuryNatureCarpal Tunnel Syndrome                                         
## InjuryNatureConcussion                                                     
## InjuryNatureContagious Disease                                             
## InjuryNatureContusion                                                      
## InjuryNatureCrushing                                                       
## InjuryNatureDermatitis                                                     
## InjuryNatureDislocation                                                    
## InjuryNatureDust Disease, NOC                                              
## InjuryNatureElectric Shock                                                 
## InjuryNatureForeign Body                                                   
## InjuryNatureFracture                                                       
## InjuryNatureFreezing                                                       
## InjuryNatureHearing Loss Or Impairment                                     
## InjuryNatureHeat Prostration                                               
## InjuryNatureHernia                                                         
## InjuryNatureInfection                                                      
## InjuryNatureInflammation                                                   
## InjuryNatureLaceration                                                     
## InjuryNatureLoss of Hearing                                                
## InjuryNatureMental Disorder                                                
## InjuryNatureMental Stress                                                  
## InjuryNatureMultiple Injuries Including Both Physical and Psychological    
## InjuryNatureMultiple Physical Injuries Only                                
## InjuryNatureMyocardial Infarction                                          
## InjuryNatureNo Physical Injury                                             
## InjuryNatureNon-Standard Code                                              
## InjuryNatureNot Available                                                  
## InjuryNaturePoisoning?Chemical (Other Than Metals)                         
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)                
## InjuryNaturePuncture                                                       
## InjuryNatureRadiation                                                      
## InjuryNatureRespiratory Disorders                                          
## InjuryNatureRupture                                                        
## InjuryNatureSeverance                                                      
## InjuryNatureSilicosis                                                      
## InjuryNatureSprain                                                         
## InjuryNatureStrain                                                         
## InjuryNatureSyncope                                                        
## InjuryNatureVascular                                                    .  
## InjuryNatureVision Loss                                                    
## BodyPartRegionLower Extremities                                            
## BodyPartRegionMultiple Body Parts                                          
## BodyPartRegionNeck                                                      *  
## BodyPartRegionNon-Standard Code                                            
## BodyPartRegionTrunk                                                        
## BodyPartRegionUpper Extremities                                            
## BodyPartAnkle                                                              
## BodyPartArtificial Appliance                                               
## BodyPartBody Systems and Multiple Body Systems                          .  
## BodyPartBrain                                                              
## BodyPartButtocks                                                           
## BodyPartChest                                                              
## BodyPartDisc-Trunk                                                      .  
## BodyPartEar(S)                                                             
## BodyPartElbow                                                              
## BodyPartEyes                                                               
## BodyPartFacial Bones                                                       
## BodyPartFinger(S)                                                          
## BodyPartFoot                                                               
## BodyPartGreat Toe                                                          
## BodyPartHand                                                               
## BodyPartHeart                                                           *  
## BodyPartHip                                                                
## BodyPartInsufficient Info to Properly Identify?Unclassified                
## BodyPartInternal Organs                                                    
## BodyPartKnee                                                               
## BodyPartLarynx                                                             
## BodyPartLower Arm                                                          
## BodyPartLower Back Area                                                 .  
## BodyPartLower Leg                                                          
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             .  
## BodyPartLungs                                                           *  
## BodyPartMouth                                                              
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     *  
## BodyPartMultiple Head Injury                                               
## BodyPartMultiple Lower Extremities                                         
## BodyPartMultiple Neck Injury                                               
## BodyPartMultiple Trunk                                                     
## BodyPartMultiple Upper Extremities                                      .  
## BodyPartNo Physical Injury                                              *  
## BodyPartNon-Standard Code                                                  
## BodyPartNose                                                               
## BodyPartPelvis                                                          .  
## BodyPartSacrum And Coccyx                                                  
## BodyPartShoulder(S)                                                        
## BodyPartSkull                                                           .  
## BodyPartSoft Tissue-Head                                                *  
## BodyPartSoft Tissue-Neck                                                ** 
## BodyPartSpinal Cord-Trunk                                               ***
## BodyPartTeeth                                                              
## BodyPartThumb                                                              
## BodyPartToes                                                               
## BodyPartTrachea                                                            
## BodyPartUpper Arm                                                          
## BodyPartUpper Back Area                                                    
## BodyPartUpper Leg                                                          
## BodyPartVertebrae                                                          
## BodyPartWhole Body                                                         
## BodyPartWrist                                                              
## IsDenied                                                                   
## GroupInjuryOthers                                                          
## GroupInjuryStrain                                                          
## GroupBodyPartMultiple Body Parts                                           
## GroupBodyPartOthers                                                        
## GroupBodyPROthers                                                          
## GroupBodyPRUpper Extremities                                               
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 262.1 on 10912 degrees of freedom
## Multiple R-squared:  0.1886, Adjusted R-squared:  0.1806 
## F-statistic: 23.49 on 108 and 10912 DF,  p-value: < 2.2e-16

Ajuste del modelo

# Se ajusta el modelo de regresion
regresiontp <- lm(TiempoDeProcesamiento ~ TotalIncurredCost + Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + ClaimantAge_at_DOI, data = bd3)
summary(regresiontp)
## 
## Call:
## lm(formula = TiempoDeProcesamiento ~ TotalIncurredCost + Gender + 
##     ClaimantType + InjuryNature + BodyPartRegion + BodyPart + 
##     ClaimantAge_at_DOI, data = bd3)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -583.22 -143.40  -71.92   49.07 1266.24 
## 
## Coefficients: (6 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                              5.531e+01
## TotalIncurredCost                                                        3.119e-02
## GenderMale                                                               2.103e+01
## GenderNot Available                                                      2.369e+01
## ClaimantTypeMedical Only                                                -9.721e+01
## ClaimantTypeReport Only                                                 -1.175e+02
## InjuryNatureAll Other Cumulative Injury, NOC                             1.609e+02
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.968e+02
## InjuryNatureAll Other Specific Injuries, Noc                             2.556e+02
## InjuryNatureAmputation                                                  -4.077e+01
## InjuryNatureAsbestosis                                                   1.387e+02
## InjuryNatureAsphyxiation                                                 1.153e+02
## InjuryNatureBurn                                                         2.140e+02
## InjuryNatureCarpal Tunnel Syndrome                                       2.944e+02
## InjuryNatureConcussion                                                   1.580e+02
## InjuryNatureContagious Disease                                           1.702e+02
## InjuryNatureContusion                                                    2.457e+02
## InjuryNatureCrushing                                                     1.453e+02
## InjuryNatureDermatitis                                                   1.665e+02
## InjuryNatureDislocation                                                  2.616e+02
## InjuryNatureDust Disease, NOC                                            3.684e+02
## InjuryNatureElectric Shock                                               1.977e+02
## InjuryNatureForeign Body                                                 2.200e+02
## InjuryNatureFracture                                                     2.118e+02
## InjuryNatureFreezing                                                     1.098e+02
## InjuryNatureHearing Loss Or Impairment                                   1.244e+02
## InjuryNatureHeat Prostration                                             7.338e+01
## InjuryNatureHernia                                                       1.185e+02
## InjuryNatureInfection                                                    2.137e+02
## InjuryNatureInflammation                                                 1.833e+02
## InjuryNatureLaceration                                                   2.219e+02
## InjuryNatureLoss of Hearing                                              6.472e+01
## InjuryNatureMental Disorder                                              2.091e+02
## InjuryNatureMental Stress                                                3.214e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  5.021e+01
## InjuryNatureMultiple Physical Injuries Only                              2.069e+02
## InjuryNatureMyocardial Infarction                                       -9.655e+01
## InjuryNatureNo Physical Injury                                           1.796e+02
## InjuryNatureNon-Standard Code                                            2.381e+02
## InjuryNatureNot Available                                                1.368e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       1.825e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.116e+02
## InjuryNaturePuncture                                                     2.273e+02
## InjuryNatureRadiation                                                    3.614e+01
## InjuryNatureRespiratory Disorders                                        2.006e+02
## InjuryNatureRupture                                                      8.700e+01
## InjuryNatureSeverance                                                    9.756e+01
## InjuryNatureSilicosis                                                    2.763e+02
## InjuryNatureSprain                                                       1.910e+02
## InjuryNatureStrain                                                       2.306e+02
## InjuryNatureSyncope                                                      8.028e+01
## InjuryNatureVascular                                                     5.347e+02
## InjuryNatureVision Loss                                                  3.300e+02
## BodyPartRegionLower Extremities                                         -3.448e+01
## BodyPartRegionMultiple Body Parts                                       -1.360e+02
## BodyPartRegionNeck                                                       2.575e+02
## BodyPartRegionNon-Standard Code                                         -6.245e+01
## BodyPartRegionTrunk                                                     -4.081e+01
## BodyPartRegionUpper Extremities                                          2.988e+00
## BodyPartAnkle                                                            4.310e+01
## BodyPartArtificial Appliance                                            -8.456e+01
## BodyPartBody Systems and Multiple Body Systems                           1.856e+02
## BodyPartBrain                                                           -1.551e+02
## BodyPartButtocks                                                        -6.382e+00
## BodyPartChest                                                            2.939e+01
## BodyPartDisc-Trunk                                                       7.679e+01
## BodyPartEar(S)                                                           4.154e+01
## BodyPartElbow                                                           -3.005e+01
## BodyPartEyes                                                            -1.517e+00
## BodyPartFacial Bones                                                    -4.456e+01
## BodyPartFinger(S)                                                       -1.188e+01
## BodyPartFoot                                                             7.458e+00
## BodyPartGreat Toe                                                        1.331e+01
## BodyPartHand                                                            -1.530e+01
## BodyPartHeart                                                            2.872e+02
## BodyPartHip                                                             -5.592e+00
## BodyPartInsufficient Info to Properly Identify?Unclassified              1.630e+02
## BodyPartInternal Organs                                                  7.742e+01
## BodyPartKnee                                                             2.101e+01
## BodyPartLarynx                                                           9.234e+00
## BodyPartLower Arm                                                       -1.929e+01
## BodyPartLower Back Area                                                  4.013e+01
## BodyPartLower Leg                                                        1.986e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              6.140e+01
## BodyPartLungs                                                            1.202e+02
## BodyPartMouth                                                            8.669e+01
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      2.031e+02
## BodyPartMultiple Head Injury                                             2.372e+01
## BodyPartMultiple Lower Extremities                                       3.527e+01
## BodyPartMultiple Neck Injury                                            -1.920e+02
## BodyPartMultiple Trunk                                                  -8.708e+00
## BodyPartMultiple Upper Extremities                                       5.480e+01
## BodyPartNo Physical Injury                                               2.204e+02
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                            -4.214e+01
## BodyPartPelvis                                                           1.303e+02
## BodyPartSacrum And Coccyx                                               -3.361e+00
## BodyPartShoulder(S)                                                     -1.720e+01
## BodyPartSkull                                                           -8.447e+01
## BodyPartSoft Tissue-Head                                                -1.051e+02
## BodyPartSoft Tissue-Neck                                                -3.112e+02
## BodyPartSpinal Cord-Trunk                                                3.762e+02
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                           -2.363e+01
## BodyPartToes                                                            -1.130e+01
## BodyPartTrachea                                                         -1.684e+02
## BodyPartUpper Arm                                                        3.219e+01
## BodyPartUpper Back Area                                                  5.333e+01
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## ClaimantAge_at_DOI                                                      -4.638e-02
##                                                                         Std. Error
## (Intercept)                                                              2.672e+02
## TotalIncurredCost                                                        1.165e-03
## GenderMale                                                               5.212e+00
## GenderNot Available                                                      3.026e+01
## ClaimantTypeMedical Only                                                 6.432e+00
## ClaimantTypeReport Only                                                  1.862e+02
## InjuryNatureAll Other Cumulative Injury, NOC                             2.789e+02
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.959e+02
## InjuryNatureAll Other Specific Injuries, Noc                             2.652e+02
## InjuryNatureAmputation                                                   3.051e+02
## InjuryNatureAsbestosis                                                   2.763e+02
## InjuryNatureAsphyxiation                                                 3.706e+02
## InjuryNatureBurn                                                         2.657e+02
## InjuryNatureCarpal Tunnel Syndrome                                       2.657e+02
## InjuryNatureConcussion                                                   2.667e+02
## InjuryNatureContagious Disease                                           2.708e+02
## InjuryNatureContusion                                                    2.648e+02
## InjuryNatureCrushing                                                     2.662e+02
## InjuryNatureDermatitis                                                   2.654e+02
## InjuryNatureDislocation                                                  2.671e+02
## InjuryNatureDust Disease, NOC                                            3.056e+02
## InjuryNatureElectric Shock                                               2.750e+02
## InjuryNatureForeign Body                                                 2.659e+02
## InjuryNatureFracture                                                     2.650e+02
## InjuryNatureFreezing                                                     3.727e+02
## InjuryNatureHearing Loss Or Impairment                                   2.883e+02
## InjuryNatureHeat Prostration                                             2.703e+02
## InjuryNatureHernia                                                       2.676e+02
## InjuryNatureInfection                                                    2.673e+02
## InjuryNatureInflammation                                                 2.656e+02
## InjuryNatureLaceration                                                   2.649e+02
## InjuryNatureLoss of Hearing                                              2.981e+02
## InjuryNatureMental Disorder                                              3.839e+02
## InjuryNatureMental Stress                                                2.678e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.763e+02
## InjuryNatureMultiple Physical Injuries Only                              2.650e+02
## InjuryNatureMyocardial Infarction                                        3.051e+02
## InjuryNatureNo Physical Injury                                           2.645e+02
## InjuryNatureNon-Standard Code                                            2.672e+02
## InjuryNatureNot Available                                                2.683e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.705e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.815e+02
## InjuryNaturePuncture                                                     2.651e+02
## InjuryNatureRadiation                                                    3.737e+02
## InjuryNatureRespiratory Disorders                                        2.669e+02
## InjuryNatureRupture                                                      2.721e+02
## InjuryNatureSeverance                                                    3.727e+02
## InjuryNatureSilicosis                                                    3.236e+02
## InjuryNatureSprain                                                       2.649e+02
## InjuryNatureStrain                                                       2.648e+02
## InjuryNatureSyncope                                                      2.723e+02
## InjuryNatureVascular                                                     3.052e+02
## InjuryNatureVision Loss                                                  2.861e+02
## BodyPartRegionLower Extremities                                          4.512e+01
## BodyPartRegionMultiple Body Parts                                        9.984e+01
## BodyPartRegionNeck                                                       1.226e+02
## BodyPartRegionNon-Standard Code                                          4.915e+01
## BodyPartRegionTrunk                                                      4.269e+01
## BodyPartRegionUpper Extremities                                          3.815e+01
## BodyPartAnkle                                                            2.934e+01
## BodyPartArtificial Appliance                                             2.783e+02
## BodyPartBody Systems and Multiple Body Systems                           1.044e+02
## BodyPartBrain                                                            1.019e+02
## BodyPartButtocks                                                         4.126e+01
## BodyPartChest                                                            2.972e+01
## BodyPartDisc-Trunk                                                       4.356e+01
## BodyPartEar(S)                                                           5.379e+01
## BodyPartElbow                                                            2.182e+01
## BodyPartEyes                                                             4.051e+01
## BodyPartFacial Bones                                                     4.813e+01
## BodyPartFinger(S)                                                        1.624e+01
## BodyPartFoot                                                             2.993e+01
## BodyPartGreat Toe                                                        5.663e+01
## BodyPartHand                                                             1.592e+01
## BodyPartHeart                                                            1.359e+02
## BodyPartHip                                                              3.496e+01
## BodyPartInsufficient Info to Properly Identify?Unclassified              1.015e+02
## BodyPartInternal Organs                                                  6.118e+01
## BodyPartKnee                                                             2.826e+01
## BodyPartLarynx                                                           1.762e+02
## BodyPartLower Arm                                                        1.974e+01
## BodyPartLower Back Area                                                  2.425e+01
## BodyPartLower Leg                                                        3.111e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              3.268e+01
## BodyPartLungs                                                            4.864e+01
## BodyPartMouth                                                            5.424e+01
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      9.358e+01
## BodyPartMultiple Head Injury                                             4.014e+01
## BodyPartMultiple Lower Extremities                                       4.012e+01
## BodyPartMultiple Neck Injury                                             1.188e+02
## BodyPartMultiple Trunk                                                   5.992e+01
## BodyPartMultiple Upper Extremities                                       3.077e+01
## BodyPartNo Physical Injury                                               9.981e+01
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             5.220e+01
## BodyPartPelvis                                                           6.703e+01
## BodyPartSacrum And Coccyx                                                9.047e+01
## BodyPartShoulder(S)                                                      1.688e+01
## BodyPartSkull                                                            4.793e+01
## BodyPartSoft Tissue-Head                                                 4.362e+01
## BodyPartSoft Tissue-Neck                                                 1.181e+02
## BodyPartSpinal Cord-Trunk                                                6.950e+01
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            2.158e+01
## BodyPartToes                                                             4.149e+01
## BodyPartTrachea                                                          2.201e+02
## BodyPartUpper Arm                                                        2.750e+01
## BodyPartUpper Back Area                                                  3.583e+01
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## ClaimantAge_at_DOI                                                       2.093e-02
##                                                                         t value
## (Intercept)                                                               0.207
## TotalIncurredCost                                                        26.767
## GenderMale                                                                4.035
## GenderNot Available                                                       0.783
## ClaimantTypeMedical Only                                                -15.114
## ClaimantTypeReport Only                                                  -0.631
## InjuryNatureAll Other Cumulative Injury, NOC                              0.577
## InjuryNatureAll Other Occupational Disease Injury, NOC                    1.003
## InjuryNatureAll Other Specific Injuries, Noc                              0.964
## InjuryNatureAmputation                                                   -0.134
## InjuryNatureAsbestosis                                                    0.502
## InjuryNatureAsphyxiation                                                  0.311
## InjuryNatureBurn                                                          0.805
## InjuryNatureCarpal Tunnel Syndrome                                        1.108
## InjuryNatureConcussion                                                    0.592
## InjuryNatureContagious Disease                                            0.629
## InjuryNatureContusion                                                     0.928
## InjuryNatureCrushing                                                      0.546
## InjuryNatureDermatitis                                                    0.628
## InjuryNatureDislocation                                                   0.980
## InjuryNatureDust Disease, NOC                                             1.205
## InjuryNatureElectric Shock                                                0.719
## InjuryNatureForeign Body                                                  0.828
## InjuryNatureFracture                                                      0.799
## InjuryNatureFreezing                                                      0.295
## InjuryNatureHearing Loss Or Impairment                                    0.431
## InjuryNatureHeat Prostration                                              0.271
## InjuryNatureHernia                                                        0.443
## InjuryNatureInfection                                                     0.799
## InjuryNatureInflammation                                                  0.690
## InjuryNatureLaceration                                                    0.837
## InjuryNatureLoss of Hearing                                               0.217
## InjuryNatureMental Disorder                                               0.545
## InjuryNatureMental Stress                                                 1.200
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.182
## InjuryNatureMultiple Physical Injuries Only                               0.781
## InjuryNatureMyocardial Infarction                                        -0.316
## InjuryNatureNo Physical Injury                                            0.679
## InjuryNatureNon-Standard Code                                             0.891
## InjuryNatureNot Available                                                 0.510
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.675
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.752
## InjuryNaturePuncture                                                      0.857
## InjuryNatureRadiation                                                     0.097
## InjuryNatureRespiratory Disorders                                         0.752
## InjuryNatureRupture                                                       0.320
## InjuryNatureSeverance                                                     0.262
## InjuryNatureSilicosis                                                     0.854
## InjuryNatureSprain                                                        0.721
## InjuryNatureStrain                                                        0.871
## InjuryNatureSyncope                                                       0.295
## InjuryNatureVascular                                                      1.752
## InjuryNatureVision Loss                                                   1.153
## BodyPartRegionLower Extremities                                          -0.764
## BodyPartRegionMultiple Body Parts                                        -1.362
## BodyPartRegionNeck                                                        2.100
## BodyPartRegionNon-Standard Code                                          -1.271
## BodyPartRegionTrunk                                                      -0.956
## BodyPartRegionUpper Extremities                                           0.078
## BodyPartAnkle                                                             1.469
## BodyPartArtificial Appliance                                             -0.304
## BodyPartBody Systems and Multiple Body Systems                            1.777
## BodyPartBrain                                                            -1.522
## BodyPartButtocks                                                         -0.155
## BodyPartChest                                                             0.989
## BodyPartDisc-Trunk                                                        1.763
## BodyPartEar(S)                                                            0.772
## BodyPartElbow                                                            -1.377
## BodyPartEyes                                                             -0.037
## BodyPartFacial Bones                                                     -0.926
## BodyPartFinger(S)                                                        -0.732
## BodyPartFoot                                                              0.249
## BodyPartGreat Toe                                                         0.235
## BodyPartHand                                                             -0.961
## BodyPartHeart                                                             2.113
## BodyPartHip                                                              -0.160
## BodyPartInsufficient Info to Properly Identify?Unclassified               1.606
## BodyPartInternal Organs                                                   1.265
## BodyPartKnee                                                              0.744
## BodyPartLarynx                                                            0.052
## BodyPartLower Arm                                                        -0.977
## BodyPartLower Back Area                                                   1.655
## BodyPartLower Leg                                                         0.638
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               1.879
## BodyPartLungs                                                             2.470
## BodyPartMouth                                                             1.598
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)       2.171
## BodyPartMultiple Head Injury                                              0.591
## BodyPartMultiple Lower Extremities                                        0.879
## BodyPartMultiple Neck Injury                                             -1.617
## BodyPartMultiple Trunk                                                   -0.145
## BodyPartMultiple Upper Extremities                                        1.781
## BodyPartNo Physical Injury                                                2.208
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                             -0.807
## BodyPartPelvis                                                            1.944
## BodyPartSacrum And Coccyx                                                -0.037
## BodyPartShoulder(S)                                                      -1.019
## BodyPartSkull                                                            -1.762
## BodyPartSoft Tissue-Head                                                 -2.410
## BodyPartSoft Tissue-Neck                                                 -2.635
## BodyPartSpinal Cord-Trunk                                                 5.412
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                            -1.095
## BodyPartToes                                                             -0.272
## BodyPartTrachea                                                          -0.765
## BodyPartUpper Arm                                                         1.171
## BodyPartUpper Back Area                                                   1.488
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## ClaimantAge_at_DOI                                                       -2.216
##                                                                         Pr(>|t|)
## (Intercept)                                                              0.83602
## TotalIncurredCost                                                        < 2e-16
## GenderMale                                                              5.50e-05
## GenderNot Available                                                      0.43369
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                  0.52803
## InjuryNatureAll Other Cumulative Injury, NOC                             0.56414
## InjuryNatureAll Other Occupational Disease Injury, NOC                   0.31580
## InjuryNatureAll Other Specific Injuries, Noc                             0.33514
## InjuryNatureAmputation                                                   0.89371
## InjuryNatureAsbestosis                                                   0.61564
## InjuryNatureAsphyxiation                                                 0.75584
## InjuryNatureBurn                                                         0.42068
## InjuryNatureCarpal Tunnel Syndrome                                       0.26794
## InjuryNatureConcussion                                                   0.55355
## InjuryNatureContagious Disease                                           0.52964
## InjuryNatureContusion                                                    0.35344
## InjuryNatureCrushing                                                     0.58530
## InjuryNatureDermatitis                                                   0.53031
## InjuryNatureDislocation                                                  0.32733
## InjuryNatureDust Disease, NOC                                            0.22811
## InjuryNatureElectric Shock                                               0.47227
## InjuryNatureForeign Body                                                 0.40789
## InjuryNatureFracture                                                     0.42408
## InjuryNatureFreezing                                                     0.76837
## InjuryNatureHearing Loss Or Impairment                                   0.66619
## InjuryNatureHeat Prostration                                             0.78603
## InjuryNatureHernia                                                       0.65798
## InjuryNatureInfection                                                    0.42404
## InjuryNatureInflammation                                                 0.49013
## InjuryNatureLaceration                                                   0.40235
## InjuryNatureLoss of Hearing                                              0.82810
## InjuryNatureMental Disorder                                              0.58610
## InjuryNatureMental Stress                                                0.23013
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  0.85581
## InjuryNatureMultiple Physical Injuries Only                              0.43493
## InjuryNatureMyocardial Infarction                                        0.75165
## InjuryNatureNo Physical Injury                                           0.49716
## InjuryNatureNon-Standard Code                                            0.37304
## InjuryNatureNot Available                                                0.61011
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       0.49996
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              0.45236
## InjuryNaturePuncture                                                     0.39135
## InjuryNatureRadiation                                                    0.92296
## InjuryNatureRespiratory Disorders                                        0.45232
## InjuryNatureRupture                                                      0.74920
## InjuryNatureSeverance                                                    0.79349
## InjuryNatureSilicosis                                                    0.39315
## InjuryNatureSprain                                                       0.47093
## InjuryNatureStrain                                                       0.38386
## InjuryNatureSyncope                                                      0.76812
## InjuryNatureVascular                                                     0.07983
## InjuryNatureVision Loss                                                  0.24881
## BodyPartRegionLower Extremities                                          0.44477
## BodyPartRegionMultiple Body Parts                                        0.17322
## BodyPartRegionNeck                                                       0.03577
## BodyPartRegionNon-Standard Code                                          0.20389
## BodyPartRegionTrunk                                                      0.33908
## BodyPartRegionUpper Extremities                                          0.93758
## BodyPartAnkle                                                            0.14186
## BodyPartArtificial Appliance                                             0.76124
## BodyPartBody Systems and Multiple Body Systems                           0.07560
## BodyPartBrain                                                            0.12807
## BodyPartButtocks                                                         0.87709
## BodyPartChest                                                            0.32261
## BodyPartDisc-Trunk                                                       0.07797
## BodyPartEar(S)                                                           0.43998
## BodyPartElbow                                                            0.16839
## BodyPartEyes                                                             0.97013
## BodyPartFacial Bones                                                     0.35456
## BodyPartFinger(S)                                                        0.46444
## BodyPartFoot                                                             0.80323
## BodyPartGreat Toe                                                        0.81419
## BodyPartHand                                                             0.33657
## BodyPartHeart                                                            0.03462
## BodyPartHip                                                              0.87292
## BodyPartInsufficient Info to Properly Identify?Unclassified              0.10835
## BodyPartInternal Organs                                                  0.20578
## BodyPartKnee                                                             0.45714
## BodyPartLarynx                                                           0.95821
## BodyPartLower Arm                                                        0.32843
## BodyPartLower Back Area                                                  0.09803
## BodyPartLower Leg                                                        0.52336
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              0.06031
## BodyPartLungs                                                            0.01352
## BodyPartMouth                                                            0.11000
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      0.02997
## BodyPartMultiple Head Injury                                             0.55463
## BodyPartMultiple Lower Extremities                                       0.37935
## BodyPartMultiple Neck Injury                                             0.10599
## BodyPartMultiple Trunk                                                   0.88445
## BodyPartMultiple Upper Extremities                                       0.07495
## BodyPartNo Physical Injury                                               0.02726
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                             0.41950
## BodyPartPelvis                                                           0.05188
## BodyPartSacrum And Coccyx                                                0.97036
## BodyPartShoulder(S)                                                      0.30820
## BodyPartSkull                                                            0.07807
## BodyPartSoft Tissue-Head                                                 0.01596
## BodyPartSoft Tissue-Neck                                                 0.00842
## BodyPartSpinal Cord-Trunk                                               6.36e-08
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                            0.27370
## BodyPartToes                                                             0.78537
## BodyPartTrachea                                                          0.44417
## BodyPartUpper Arm                                                        0.24179
## BodyPartUpper Back Area                                                  0.13669
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## ClaimantAge_at_DOI                                                       0.02673
##                                                                            
## (Intercept)                                                                
## TotalIncurredCost                                                       ***
## GenderMale                                                              ***
## GenderNot Available                                                        
## ClaimantTypeMedical Only                                                ***
## ClaimantTypeReport Only                                                    
## InjuryNatureAll Other Cumulative Injury, NOC                               
## InjuryNatureAll Other Occupational Disease Injury, NOC                     
## InjuryNatureAll Other Specific Injuries, Noc                               
## InjuryNatureAmputation                                                     
## InjuryNatureAsbestosis                                                     
## InjuryNatureAsphyxiation                                                   
## InjuryNatureBurn                                                           
## InjuryNatureCarpal Tunnel Syndrome                                         
## InjuryNatureConcussion                                                     
## InjuryNatureContagious Disease                                             
## InjuryNatureContusion                                                      
## InjuryNatureCrushing                                                       
## InjuryNatureDermatitis                                                     
## InjuryNatureDislocation                                                    
## InjuryNatureDust Disease, NOC                                              
## InjuryNatureElectric Shock                                                 
## InjuryNatureForeign Body                                                   
## InjuryNatureFracture                                                       
## InjuryNatureFreezing                                                       
## InjuryNatureHearing Loss Or Impairment                                     
## InjuryNatureHeat Prostration                                               
## InjuryNatureHernia                                                         
## InjuryNatureInfection                                                      
## InjuryNatureInflammation                                                   
## InjuryNatureLaceration                                                     
## InjuryNatureLoss of Hearing                                                
## InjuryNatureMental Disorder                                                
## InjuryNatureMental Stress                                                  
## InjuryNatureMultiple Injuries Including Both Physical and Psychological    
## InjuryNatureMultiple Physical Injuries Only                                
## InjuryNatureMyocardial Infarction                                          
## InjuryNatureNo Physical Injury                                             
## InjuryNatureNon-Standard Code                                              
## InjuryNatureNot Available                                                  
## InjuryNaturePoisoning?Chemical (Other Than Metals)                         
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)                
## InjuryNaturePuncture                                                       
## InjuryNatureRadiation                                                      
## InjuryNatureRespiratory Disorders                                          
## InjuryNatureRupture                                                        
## InjuryNatureSeverance                                                      
## InjuryNatureSilicosis                                                      
## InjuryNatureSprain                                                         
## InjuryNatureStrain                                                         
## InjuryNatureSyncope                                                        
## InjuryNatureVascular                                                    .  
## InjuryNatureVision Loss                                                    
## BodyPartRegionLower Extremities                                            
## BodyPartRegionMultiple Body Parts                                          
## BodyPartRegionNeck                                                      *  
## BodyPartRegionNon-Standard Code                                            
## BodyPartRegionTrunk                                                        
## BodyPartRegionUpper Extremities                                            
## BodyPartAnkle                                                              
## BodyPartArtificial Appliance                                               
## BodyPartBody Systems and Multiple Body Systems                          .  
## BodyPartBrain                                                              
## BodyPartButtocks                                                           
## BodyPartChest                                                              
## BodyPartDisc-Trunk                                                      .  
## BodyPartEar(S)                                                             
## BodyPartElbow                                                              
## BodyPartEyes                                                               
## BodyPartFacial Bones                                                       
## BodyPartFinger(S)                                                          
## BodyPartFoot                                                               
## BodyPartGreat Toe                                                          
## BodyPartHand                                                               
## BodyPartHeart                                                           *  
## BodyPartHip                                                                
## BodyPartInsufficient Info to Properly Identify?Unclassified                
## BodyPartInternal Organs                                                    
## BodyPartKnee                                                               
## BodyPartLarynx                                                             
## BodyPartLower Arm                                                          
## BodyPartLower Back Area                                                 .  
## BodyPartLower Leg                                                          
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             .  
## BodyPartLungs                                                           *  
## BodyPartMouth                                                              
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     *  
## BodyPartMultiple Head Injury                                               
## BodyPartMultiple Lower Extremities                                         
## BodyPartMultiple Neck Injury                                               
## BodyPartMultiple Trunk                                                     
## BodyPartMultiple Upper Extremities                                      .  
## BodyPartNo Physical Injury                                              *  
## BodyPartNon-Standard Code                                                  
## BodyPartNose                                                               
## BodyPartPelvis                                                          .  
## BodyPartSacrum And Coccyx                                                  
## BodyPartShoulder(S)                                                        
## BodyPartSkull                                                           .  
## BodyPartSoft Tissue-Head                                                *  
## BodyPartSoft Tissue-Neck                                                ** 
## BodyPartSpinal Cord-Trunk                                               ***
## BodyPartTeeth                                                              
## BodyPartThumb                                                              
## BodyPartToes                                                               
## BodyPartTrachea                                                            
## BodyPartUpper Arm                                                          
## BodyPartUpper Back Area                                                    
## BodyPartUpper Leg                                                          
## BodyPartVertebrae                                                          
## BodyPartWhole Body                                                         
## BodyPartWrist                                                              
## ClaimantAge_at_DOI                                                      *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 262.1 on 10914 degrees of freedom
## Multiple R-squared:  0.1886, Adjusted R-squared:  0.1807 
## F-statistic: 23.93 on 106 and 10914 DF,  p-value: < 2.2e-16

Se observa que al ajustar el modelo de regresión considerando solo las variables que resultaron significativas en el primer caso, el r cuadrado disminuye ligeramente.

Construcción de un modelo predictivo

# Construir un modelo predictivo a partir del primer modelo de regresión obtenido. Se utilizará el renglón 10,000 de la base de datos 
bd3[8000, ] # se observa el renglón 10,000 de la base de datos
##        TiempoDeProcesamiento TotalIncurredCost TotalPaid TotalReserves
## 115211                   293           3126.87   3126.87             0
##        TotalRecovery IndemnityPaid AverageWeeklyWage OtherPaid
## 115211             0             0               500   3126.87
##        ClaimantAge_at_DOI ClaimStatus Gender ClaimantType InjuryNature
## 115211                 44           C Female Medical Only       Strain
##        BodyPartRegion        BodyPart IsDenied  ClaimID GroupInjury
## 115211          Trunk Lower Back Area        0 18369571      Strain
##        GroupBodyPart GroupBodyPR ClaimantOpenedDate ClaimantClosedDate
## 115211        Others      Others         2011-07-21         2012-05-09
# Se realiza la predicción
prediccióntiempo <- data.frame(TotalIncurredCost = 3126.87, Gender ="Female", InjuryNature = "Strain", BodyPartRegion = "Trunk", BodyPart ="Lower Back Area", ClaimantType = "Medical Only", ClaimantAge_at_DOI = 44)
predict(regresiontp, prediccióntiempo)
##        1 
## 283.4904

La diferencia respecto a los días estimados y los días reales es de 10 días.

TotalIncurredCost

Creación del modelo de regresión

# Se crea el modelo de regresión 
regresiontic <- lm(TotalIncurredCost ~ TiempoDeProcesamiento + AverageWeeklyWage + ClaimantAge_at_DOI + Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + IsDenied + GroupInjury + GroupBodyPart + GroupBodyPR, data = bd3)
summary(regresiontic)
## 
## Call:
## lm(formula = TotalIncurredCost ~ TiempoDeProcesamiento + AverageWeeklyWage + 
##     ClaimantAge_at_DOI + Gender + ClaimantType + InjuryNature + 
##     BodyPartRegion + BodyPart + IsDenied + GroupInjury + GroupBodyPart + 
##     GroupBodyPR, data = bd3)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5695.9  -835.1  -252.8   479.4 10453.1 
## 
## Coefficients: (12 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                              2.368e+03
## TiempoDeProcesamiento                                                    1.949e+00
## AverageWeeklyWage                                                        3.827e-04
## ClaimantAge_at_DOI                                                       6.561e-02
## GenderMale                                                              -4.608e+01
## GenderNot Available                                                     -8.838e+00
## ClaimantTypeMedical Only                                                -2.560e+03
## ClaimantTypeReport Only                                                 -3.053e+03
## InjuryNatureAll Other Cumulative Injury, NOC                             3.968e+00
## InjuryNatureAll Other Occupational Disease Injury, NOC                  -1.083e+03
## InjuryNatureAll Other Specific Injuries, Noc                            -3.863e+01
## InjuryNatureAmputation                                                   4.085e+03
## InjuryNatureAsbestosis                                                  -2.394e+02
## InjuryNatureAsphyxiation                                                -1.699e+02
## InjuryNatureBurn                                                        -1.334e+02
## InjuryNatureCarpal Tunnel Syndrome                                       5.330e+02
## InjuryNatureConcussion                                                   1.011e+03
## InjuryNatureContagious Disease                                          -2.465e+02
## InjuryNatureContusion                                                    1.451e+02
## InjuryNatureCrushing                                                     4.339e+02
## InjuryNatureDermatitis                                                  -2.264e+02
## InjuryNatureDislocation                                                  5.780e+02
## InjuryNatureDust Disease, NOC                                           -6.814e+02
## InjuryNatureElectric Shock                                               1.278e+03
## InjuryNatureForeign Body                                                 1.192e+02
## InjuryNatureFracture                                                     9.631e+02
## InjuryNatureFreezing                                                     2.602e+02
## InjuryNatureHearing Loss Or Impairment                                   1.425e+03
## InjuryNatureHeat Prostration                                             1.087e+03
## InjuryNatureHernia                                                       1.534e+03
## InjuryNatureInfection                                                   -6.682e+00
## InjuryNatureInflammation                                                 2.991e+02
## InjuryNatureLaceration                                                   2.530e+02
## InjuryNatureLoss of Hearing                                              3.358e+03
## InjuryNatureMental Disorder                                             -3.225e+03
## InjuryNatureMental Stress                                               -5.799e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.031e+03
## InjuryNatureMultiple Physical Injuries Only                              4.241e+02
## InjuryNatureMyocardial Infarction                                       -1.759e+02
## InjuryNatureNo Physical Injury                                           2.358e+02
## InjuryNatureNon-Standard Code                                            3.818e+02
## InjuryNatureNot Available                                                3.041e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.180e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              5.079e+02
## InjuryNaturePuncture                                                     4.354e+01
## InjuryNatureRadiation                                                    8.553e+03
## InjuryNatureRespiratory Disorders                                       -7.248e+01
## InjuryNatureRupture                                                      1.803e+03
## InjuryNatureSeverance                                                    3.752e+03
## InjuryNatureSilicosis                                                   -2.957e+02
## InjuryNatureSprain                                                       2.805e+02
## InjuryNatureStrain                                                       3.584e+02
## InjuryNatureSyncope                                                      1.369e+03
## InjuryNatureVascular                                                    -9.433e+02
## InjuryNatureVision Loss                                                 -6.270e+02
## BodyPartRegionLower Extremities                                          1.521e+02
## BodyPartRegionMultiple Body Parts                                        1.936e+03
## BodyPartRegionNeck                                                      -9.652e+02
## BodyPartRegionNon-Standard Code                                          3.577e+02
## BodyPartRegionTrunk                                                      7.883e+02
## BodyPartRegionUpper Extremities                                          3.687e+02
## BodyPartAnkle                                                            2.136e+02
## BodyPartArtificial Appliance                                             2.209e+02
## BodyPartBody Systems and Multiple Body Systems                          -1.481e+03
## BodyPartBrain                                                            7.641e+02
## BodyPartButtocks                                                        -4.089e+02
## BodyPartChest                                                           -8.800e+02
## BodyPartDisc-Trunk                                                       3.934e+02
## BodyPartEar(S)                                                          -3.441e+02
## BodyPartElbow                                                           -6.333e+01
## BodyPartEyes                                                             1.679e+02
## BodyPartFacial Bones                                                     4.281e+02
## BodyPartFinger(S)                                                       -1.463e+02
## BodyPartFoot                                                            -2.054e+02
## BodyPartGreat Toe                                                       -1.106e+03
## BodyPartHand                                                            -4.685e+01
## BodyPartHeart                                                           -1.275e+03
## BodyPartHip                                                              7.977e+01
## BodyPartInsufficient Info to Properly Identify?Unclassified             -1.411e+03
## BodyPartInternal Organs                                                 -7.089e+02
## BodyPartKnee                                                             3.438e+02
## BodyPartLarynx                                                           6.121e+02
## BodyPartLower Arm                                                        3.744e+01
## BodyPartLower Back Area                                                 -5.207e+02
## BodyPartLower Leg                                                        2.298e+02
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             -1.177e+03
## BodyPartLungs                                                           -4.667e+02
## BodyPartMouth                                                            3.905e+02
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     -1.686e+03
## BodyPartMultiple Head Injury                                             2.736e+02
## BodyPartMultiple Lower Extremities                                       5.782e+02
## BodyPartMultiple Neck Injury                                             1.069e+03
## BodyPartMultiple Trunk                                                   2.449e+02
## BodyPartMultiple Upper Extremities                                      -2.356e+02
## BodyPartNo Physical Injury                                              -1.741e+03
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             7.381e+02
## BodyPartPelvis                                                           2.724e+02
## BodyPartSacrum And Coccyx                                                4.502e+02
## BodyPartShoulder(S)                                                      4.552e+01
## BodyPartSkull                                                            7.332e+02
## BodyPartSoft Tissue-Head                                                 6.569e+02
## BodyPartSoft Tissue-Neck                                                 1.187e+03
## BodyPartSpinal Cord-Trunk                                               -1.241e+03
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            1.657e+01
## BodyPartToes                                                            -4.251e+02
## BodyPartTrachea                                                          8.790e+02
## BodyPartUpper Arm                                                       -1.191e+02
## BodyPartUpper Back Area                                                 -3.364e+02
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                -9.248e+02
## GroupInjuryOthers                                                               NA
## GroupInjuryStrain                                                               NA
## GroupBodyPartMultiple Body Parts                                                NA
## GroupBodyPartOthers                                                             NA
## GroupBodyPROthers                                                               NA
## GroupBodyPRUpper Extremities                                                    NA
##                                                                         Std. Error
## (Intercept)                                                              2.113e+03
## TiempoDeProcesamiento                                                    7.334e-02
## AverageWeeklyWage                                                        8.489e-04
## ClaimantAge_at_DOI                                                       1.655e-01
## GenderMale                                                               4.125e+01
## GenderNot Available                                                      2.393e+02
## ClaimantTypeMedical Only                                                 4.551e+01
## ClaimantTypeReport Only                                                  1.472e+03
## InjuryNatureAll Other Cumulative Injury, NOC                             2.205e+03
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.339e+03
## InjuryNatureAll Other Specific Injuries, Noc                             2.097e+03
## InjuryNatureAmputation                                                   2.412e+03
## InjuryNatureAsbestosis                                                   2.184e+03
## InjuryNatureAsphyxiation                                                 2.930e+03
## InjuryNatureBurn                                                         2.101e+03
## InjuryNatureCarpal Tunnel Syndrome                                       2.101e+03
## InjuryNatureConcussion                                                   2.108e+03
## InjuryNatureContagious Disease                                           2.141e+03
## InjuryNatureContusion                                                    2.094e+03
## InjuryNatureCrushing                                                     2.105e+03
## InjuryNatureDermatitis                                                   2.098e+03
## InjuryNatureDislocation                                                  2.111e+03
## InjuryNatureDust Disease, NOC                                            2.416e+03
## InjuryNatureElectric Shock                                               2.174e+03
## InjuryNatureForeign Body                                                 2.102e+03
## InjuryNatureFracture                                                     2.095e+03
## InjuryNatureFreezing                                                     2.947e+03
## InjuryNatureHearing Loss Or Impairment                                   2.279e+03
## InjuryNatureHeat Prostration                                             2.137e+03
## InjuryNatureHernia                                                       2.116e+03
## InjuryNatureInfection                                                    2.113e+03
## InjuryNatureInflammation                                                 2.100e+03
## InjuryNatureLaceration                                                   2.095e+03
## InjuryNatureLoss of Hearing                                              2.356e+03
## InjuryNatureMental Disorder                                              3.035e+03
## InjuryNatureMental Stress                                                2.118e+03
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.184e+03
## InjuryNatureMultiple Physical Injuries Only                              2.095e+03
## InjuryNatureMyocardial Infarction                                        2.413e+03
## InjuryNatureNo Physical Injury                                           2.092e+03
## InjuryNatureNon-Standard Code                                            2.113e+03
## InjuryNatureNot Available                                                2.121e+03
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.139e+03
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.226e+03
## InjuryNaturePuncture                                                     2.096e+03
## InjuryNatureRadiation                                                    2.953e+03
## InjuryNatureRespiratory Disorders                                        2.110e+03
## InjuryNatureRupture                                                      2.151e+03
## InjuryNatureSeverance                                                    2.946e+03
## InjuryNatureSilicosis                                                    2.558e+03
## InjuryNatureSprain                                                       2.094e+03
## InjuryNatureStrain                                                       2.094e+03
## InjuryNatureSyncope                                                      2.153e+03
## InjuryNatureVascular                                                     2.413e+03
## InjuryNatureVision Loss                                                  2.262e+03
## BodyPartRegionLower Extremities                                          3.581e+02
## BodyPartRegionMultiple Body Parts                                        7.898e+02
## BodyPartRegionNeck                                                       9.704e+02
## BodyPartRegionNon-Standard Code                                          3.898e+02
## BodyPartRegionTrunk                                                      3.389e+02
## BodyPartRegionUpper Extremities                                          3.032e+02
## BodyPartAnkle                                                            2.321e+02
## BodyPartArtificial Appliance                                             2.200e+03
## BodyPartBody Systems and Multiple Body Systems                           8.256e+02
## BodyPartBrain                                                            8.062e+02
## BodyPartButtocks                                                         3.262e+02
## BodyPartChest                                                            2.348e+02
## BodyPartDisc-Trunk                                                       3.445e+02
## BodyPartEar(S)                                                           4.264e+02
## BodyPartElbow                                                            1.725e+02
## BodyPartEyes                                                             3.217e+02
## BodyPartFacial Bones                                                     3.818e+02
## BodyPartFinger(S)                                                        1.284e+02
## BodyPartFoot                                                             2.367e+02
## BodyPartGreat Toe                                                        4.477e+02
## BodyPartHand                                                             1.259e+02
## BodyPartHeart                                                            1.075e+03
## BodyPartHip                                                              2.764e+02
## BodyPartInsufficient Info to Properly Identify?Unclassified              8.026e+02
## BodyPartInternal Organs                                                  4.838e+02
## BodyPartKnee                                                             2.234e+02
## BodyPartLarynx                                                           1.393e+03
## BodyPartLower Arm                                                        1.561e+02
## BodyPartLower Back Area                                                  1.918e+02
## BodyPartLower Leg                                                        2.460e+02
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              2.582e+02
## BodyPartLungs                                                            3.847e+02
## BodyPartMouth                                                            4.300e+02
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      7.398e+02
## BodyPartMultiple Head Injury                                             3.188e+02
## BodyPartMultiple Lower Extremities                                       3.171e+02
## BodyPartMultiple Neck Injury                                             9.390e+02
## BodyPartMultiple Trunk                                                   4.738e+02
## BodyPartMultiple Upper Extremities                                       2.433e+02
## BodyPartNo Physical Injury                                               7.891e+02
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             4.137e+02
## BodyPartPelvis                                                           5.301e+02
## BodyPartSacrum And Coccyx                                                7.152e+02
## BodyPartShoulder(S)                                                      1.336e+02
## BodyPartSkull                                                            3.802e+02
## BodyPartSoft Tissue-Head                                                 3.463e+02
## BodyPartSoft Tissue-Neck                                                 9.340e+02
## BodyPartSpinal Cord-Trunk                                                5.501e+02
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            1.707e+02
## BodyPartToes                                                             3.281e+02
## BodyPartTrachea                                                          1.740e+03
## BodyPartUpper Arm                                                        2.175e+02
## BodyPartUpper Back Area                                                  2.834e+02
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                 7.684e+01
## GroupInjuryOthers                                                               NA
## GroupInjuryStrain                                                               NA
## GroupBodyPartMultiple Body Parts                                                NA
## GroupBodyPartOthers                                                             NA
## GroupBodyPROthers                                                               NA
## GroupBodyPRUpper Extremities                                                    NA
##                                                                         t value
## (Intercept)                                                               1.121
## TiempoDeProcesamiento                                                    26.573
## AverageWeeklyWage                                                         0.451
## ClaimantAge_at_DOI                                                        0.396
## GenderMale                                                               -1.117
## GenderNot Available                                                      -0.037
## ClaimantTypeMedical Only                                                -56.251
## ClaimantTypeReport Only                                                  -2.074
## InjuryNatureAll Other Cumulative Injury, NOC                              0.002
## InjuryNatureAll Other Occupational Disease Injury, NOC                   -0.463
## InjuryNatureAll Other Specific Injuries, Noc                             -0.018
## InjuryNatureAmputation                                                    1.694
## InjuryNatureAsbestosis                                                   -0.110
## InjuryNatureAsphyxiation                                                 -0.058
## InjuryNatureBurn                                                         -0.064
## InjuryNatureCarpal Tunnel Syndrome                                        0.254
## InjuryNatureConcussion                                                    0.479
## InjuryNatureContagious Disease                                           -0.115
## InjuryNatureContusion                                                     0.069
## InjuryNatureCrushing                                                      0.206
## InjuryNatureDermatitis                                                   -0.108
## InjuryNatureDislocation                                                   0.274
## InjuryNatureDust Disease, NOC                                            -0.282
## InjuryNatureElectric Shock                                                0.588
## InjuryNatureForeign Body                                                  0.057
## InjuryNatureFracture                                                      0.460
## InjuryNatureFreezing                                                      0.088
## InjuryNatureHearing Loss Or Impairment                                    0.625
## InjuryNatureHeat Prostration                                              0.508
## InjuryNatureHernia                                                        0.725
## InjuryNatureInfection                                                    -0.003
## InjuryNatureInflammation                                                  0.142
## InjuryNatureLaceration                                                    0.121
## InjuryNatureLoss of Hearing                                               1.425
## InjuryNatureMental Disorder                                              -1.062
## InjuryNatureMental Stress                                                -0.274
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.930
## InjuryNatureMultiple Physical Injuries Only                               0.202
## InjuryNatureMyocardial Infarction                                        -0.073
## InjuryNatureNo Physical Injury                                            0.113
## InjuryNatureNon-Standard Code                                             0.181
## InjuryNatureNot Available                                                 0.143
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.102
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.228
## InjuryNaturePuncture                                                      0.021
## InjuryNatureRadiation                                                     2.896
## InjuryNatureRespiratory Disorders                                        -0.034
## InjuryNatureRupture                                                       0.838
## InjuryNatureSeverance                                                     1.274
## InjuryNatureSilicosis                                                    -0.116
## InjuryNatureSprain                                                        0.134
## InjuryNatureStrain                                                        0.171
## InjuryNatureSyncope                                                       0.636
## InjuryNatureVascular                                                     -0.391
## InjuryNatureVision Loss                                                  -0.277
## BodyPartRegionLower Extremities                                           0.425
## BodyPartRegionMultiple Body Parts                                         2.451
## BodyPartRegionNeck                                                       -0.995
## BodyPartRegionNon-Standard Code                                           0.918
## BodyPartRegionTrunk                                                       2.326
## BodyPartRegionUpper Extremities                                           1.216
## BodyPartAnkle                                                             0.920
## BodyPartArtificial Appliance                                              0.100
## BodyPartBody Systems and Multiple Body Systems                           -1.794
## BodyPartBrain                                                             0.948
## BodyPartButtocks                                                         -1.254
## BodyPartChest                                                            -3.748
## BodyPartDisc-Trunk                                                        1.142
## BodyPartEar(S)                                                           -0.807
## BodyPartElbow                                                            -0.367
## BodyPartEyes                                                              0.522
## BodyPartFacial Bones                                                      1.121
## BodyPartFinger(S)                                                        -1.140
## BodyPartFoot                                                             -0.868
## BodyPartGreat Toe                                                        -2.470
## BodyPartHand                                                             -0.372
## BodyPartHeart                                                            -1.186
## BodyPartHip                                                               0.289
## BodyPartInsufficient Info to Properly Identify?Unclassified              -1.758
## BodyPartInternal Organs                                                  -1.465
## BodyPartKnee                                                              1.539
## BodyPartLarynx                                                            0.439
## BodyPartLower Arm                                                         0.240
## BodyPartLower Back Area                                                  -2.715
## BodyPartLower Leg                                                         0.934
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              -4.558
## BodyPartLungs                                                            -1.213
## BodyPartMouth                                                             0.908
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      -2.280
## BodyPartMultiple Head Injury                                              0.858
## BodyPartMultiple Lower Extremities                                        1.823
## BodyPartMultiple Neck Injury                                              1.138
## BodyPartMultiple Trunk                                                    0.517
## BodyPartMultiple Upper Extremities                                       -0.968
## BodyPartNo Physical Injury                                               -2.206
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                              1.784
## BodyPartPelvis                                                            0.514
## BodyPartSacrum And Coccyx                                                 0.629
## BodyPartShoulder(S)                                                       0.341
## BodyPartSkull                                                             1.928
## BodyPartSoft Tissue-Head                                                  1.897
## BodyPartSoft Tissue-Neck                                                  1.271
## BodyPartSpinal Cord-Trunk                                                -2.256
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                             0.097
## BodyPartToes                                                             -1.296
## BodyPartTrachea                                                           0.505
## BodyPartUpper Arm                                                        -0.548
## BodyPartUpper Back Area                                                  -1.187
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## IsDenied                                                                -12.036
## GroupInjuryOthers                                                            NA
## GroupInjuryStrain                                                            NA
## GroupBodyPartMultiple Body Parts                                             NA
## GroupBodyPartOthers                                                          NA
## GroupBodyPROthers                                                            NA
## GroupBodyPRUpper Extremities                                                 NA
##                                                                         Pr(>|t|)
## (Intercept)                                                             0.262268
## TiempoDeProcesamiento                                                    < 2e-16
## AverageWeeklyWage                                                       0.652152
## ClaimantAge_at_DOI                                                      0.691826
## GenderMale                                                              0.263951
## GenderNot Available                                                     0.970535
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                 0.038066
## InjuryNatureAll Other Cumulative Injury, NOC                            0.998564
## InjuryNatureAll Other Occupational Disease Injury, NOC                  0.643493
## InjuryNatureAll Other Specific Injuries, Noc                            0.985302
## InjuryNatureAmputation                                                  0.090362
## InjuryNatureAsbestosis                                                  0.912728
## InjuryNatureAsphyxiation                                                0.953769
## InjuryNatureBurn                                                        0.949365
## InjuryNatureCarpal Tunnel Syndrome                                      0.799738
## InjuryNatureConcussion                                                  0.631623
## InjuryNatureContagious Disease                                          0.908327
## InjuryNatureContusion                                                   0.944739
## InjuryNatureCrushing                                                    0.836663
## InjuryNatureDermatitis                                                  0.914057
## InjuryNatureDislocation                                                 0.784290
## InjuryNatureDust Disease, NOC                                           0.777949
## InjuryNatureElectric Shock                                              0.556533
## InjuryNatureForeign Body                                                0.954763
## InjuryNatureFracture                                                    0.645697
## InjuryNatureFreezing                                                    0.929632
## InjuryNatureHearing Loss Or Impairment                                  0.531754
## InjuryNatureHeat Prostration                                            0.611148
## InjuryNatureHernia                                                      0.468582
## InjuryNatureInfection                                                   0.997477
## InjuryNatureInflammation                                                0.886744
## InjuryNatureLaceration                                                  0.903879
## InjuryNatureLoss of Hearing                                             0.154175
## InjuryNatureMental Disorder                                             0.288033
## InjuryNatureMental Stress                                               0.784213
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.352619
## InjuryNatureMultiple Physical Injuries Only                             0.839608
## InjuryNatureMyocardial Infarction                                       0.941873
## InjuryNatureNo Physical Injury                                          0.910225
## InjuryNatureNon-Standard Code                                           0.856600
## InjuryNatureNot Available                                               0.885998
## InjuryNaturePoisoning?Chemical (Other Than Metals)                      0.918812
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)             0.819495
## InjuryNaturePuncture                                                    0.983431
## InjuryNatureRadiation                                                   0.003786
## InjuryNatureRespiratory Disorders                                       0.972597
## InjuryNatureRupture                                                     0.401958
## InjuryNatureSeverance                                                   0.202867
## InjuryNatureSilicosis                                                   0.907979
## InjuryNatureSprain                                                      0.893442
## InjuryNatureStrain                                                      0.864058
## InjuryNatureSyncope                                                     0.524948
## InjuryNatureVascular                                                    0.695910
## InjuryNatureVision Loss                                                 0.781641
## BodyPartRegionLower Extremities                                         0.671005
## BodyPartRegionMultiple Body Parts                                       0.014265
## BodyPartRegionNeck                                                      0.319909
## BodyPartRegionNon-Standard Code                                         0.358861
## BodyPartRegionTrunk                                                     0.020033
## BodyPartRegionUpper Extremities                                         0.223873
## BodyPartAnkle                                                           0.357463
## BodyPartArtificial Appliance                                            0.920031
## BodyPartBody Systems and Multiple Body Systems                          0.072883
## BodyPartBrain                                                           0.343288
## BodyPartButtocks                                                        0.210035
## BodyPartChest                                                           0.000179
## BodyPartDisc-Trunk                                                      0.253423
## BodyPartEar(S)                                                          0.419721
## BodyPartElbow                                                           0.713581
## BodyPartEyes                                                            0.601769
## BodyPartFacial Bones                                                    0.262179
## BodyPartFinger(S)                                                       0.254422
## BodyPartFoot                                                            0.385384
## BodyPartGreat Toe                                                       0.013532
## BodyPartHand                                                            0.709843
## BodyPartHeart                                                           0.235653
## BodyPartHip                                                             0.772863
## BodyPartInsufficient Info to Properly Identify?Unclassified             0.078708
## BodyPartInternal Organs                                                 0.142859
## BodyPartKnee                                                            0.123833
## BodyPartLarynx                                                          0.660384
## BodyPartLower Arm                                                       0.810419
## BodyPartLower Back Area                                                 0.006635
## BodyPartLower Leg                                                       0.350221
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             5.23e-06
## BodyPartLungs                                                           0.225034
## BodyPartMouth                                                           0.363879
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     0.022650
## BodyPartMultiple Head Injury                                            0.390784
## BodyPartMultiple Lower Extremities                                      0.068334
## BodyPartMultiple Neck Injury                                            0.255113
## BodyPartMultiple Trunk                                                  0.605209
## BodyPartMultiple Upper Extremities                                      0.332881
## BodyPartNo Physical Injury                                              0.027407
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                            0.074423
## BodyPartPelvis                                                          0.607357
## BodyPartSacrum And Coccyx                                               0.529047
## BodyPartShoulder(S)                                                     0.733266
## BodyPartSkull                                                           0.053846
## BodyPartSoft Tissue-Head                                                0.057885
## BodyPartSoft Tissue-Neck                                                0.203780
## BodyPartSpinal Cord-Trunk                                               0.024077
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                           0.922660
## BodyPartToes                                                            0.195041
## BodyPartTrachea                                                         0.613456
## BodyPartUpper Arm                                                       0.583830
## BodyPartUpper Back Area                                                 0.235204
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## IsDenied                                                                 < 2e-16
## GroupInjuryOthers                                                             NA
## GroupInjuryStrain                                                             NA
## GroupBodyPartMultiple Body Parts                                              NA
## GroupBodyPartOthers                                                           NA
## GroupBodyPROthers                                                             NA
## GroupBodyPRUpper Extremities                                                  NA
##                                                                            
## (Intercept)                                                                
## TiempoDeProcesamiento                                                   ***
## AverageWeeklyWage                                                          
## ClaimantAge_at_DOI                                                         
## GenderMale                                                                 
## GenderNot Available                                                        
## ClaimantTypeMedical Only                                                ***
## ClaimantTypeReport Only                                                 *  
## InjuryNatureAll Other Cumulative Injury, NOC                               
## InjuryNatureAll Other Occupational Disease Injury, NOC                     
## InjuryNatureAll Other Specific Injuries, Noc                               
## InjuryNatureAmputation                                                  .  
## InjuryNatureAsbestosis                                                     
## InjuryNatureAsphyxiation                                                   
## InjuryNatureBurn                                                           
## InjuryNatureCarpal Tunnel Syndrome                                         
## InjuryNatureConcussion                                                     
## InjuryNatureContagious Disease                                             
## InjuryNatureContusion                                                      
## InjuryNatureCrushing                                                       
## InjuryNatureDermatitis                                                     
## InjuryNatureDislocation                                                    
## InjuryNatureDust Disease, NOC                                              
## InjuryNatureElectric Shock                                                 
## InjuryNatureForeign Body                                                   
## InjuryNatureFracture                                                       
## InjuryNatureFreezing                                                       
## InjuryNatureHearing Loss Or Impairment                                     
## InjuryNatureHeat Prostration                                               
## InjuryNatureHernia                                                         
## InjuryNatureInfection                                                      
## InjuryNatureInflammation                                                   
## InjuryNatureLaceration                                                     
## InjuryNatureLoss of Hearing                                                
## InjuryNatureMental Disorder                                                
## InjuryNatureMental Stress                                                  
## InjuryNatureMultiple Injuries Including Both Physical and Psychological    
## InjuryNatureMultiple Physical Injuries Only                                
## InjuryNatureMyocardial Infarction                                          
## InjuryNatureNo Physical Injury                                             
## InjuryNatureNon-Standard Code                                              
## InjuryNatureNot Available                                                  
## InjuryNaturePoisoning?Chemical (Other Than Metals)                         
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)                
## InjuryNaturePuncture                                                       
## InjuryNatureRadiation                                                   ** 
## InjuryNatureRespiratory Disorders                                          
## InjuryNatureRupture                                                        
## InjuryNatureSeverance                                                      
## InjuryNatureSilicosis                                                      
## InjuryNatureSprain                                                         
## InjuryNatureStrain                                                         
## InjuryNatureSyncope                                                        
## InjuryNatureVascular                                                       
## InjuryNatureVision Loss                                                    
## BodyPartRegionLower Extremities                                            
## BodyPartRegionMultiple Body Parts                                       *  
## BodyPartRegionNeck                                                         
## BodyPartRegionNon-Standard Code                                            
## BodyPartRegionTrunk                                                     *  
## BodyPartRegionUpper Extremities                                            
## BodyPartAnkle                                                              
## BodyPartArtificial Appliance                                               
## BodyPartBody Systems and Multiple Body Systems                          .  
## BodyPartBrain                                                              
## BodyPartButtocks                                                           
## BodyPartChest                                                           ***
## BodyPartDisc-Trunk                                                         
## BodyPartEar(S)                                                             
## BodyPartElbow                                                              
## BodyPartEyes                                                               
## BodyPartFacial Bones                                                       
## BodyPartFinger(S)                                                          
## BodyPartFoot                                                               
## BodyPartGreat Toe                                                       *  
## BodyPartHand                                                               
## BodyPartHeart                                                              
## BodyPartHip                                                                
## BodyPartInsufficient Info to Properly Identify?Unclassified             .  
## BodyPartInternal Organs                                                    
## BodyPartKnee                                                               
## BodyPartLarynx                                                             
## BodyPartLower Arm                                                          
## BodyPartLower Back Area                                                 ** 
## BodyPartLower Leg                                                          
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             ***
## BodyPartLungs                                                              
## BodyPartMouth                                                              
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     *  
## BodyPartMultiple Head Injury                                               
## BodyPartMultiple Lower Extremities                                      .  
## BodyPartMultiple Neck Injury                                               
## BodyPartMultiple Trunk                                                     
## BodyPartMultiple Upper Extremities                                         
## BodyPartNo Physical Injury                                              *  
## BodyPartNon-Standard Code                                                  
## BodyPartNose                                                            .  
## BodyPartPelvis                                                             
## BodyPartSacrum And Coccyx                                                  
## BodyPartShoulder(S)                                                        
## BodyPartSkull                                                           .  
## BodyPartSoft Tissue-Head                                                .  
## BodyPartSoft Tissue-Neck                                                   
## BodyPartSpinal Cord-Trunk                                               *  
## BodyPartTeeth                                                              
## BodyPartThumb                                                              
## BodyPartToes                                                               
## BodyPartTrachea                                                            
## BodyPartUpper Arm                                                          
## BodyPartUpper Back Area                                                    
## BodyPartUpper Leg                                                          
## BodyPartVertebrae                                                          
## BodyPartWhole Body                                                         
## BodyPartWrist                                                              
## IsDenied                                                                ***
## GroupInjuryOthers                                                          
## GroupInjuryStrain                                                          
## GroupBodyPartMultiple Body Parts                                           
## GroupBodyPartOthers                                                        
## GroupBodyPROthers                                                          
## GroupBodyPRUpper Extremities                                               
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2072 on 10912 degrees of freedom
## Multiple R-squared:  0.3801, Adjusted R-squared:  0.374 
## F-statistic: 61.96 on 108 and 10912 DF,  p-value: < 2.2e-16

Ajustes al modelo de regresión

# Se ajusta el modelo de regresión 
regresiontic <- lm(TotalIncurredCost ~ TiempoDeProcesamiento + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + IsDenied, data = bd3)
summary(regresiontic)
## 
## Call:
## lm(formula = TotalIncurredCost ~ TiempoDeProcesamiento + ClaimantType + 
##     InjuryNature + BodyPartRegion + BodyPart + IsDenied, data = bd3)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5714.9  -832.9  -252.4   471.7 10426.6 
## 
## Coefficients: (6 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                              2.333e+03
## TiempoDeProcesamiento                                                    1.945e+00
## ClaimantTypeMedical Only                                                -2.560e+03
## ClaimantTypeReport Only                                                 -3.056e+03
## InjuryNatureAll Other Cumulative Injury, NOC                             4.128e+01
## InjuryNatureAll Other Occupational Disease Injury, NOC                  -1.061e+03
## InjuryNatureAll Other Specific Injuries, Noc                            -1.443e+01
## InjuryNatureAmputation                                                   4.083e+03
## InjuryNatureAsbestosis                                                  -2.317e+02
## InjuryNatureAsphyxiation                                                -1.688e+02
## InjuryNatureBurn                                                        -1.200e+02
## InjuryNatureCarpal Tunnel Syndrome                                       5.660e+02
## InjuryNatureConcussion                                                   1.032e+03
## InjuryNatureContagious Disease                                          -2.298e+02
## InjuryNatureContusion                                                    1.689e+02
## InjuryNatureCrushing                                                     4.441e+02
## InjuryNatureDermatitis                                                  -2.150e+02
## InjuryNatureDislocation                                                  5.891e+02
## InjuryNatureDust Disease, NOC                                           -6.355e+02
## InjuryNatureElectric Shock                                               1.288e+03
## InjuryNatureForeign Body                                                 1.319e+02
## InjuryNatureFracture                                                     9.834e+02
## InjuryNatureFreezing                                                     2.518e+02
## InjuryNatureHearing Loss Or Impairment                                   1.431e+03
## InjuryNatureHeat Prostration                                             1.096e+03
## InjuryNatureHernia                                                       1.540e+03
## InjuryNatureInfection                                                    9.421e+00
## InjuryNatureInflammation                                                 3.204e+02
## InjuryNatureLaceration                                                   2.656e+02
## InjuryNatureLoss of Hearing                                              3.375e+03
## InjuryNatureMental Disorder                                             -3.186e+03
## InjuryNatureMental Stress                                               -5.574e+02
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.056e+03
## InjuryNatureMultiple Physical Injuries Only                              4.484e+02
## InjuryNatureMyocardial Infarction                                       -1.741e+02
## InjuryNatureNo Physical Injury                                           2.545e+02
## InjuryNatureNon-Standard Code                                            4.042e+02
## InjuryNatureNot Available                                                3.237e+02
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.423e+02
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              5.111e+02
## InjuryNaturePuncture                                                     6.496e+01
## InjuryNatureRadiation                                                    8.598e+03
## InjuryNatureRespiratory Disorders                                       -4.306e+01
## InjuryNatureRupture                                                      1.814e+03
## InjuryNatureSeverance                                                    3.752e+03
## InjuryNatureSilicosis                                                   -2.577e+02
## InjuryNatureSprain                                                       3.015e+02
## InjuryNatureStrain                                                       3.764e+02
## InjuryNatureSyncope                                                      1.386e+03
## InjuryNatureVascular                                                    -9.012e+02
## InjuryNatureVision Loss                                                 -6.172e+02
## BodyPartRegionLower Extremities                                          1.450e+02
## BodyPartRegionMultiple Body Parts                                        1.927e+03
## BodyPartRegionNeck                                                      -9.627e+02
## BodyPartRegionNon-Standard Code                                          3.520e+02
## BodyPartRegionTrunk                                                      7.765e+02
## BodyPartRegionUpper Extremities                                          3.703e+02
## BodyPartAnkle                                                            2.234e+02
## BodyPartArtificial Appliance                                             2.017e+02
## BodyPartBody Systems and Multiple Body Systems                          -1.470e+03
## BodyPartBrain                                                            7.634e+02
## BodyPartButtocks                                                        -3.936e+02
## BodyPartChest                                                           -8.780e+02
## BodyPartDisc-Trunk                                                       4.042e+02
## BodyPartEar(S)                                                          -3.562e+02
## BodyPartElbow                                                           -7.089e+01
## BodyPartEyes                                                             1.593e+02
## BodyPartFacial Bones                                                     4.208e+02
## BodyPartFinger(S)                                                       -1.530e+02
## BodyPartFoot                                                            -1.958e+02
## BodyPartGreat Toe                                                       -1.090e+03
## BodyPartHand                                                            -5.311e+01
## BodyPartHeart                                                           -1.273e+03
## BodyPartHip                                                              8.903e+01
## BodyPartInsufficient Info to Properly Identify?Unclassified             -1.404e+03
## BodyPartInternal Organs                                                 -7.120e+02
## BodyPartKnee                                                             3.486e+02
## BodyPartLarynx                                                           5.904e+02
## BodyPartLower Arm                                                        3.362e+01
## BodyPartLower Back Area                                                 -5.129e+02
## BodyPartLower Leg                                                        2.284e+02
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             -1.170e+03
## BodyPartLungs                                                           -4.610e+02
## BodyPartMouth                                                            3.858e+02
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     -1.676e+03
## BodyPartMultiple Head Injury                                             2.709e+02
## BodyPartMultiple Lower Extremities                                       5.864e+02
## BodyPartMultiple Neck Injury                                             1.064e+03
## BodyPartMultiple Trunk                                                   2.453e+02
## BodyPartMultiple Upper Extremities                                      -2.412e+02
## BodyPartNo Physical Injury                                              -1.739e+03
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             7.340e+02
## BodyPartPelvis                                                           2.718e+02
## BodyPartSacrum And Coccyx                                                4.651e+02
## BodyPartShoulder(S)                                                      3.881e+01
## BodyPartSkull                                                            7.261e+02
## BodyPartSoft Tissue-Head                                                 6.509e+02
## BodyPartSoft Tissue-Neck                                                 1.179e+03
## BodyPartSpinal Cord-Trunk                                               -1.235e+03
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            1.157e+01
## BodyPartToes                                                            -4.079e+02
## BodyPartTrachea                                                          8.663e+02
## BodyPartUpper Arm                                                       -1.232e+02
## BodyPartUpper Back Area                                                 -3.273e+02
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                -9.225e+02
##                                                                         Std. Error
## (Intercept)                                                              2.112e+03
## TiempoDeProcesamiento                                                    7.327e-02
## ClaimantTypeMedical Only                                                 4.549e+01
## ClaimantTypeReport Only                                                  1.472e+03
## InjuryNatureAll Other Cumulative Injury, NOC                             2.204e+03
## InjuryNatureAll Other Occupational Disease Injury, NOC                   2.339e+03
## InjuryNatureAll Other Specific Injuries, Noc                             2.096e+03
## InjuryNatureAmputation                                                   2.412e+03
## InjuryNatureAsbestosis                                                   2.184e+03
## InjuryNatureAsphyxiation                                                 2.930e+03
## InjuryNatureBurn                                                         2.101e+03
## InjuryNatureCarpal Tunnel Syndrome                                       2.100e+03
## InjuryNatureConcussion                                                   2.108e+03
## InjuryNatureContagious Disease                                           2.141e+03
## InjuryNatureContusion                                                    2.093e+03
## InjuryNatureCrushing                                                     2.105e+03
## InjuryNatureDermatitis                                                   2.098e+03
## InjuryNatureDislocation                                                  2.111e+03
## InjuryNatureDust Disease, NOC                                            2.416e+03
## InjuryNatureElectric Shock                                               2.174e+03
## InjuryNatureForeign Body                                                 2.102e+03
## InjuryNatureFracture                                                     2.095e+03
## InjuryNatureFreezing                                                     2.947e+03
## InjuryNatureHearing Loss Or Impairment                                   2.279e+03
## InjuryNatureHeat Prostration                                             2.137e+03
## InjuryNatureHernia                                                       2.116e+03
## InjuryNatureInfection                                                    2.113e+03
## InjuryNatureInflammation                                                 2.099e+03
## InjuryNatureLaceration                                                   2.094e+03
## InjuryNatureLoss of Hearing                                              2.356e+03
## InjuryNatureMental Disorder                                              3.035e+03
## InjuryNatureMental Stress                                                2.117e+03
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  2.184e+03
## InjuryNatureMultiple Physical Injuries Only                              2.095e+03
## InjuryNatureMyocardial Infarction                                        2.412e+03
## InjuryNatureNo Physical Injury                                           2.091e+03
## InjuryNatureNon-Standard Code                                            2.112e+03
## InjuryNatureNot Available                                                2.121e+03
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       2.139e+03
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              2.226e+03
## InjuryNaturePuncture                                                     2.096e+03
## InjuryNatureRadiation                                                    2.953e+03
## InjuryNatureRespiratory Disorders                                        2.110e+03
## InjuryNatureRupture                                                      2.151e+03
## InjuryNatureSeverance                                                    2.946e+03
## InjuryNatureSilicosis                                                    2.558e+03
## InjuryNatureSprain                                                       2.094e+03
## InjuryNatureStrain                                                       2.093e+03
## InjuryNatureSyncope                                                      2.153e+03
## InjuryNatureVascular                                                     2.413e+03
## InjuryNatureVision Loss                                                  2.262e+03
## BodyPartRegionLower Extremities                                          3.567e+02
## BodyPartRegionMultiple Body Parts                                        7.891e+02
## BodyPartRegionNeck                                                       9.697e+02
## BodyPartRegionNon-Standard Code                                          3.885e+02
## BodyPartRegionTrunk                                                      3.374e+02
## BodyPartRegionUpper Extremities                                          3.013e+02
## BodyPartAnkle                                                            2.319e+02
## BodyPartArtificial Appliance                                             2.200e+03
## BodyPartBody Systems and Multiple Body Systems                           8.255e+02
## BodyPartBrain                                                            8.054e+02
## BodyPartButtocks                                                         3.259e+02
## BodyPartChest                                                            2.348e+02
## BodyPartDisc-Trunk                                                       3.443e+02
## BodyPartEar(S)                                                           4.252e+02
## BodyPartElbow                                                            1.724e+02
## BodyPartEyes                                                             3.202e+02
## BodyPartFacial Bones                                                     3.804e+02
## BodyPartFinger(S)                                                        1.282e+02
## BodyPartFoot                                                             2.365e+02
## BodyPartGreat Toe                                                        4.475e+02
## BodyPartHand                                                             1.258e+02
## BodyPartHeart                                                            1.075e+03
## BodyPartHip                                                              2.762e+02
## BodyPartInsufficient Info to Properly Identify?Unclassified              8.025e+02
## BodyPartInternal Organs                                                  4.836e+02
## BodyPartKnee                                                             2.233e+02
## BodyPartLarynx                                                           1.393e+03
## BodyPartLower Arm                                                        1.560e+02
## BodyPartLower Back Area                                                  1.916e+02
## BodyPartLower Leg                                                        2.460e+02
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              2.581e+02
## BodyPartLungs                                                            3.846e+02
## BodyPartMouth                                                            4.287e+02
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      7.397e+02
## BodyPartMultiple Head Injury                                             3.172e+02
## BodyPartMultiple Lower Extremities                                       3.170e+02
## BodyPartMultiple Neck Injury                                             9.389e+02
## BodyPartMultiple Trunk                                                   4.737e+02
## BodyPartMultiple Upper Extremities                                       2.433e+02
## BodyPartNo Physical Injury                                               7.890e+02
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             4.125e+02
## BodyPartPelvis                                                           5.300e+02
## BodyPartSacrum And Coccyx                                                7.150e+02
## BodyPartShoulder(S)                                                      1.334e+02
## BodyPartSkull                                                            3.789e+02
## BodyPartSoft Tissue-Head                                                 3.448e+02
## BodyPartSoft Tissue-Neck                                                 9.338e+02
## BodyPartSpinal Cord-Trunk                                                5.500e+02
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            1.706e+02
## BodyPartToes                                                             3.276e+02
## BodyPartTrachea                                                          1.740e+03
## BodyPartUpper Arm                                                        2.174e+02
## BodyPartUpper Back Area                                                  2.832e+02
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## IsDenied                                                                 7.681e+01
##                                                                         t value
## (Intercept)                                                               1.105
## TiempoDeProcesamiento                                                    26.548
## ClaimantTypeMedical Only                                                -56.279
## ClaimantTypeReport Only                                                  -2.077
## InjuryNatureAll Other Cumulative Injury, NOC                              0.019
## InjuryNatureAll Other Occupational Disease Injury, NOC                   -0.454
## InjuryNatureAll Other Specific Injuries, Noc                             -0.007
## InjuryNatureAmputation                                                    1.693
## InjuryNatureAsbestosis                                                   -0.106
## InjuryNatureAsphyxiation                                                 -0.058
## InjuryNatureBurn                                                         -0.057
## InjuryNatureCarpal Tunnel Syndrome                                        0.269
## InjuryNatureConcussion                                                    0.490
## InjuryNatureContagious Disease                                           -0.107
## InjuryNatureContusion                                                     0.081
## InjuryNatureCrushing                                                      0.211
## InjuryNatureDermatitis                                                   -0.103
## InjuryNatureDislocation                                                   0.279
## InjuryNatureDust Disease, NOC                                            -0.263
## InjuryNatureElectric Shock                                                0.593
## InjuryNatureForeign Body                                                  0.063
## InjuryNatureFracture                                                      0.469
## InjuryNatureFreezing                                                      0.085
## InjuryNatureHearing Loss Or Impairment                                    0.628
## InjuryNatureHeat Prostration                                              0.513
## InjuryNatureHernia                                                        0.728
## InjuryNatureInfection                                                     0.004
## InjuryNatureInflammation                                                  0.153
## InjuryNatureLaceration                                                    0.127
## InjuryNatureLoss of Hearing                                               1.432
## InjuryNatureMental Disorder                                              -1.050
## InjuryNatureMental Stress                                                -0.263
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.941
## InjuryNatureMultiple Physical Injuries Only                               0.214
## InjuryNatureMyocardial Infarction                                        -0.072
## InjuryNatureNo Physical Injury                                            0.122
## InjuryNatureNon-Standard Code                                             0.191
## InjuryNatureNot Available                                                 0.153
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.113
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.230
## InjuryNaturePuncture                                                      0.031
## InjuryNatureRadiation                                                     2.912
## InjuryNatureRespiratory Disorders                                        -0.020
## InjuryNatureRupture                                                       0.843
## InjuryNatureSeverance                                                     1.274
## InjuryNatureSilicosis                                                    -0.101
## InjuryNatureSprain                                                        0.144
## InjuryNatureStrain                                                        0.180
## InjuryNatureSyncope                                                       0.644
## InjuryNatureVascular                                                     -0.374
## InjuryNatureVision Loss                                                  -0.273
## BodyPartRegionLower Extremities                                           0.407
## BodyPartRegionMultiple Body Parts                                         2.442
## BodyPartRegionNeck                                                       -0.993
## BodyPartRegionNon-Standard Code                                           0.906
## BodyPartRegionTrunk                                                       2.301
## BodyPartRegionUpper Extremities                                           1.229
## BodyPartAnkle                                                             0.963
## BodyPartArtificial Appliance                                              0.092
## BodyPartBody Systems and Multiple Body Systems                           -1.781
## BodyPartBrain                                                             0.948
## BodyPartButtocks                                                         -1.208
## BodyPartChest                                                            -3.740
## BodyPartDisc-Trunk                                                        1.174
## BodyPartEar(S)                                                           -0.838
## BodyPartElbow                                                            -0.411
## BodyPartEyes                                                              0.497
## BodyPartFacial Bones                                                      1.106
## BodyPartFinger(S)                                                        -1.193
## BodyPartFoot                                                             -0.828
## BodyPartGreat Toe                                                        -2.437
## BodyPartHand                                                             -0.422
## BodyPartHeart                                                            -1.185
## BodyPartHip                                                               0.322
## BodyPartInsufficient Info to Properly Identify?Unclassified              -1.750
## BodyPartInternal Organs                                                  -1.472
## BodyPartKnee                                                              1.561
## BodyPartLarynx                                                            0.424
## BodyPartLower Arm                                                         0.215
## BodyPartLower Back Area                                                  -2.677
## BodyPartLower Leg                                                         0.929
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              -4.533
## BodyPartLungs                                                            -1.199
## BodyPartMouth                                                             0.900
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      -2.266
## BodyPartMultiple Head Injury                                              0.854
## BodyPartMultiple Lower Extremities                                        1.850
## BodyPartMultiple Neck Injury                                              1.133
## BodyPartMultiple Trunk                                                    0.518
## BodyPartMultiple Upper Extremities                                       -0.991
## BodyPartNo Physical Injury                                               -2.204
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                              1.779
## BodyPartPelvis                                                            0.513
## BodyPartSacrum And Coccyx                                                 0.650
## BodyPartShoulder(S)                                                       0.291
## BodyPartSkull                                                             1.916
## BodyPartSoft Tissue-Head                                                  1.888
## BodyPartSoft Tissue-Neck                                                  1.263
## BodyPartSpinal Cord-Trunk                                                -2.245
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                             0.068
## BodyPartToes                                                             -1.245
## BodyPartTrachea                                                           0.498
## BodyPartUpper Arm                                                        -0.567
## BodyPartUpper Back Area                                                  -1.156
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## IsDenied                                                                -12.012
##                                                                         Pr(>|t|)
## (Intercept)                                                             0.269219
## TiempoDeProcesamiento                                                    < 2e-16
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                 0.037846
## InjuryNatureAll Other Cumulative Injury, NOC                            0.985059
## InjuryNatureAll Other Occupational Disease Injury, NOC                  0.649973
## InjuryNatureAll Other Specific Injuries, Noc                            0.994507
## InjuryNatureAmputation                                                  0.090464
## InjuryNatureAsbestosis                                                  0.915526
## InjuryNatureAsphyxiation                                                0.954059
## InjuryNatureBurn                                                        0.954426
## InjuryNatureCarpal Tunnel Syndrome                                      0.787586
## InjuryNatureConcussion                                                  0.624470
## InjuryNatureContagious Disease                                          0.914518
## InjuryNatureContusion                                                   0.935679
## InjuryNatureCrushing                                                    0.832888
## InjuryNatureDermatitis                                                  0.918361
## InjuryNatureDislocation                                                 0.780216
## InjuryNatureDust Disease, NOC                                           0.792491
## InjuryNatureElectric Shock                                              0.553369
## InjuryNatureForeign Body                                                0.949965
## InjuryNatureFracture                                                    0.638725
## InjuryNatureFreezing                                                    0.931887
## InjuryNatureHearing Loss Or Impairment                                  0.529973
## InjuryNatureHeat Prostration                                            0.608103
## InjuryNatureHernia                                                      0.466621
## InjuryNatureInfection                                                   0.996443
## InjuryNatureInflammation                                                0.878718
## InjuryNatureLaceration                                                  0.899072
## InjuryNatureLoss of Hearing                                             0.152049
## InjuryNatureMental Disorder                                             0.293733
## InjuryNatureMental Stress                                               0.792337
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.346564
## InjuryNatureMultiple Physical Injuries Only                             0.830530
## InjuryNatureMyocardial Infarction                                       0.942478
## InjuryNatureNo Physical Injury                                          0.903157
## InjuryNatureNon-Standard Code                                           0.848264
## InjuryNatureNot Available                                               0.878664
## InjuryNaturePoisoning?Chemical (Other Than Metals)                      0.909799
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)             0.818373
## InjuryNaturePuncture                                                    0.975277
## InjuryNatureRadiation                                                   0.003602
## InjuryNatureRespiratory Disorders                                       0.983715
## InjuryNatureRupture                                                     0.399160
## InjuryNatureSeverance                                                   0.202825
## InjuryNatureSilicosis                                                   0.919756
## InjuryNatureSprain                                                      0.885487
## InjuryNatureStrain                                                      0.857314
## InjuryNatureSyncope                                                     0.519771
## InjuryNatureVascular                                                    0.708780
## InjuryNatureVision Loss                                                 0.784958
## BodyPartRegionLower Extremities                                         0.684316
## BodyPartRegionMultiple Body Parts                                       0.014635
## BodyPartRegionNeck                                                      0.320850
## BodyPartRegionNon-Standard Code                                         0.364981
## BodyPartRegionTrunk                                                     0.021400
## BodyPartRegionUpper Extremities                                         0.219124
## BodyPartAnkle                                                           0.335539
## BodyPartArtificial Appliance                                            0.926958
## BodyPartBody Systems and Multiple Body Systems                          0.074989
## BodyPartBrain                                                           0.343230
## BodyPartButtocks                                                        0.227084
## BodyPartChest                                                           0.000185
## BodyPartDisc-Trunk                                                      0.240437
## BodyPartEar(S)                                                          0.402169
## BodyPartElbow                                                           0.680890
## BodyPartEyes                                                            0.618883
## BodyPartFacial Bones                                                    0.268772
## BodyPartFinger(S)                                                       0.232713
## BodyPartFoot                                                            0.407693
## BodyPartGreat Toe                                                       0.014839
## BodyPartHand                                                            0.672866
## BodyPartHeart                                                           0.236172
## BodyPartHip                                                             0.747217
## BodyPartInsufficient Info to Properly Identify?Unclassified             0.080166
## BodyPartInternal Organs                                                 0.140997
## BodyPartKnee                                                            0.118577
## BodyPartLarynx                                                          0.671604
## BodyPartLower Arm                                                       0.829389
## BodyPartLower Back Area                                                 0.007443
## BodyPartLower Leg                                                       0.353072
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             5.88e-06
## BodyPartLungs                                                           0.230666
## BodyPartMouth                                                           0.368114
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     0.023475
## BodyPartMultiple Head Injury                                            0.393057
## BodyPartMultiple Lower Extremities                                      0.064398
## BodyPartMultiple Neck Injury                                            0.257246
## BodyPartMultiple Trunk                                                  0.604534
## BodyPartMultiple Upper Extremities                                      0.321479
## BodyPartNo Physical Injury                                              0.027555
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                            0.075197
## BodyPartPelvis                                                          0.608097
## BodyPartSacrum And Coccyx                                               0.515434
## BodyPartShoulder(S)                                                     0.771101
## BodyPartSkull                                                           0.055350
## BodyPartSoft Tissue-Head                                                0.059086
## BodyPartSoft Tissue-Neck                                                0.206599
## BodyPartSpinal Cord-Trunk                                               0.024779
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                           0.945927
## BodyPartToes                                                            0.213104
## BodyPartTrachea                                                         0.618523
## BodyPartUpper Arm                                                       0.570880
## BodyPartUpper Back Area                                                 0.247775
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## IsDenied                                                                 < 2e-16
##                                                                            
## (Intercept)                                                                
## TiempoDeProcesamiento                                                   ***
## ClaimantTypeMedical Only                                                ***
## ClaimantTypeReport Only                                                 *  
## InjuryNatureAll Other Cumulative Injury, NOC                               
## InjuryNatureAll Other Occupational Disease Injury, NOC                     
## InjuryNatureAll Other Specific Injuries, Noc                               
## InjuryNatureAmputation                                                  .  
## InjuryNatureAsbestosis                                                     
## InjuryNatureAsphyxiation                                                   
## InjuryNatureBurn                                                           
## InjuryNatureCarpal Tunnel Syndrome                                         
## InjuryNatureConcussion                                                     
## InjuryNatureContagious Disease                                             
## InjuryNatureContusion                                                      
## InjuryNatureCrushing                                                       
## InjuryNatureDermatitis                                                     
## InjuryNatureDislocation                                                    
## InjuryNatureDust Disease, NOC                                              
## InjuryNatureElectric Shock                                                 
## InjuryNatureForeign Body                                                   
## InjuryNatureFracture                                                       
## InjuryNatureFreezing                                                       
## InjuryNatureHearing Loss Or Impairment                                     
## InjuryNatureHeat Prostration                                               
## InjuryNatureHernia                                                         
## InjuryNatureInfection                                                      
## InjuryNatureInflammation                                                   
## InjuryNatureLaceration                                                     
## InjuryNatureLoss of Hearing                                                
## InjuryNatureMental Disorder                                                
## InjuryNatureMental Stress                                                  
## InjuryNatureMultiple Injuries Including Both Physical and Psychological    
## InjuryNatureMultiple Physical Injuries Only                                
## InjuryNatureMyocardial Infarction                                          
## InjuryNatureNo Physical Injury                                             
## InjuryNatureNon-Standard Code                                              
## InjuryNatureNot Available                                                  
## InjuryNaturePoisoning?Chemical (Other Than Metals)                         
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)                
## InjuryNaturePuncture                                                       
## InjuryNatureRadiation                                                   ** 
## InjuryNatureRespiratory Disorders                                          
## InjuryNatureRupture                                                        
## InjuryNatureSeverance                                                      
## InjuryNatureSilicosis                                                      
## InjuryNatureSprain                                                         
## InjuryNatureStrain                                                         
## InjuryNatureSyncope                                                        
## InjuryNatureVascular                                                       
## InjuryNatureVision Loss                                                    
## BodyPartRegionLower Extremities                                            
## BodyPartRegionMultiple Body Parts                                       *  
## BodyPartRegionNeck                                                         
## BodyPartRegionNon-Standard Code                                            
## BodyPartRegionTrunk                                                     *  
## BodyPartRegionUpper Extremities                                            
## BodyPartAnkle                                                              
## BodyPartArtificial Appliance                                               
## BodyPartBody Systems and Multiple Body Systems                          .  
## BodyPartBrain                                                              
## BodyPartButtocks                                                           
## BodyPartChest                                                           ***
## BodyPartDisc-Trunk                                                         
## BodyPartEar(S)                                                             
## BodyPartElbow                                                              
## BodyPartEyes                                                               
## BodyPartFacial Bones                                                       
## BodyPartFinger(S)                                                          
## BodyPartFoot                                                               
## BodyPartGreat Toe                                                       *  
## BodyPartHand                                                               
## BodyPartHeart                                                              
## BodyPartHip                                                                
## BodyPartInsufficient Info to Properly Identify?Unclassified             .  
## BodyPartInternal Organs                                                    
## BodyPartKnee                                                               
## BodyPartLarynx                                                             
## BodyPartLower Arm                                                          
## BodyPartLower Back Area                                                 ** 
## BodyPartLower Leg                                                          
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             ***
## BodyPartLungs                                                              
## BodyPartMouth                                                              
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     *  
## BodyPartMultiple Head Injury                                               
## BodyPartMultiple Lower Extremities                                      .  
## BodyPartMultiple Neck Injury                                               
## BodyPartMultiple Trunk                                                     
## BodyPartMultiple Upper Extremities                                         
## BodyPartNo Physical Injury                                              *  
## BodyPartNon-Standard Code                                                  
## BodyPartNose                                                            .  
## BodyPartPelvis                                                             
## BodyPartSacrum And Coccyx                                                  
## BodyPartShoulder(S)                                                        
## BodyPartSkull                                                           .  
## BodyPartSoft Tissue-Head                                                .  
## BodyPartSoft Tissue-Neck                                                   
## BodyPartSpinal Cord-Trunk                                               *  
## BodyPartTeeth                                                              
## BodyPartThumb                                                              
## BodyPartToes                                                               
## BodyPartTrachea                                                            
## BodyPartUpper Arm                                                          
## BodyPartUpper Back Area                                                    
## BodyPartUpper Leg                                                          
## BodyPartVertebrae                                                          
## BodyPartWhole Body                                                         
## BodyPartWrist                                                              
## IsDenied                                                                ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2072 on 10916 degrees of freedom
## Multiple R-squared:   0.38,  Adjusted R-squared:  0.3741 
## F-statistic: 64.34 on 104 and 10916 DF,  p-value: < 2.2e-16

Se observa que al ajustar el modelo de regresión considerando solo las variables que resultaron significativas en el primer caso, el r cuadrado disminuye ligeramente.

Construcción de un modelo predictivo

# Construir un modelo predictivo a partir del primer modelo de regresión obtenido. Se utilizará el renglón 10,000 de la base de datos 
bd3[9000, ] # se observa el renglón 6000 de la base de datos
##        TiempoDeProcesamiento TotalIncurredCost TotalPaid TotalReserves
## 161106                   112             682.1     682.1             0
##        TotalRecovery IndemnityPaid AverageWeeklyWage OtherPaid
## 161106             0             0              1077     682.1
##        ClaimantAge_at_DOI ClaimStatus Gender ClaimantType InjuryNature
## 161106                 44           C Female Medical Only       Sprain
##           BodyPartRegion BodyPart IsDenied  ClaimID GroupInjury GroupBodyPart
## 161106 Lower Extremities    Ankle        0 29235056      Others        Others
##              GroupBodyPR ClaimantOpenedDate ClaimantClosedDate
## 161106 Lower Extremities         2012-03-28         2012-07-18
# Se realiza la predicción
prediccioncosto <- data.frame(TiempoDeProcesamiento = 112, InjuryNature = "Sprain", BodyPartRegion =  "Lower Extremities", BodyPart ="Ankle", ClaimantType = "Medical Only", IsDenied = 0)
predict(regresiontic, prediccioncosto)
##        1 
## 660.8079

La diferencia entre el valor real y el valor estimado es de 22.1

LS0tCnRpdGxlOiAiQWN0aXZpZGFkIDQuNjogR2FzdG9zIE3DqWRpY29zICIKYXV0aG9yOiAiQW5kcmVhIFPDoW5jaGV6IgpkYXRlOiAiMjAyMy0xMC0wOCIKb3V0cHV0OiAKICBodG1sX2RvY3VtZW50OgogICAgdG9jOiBUUlVFCiAgICB0b2NfZmxvYXQ6IFRSVUUKICAgIGNvZGVfZG93bmxvYWQ6IFRSVUUKICAgIHRoZW1lOiAicmVhZGFibGUiCiAgICBoaWdobGlnaHQ6ICJweWdtZW50cyIKLS0tCgohW10oL1VzZXJzL2FuZHJlYXNhbmNoZXpnb21lei9Eb2N1bWVudHMvUi9nYXN0b3NtZWRpY29zLmdpZikKCiMgMC4gQ29udGV4dG8gClVuYSBlbXByZXNhIHViaWNhZGEgZW4gQ2Fyb2xpbmEgZGVsIE5vcnRlLCBFc3RhZG9zIFVuaWRvcywgc2UgZGVkaWNhIGEgZ2VzdGlvbmFyIHJlY2xhbWFjaW9uZXMgZGUgY29tcGVuc2FjaW9uZXMgbGFib3JhbGVzLiBDb21vIHBhcnRlIGRlIHN1cyBvcGVyYWNpb25lcywgaGEgcmVjb2xlY3RhZG8gdW5hIGNhbnRpZGFkIHNpZ25pZmljYXRpdmEgZGUgZGF0b3MgZSBpbmZvcm1hY2nDs24uIFNpbiBlbWJhcmdvLCBwYXJhIHBvZGVyIGFwcm92ZWNoYXJsYSBlcyBuZWNlc2FyaW8gcmVhbGl6YXIgdW4gYW7DoWxpc2lzIGludGVuc2l2byBkZSBsYSBiYXNlIGRlIGRhdG9zIGRlIGxhcyByZWNsYW1hY2lvbmVzIHF1ZSBoYSBnZXN0aW9uYWRvIGVuIGxvcyDDumx0aW1vcyBhw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