Importar base de datos

#file.choose()
bd <- read.csv ("/Users/vanessaelizondo/Desktop/Tec/Semestre 7/CSV/seguros.csv")

Entender la base de datos

resumen <- summary(bd)
#resumen

Generador de Valores

Pasos Importantes:.

Paso 1. Definir el área de negocios que deseamos impactar o mejorar y su KPI.

El area operativo y gastos para brindar un buen apoyo a los empleados y disminuir costos de su aseguradora. Determinar un KPI de incidentes.

Paso 2. Seleccionar plantilla (-s) para crear valor a partir de los datos de los clientes.

Visión / Segmentación / Personalización /Contextualización

Paso 3. Generar Ideas o conceptos específicos

Hacer una regresión lineal para conocer los factores que impactan mayormente en la utilidad del seguro, para atraer mayor gente que lo necesite, e igual para conocer su uso y encontrar estrategias de disminución de costos e aumento de ingresos.

Paso 4. Reunir los datos requeridos

*Tener una base de datos de datos nuevos para conocer el usuario que genera mayor uso del seguro y gastos.

Paso 5. Plan de ejecución

Hacer una regresión lineal para conocer los datos o variables con mayor relevancia y hacer un modelo predictivo para obtener informaciñon acerca de las lesiones más frecuentadas y el tiempo de lesión.

1.Prueba piloto en 10 casos de lesiones.

2. El area de costos hace alianzas con hospitales que ofreszcan el servicio de la lesión específica que se tiene más frecuente.

3. Crear estrategia para mitigar riesgos y evitar tantas lesiones con más cursos y preparación a los empleados.

Agregar columna de días de incapacidad

#(ReturnToWorkDate - Incident Datee) "Dia de incapacidad"
#install.packages("dplyr")
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
#count (bd, IncidentDescription, sort = TRUE)
#count (bd,  ClaimantType, sort = TRUE)

Generar Regresión Lineal

regresion <- lm (TotalIncurredCost ~ ClaimantAge_at_DOI + Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + AverageWeeklyWage1, data=bd)
#regresion

summary(regresion)
## 
## Call:
## lm(formula = TotalIncurredCost ~ ClaimantAge_at_DOI + Gender + 
##     ClaimantType + InjuryNature + BodyPartRegion + BodyPart + 
##     AverageWeeklyWage1, data = bd)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -477362  -12697    -550    5168 4673472 
## 
## Coefficients: (6 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                             -2.378e+04
## ClaimantAge_at_DOI                                                       1.562e+02
## GenderMale                                                               1.284e+03
## GenderNot Available                                                      6.689e+04
## ClaimantTypeMedical Only                                                -5.558e+04
## ClaimantTypeReport Only                                                 -5.011e+04
## InjuryNatureAll Other Specific Injuries, Noc                             5.673e+04
## InjuryNatureAmputation                                                   3.981e+04
## InjuryNatureAngina Pectoris                                             -3.435e+03
## InjuryNatureAsbestosis                                                   6.414e+04
## InjuryNatureAsphyxiation                                                 6.103e+04
## InjuryNatureBlack Lung                                                   6.015e+04
## InjuryNatureBurn                                                         5.822e+04
## InjuryNatureCancer                                                       6.751e+04
## InjuryNatureCarpal Tunnel Syndrome                                       3.969e+04
## InjuryNatureConcussion                                                   8.513e+04
## InjuryNatureContagious Disease                                           7.377e+04
## InjuryNatureContusion                                                    5.310e+04
## InjuryNatureCrushing                                                     5.680e+04
## InjuryNatureDermatitis                                                   5.106e+04
## InjuryNatureDislocation                                                  3.829e+04
## InjuryNatureDust Disease, NOC                                            5.988e+04
## InjuryNatureElectric Shock                                               6.393e+04
## InjuryNatureForeign Body                                                 5.245e+04
## InjuryNatureFracture                                                     5.006e+04
## InjuryNatureFreezing                                                     4.739e+04
## InjuryNatureHearing Loss Or Impairment                                   4.654e+04
## InjuryNatureHeat Prostration                                             4.574e+04
## InjuryNatureHernia                                                       2.304e+04
## InjuryNatureInfection                                                    4.686e+04
## InjuryNatureInflammation                                                 6.115e+04
## InjuryNatureLaceration                                                   5.288e+04
## InjuryNatureLoss of Hearing                                              4.266e+04
## InjuryNatureMental Disorder                                             -3.827e+04
## InjuryNatureMental Stress                                                5.016e+04
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  3.957e+04
## InjuryNatureMultiple Physical Injuries Only                              5.938e+04
## InjuryNatureMyocardial Infarction                                        3.203e+04
## InjuryNatureNo Physical Injury                                           4.793e+04
## InjuryNatureNon-Standard Code                                            3.735e+04
## InjuryNatureNot Available                                                5.287e+04
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       5.778e+04
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              4.645e+04
## InjuryNaturePuncture                                                     5.340e+04
## InjuryNatureRadiation                                                    5.488e+04
## InjuryNatureRespiratory Disorders                                        5.089e+04
## InjuryNatureRupture                                                      6.257e+04
## InjuryNatureSeverance                                                    8.690e+04
## InjuryNatureSprain                                                       5.235e+04
## InjuryNatureStrain                                                       4.740e+04
## InjuryNatureSyncope                                                      4.655e+04
## InjuryNatureVascular                                                     2.162e+02
## InjuryNatureVDT-Related Disease                                          6.035e+02
## InjuryNatureVision Loss                                                  5.446e+04
## BodyPartRegionLower Extremities                                          1.748e+04
## BodyPartRegionMultiple Body Parts                                        2.913e+05
## BodyPartRegionNeck                                                       5.097e+04
## BodyPartRegionNon-Standard Code                                          5.759e+03
## BodyPartRegionTrunk                                                      8.666e+03
## BodyPartRegionUpper Extremities                                          1.304e+04
## BodyPartAnkle                                                           -6.760e+03
## BodyPartArtificial Appliance                                            -2.843e+05
## BodyPartBody Systems and Multiple Body Systems                          -2.765e+05
## BodyPartBrain                                                            4.126e+05
## BodyPartButtocks                                                         1.879e+04
## BodyPartChest                                                            3.892e+03
## BodyPartDisc-Trunk                                                       1.761e+04
## BodyPartEar(S)                                                           1.043e+04
## BodyPartElbow                                                           -1.760e+02
## BodyPartEyes                                                             1.369e+04
## BodyPartFacial Bones                                                     1.372e+04
## BodyPartFinger(S)                                                       -2.799e+03
## BodyPartFoot                                                            -8.480e+03
## BodyPartGreat Toe                                                       -8.733e+03
## BodyPartHand                                                            -2.864e+03
## BodyPartHeart                                                            6.144e+03
## BodyPartHip                                                              6.854e+03
## BodyPartInsufficient Info to Properly Identify?Unclassified             -2.826e+05
## BodyPartInternal Organs                                                  1.228e+04
## BodyPartKnee                                                            -1.194e+03
## BodyPartLarynx                                                          -8.529e+04
## BodyPartLower Arm                                                       -2.674e+03
## BodyPartLower Back Area                                                  2.532e+04
## BodyPartLower Leg                                                       -5.612e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              1.772e+04
## BodyPartLungs                                                           -4.964e+02
## BodyPartMouth                                                            1.350e+04
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     -2.711e+05
## BodyPartMultiple Head Injury                                             1.652e+04
## BodyPartMultiple Lower Extremities                                       1.911e+03
## BodyPartMultiple Neck Injury                                            -3.185e+04
## BodyPartMultiple Trunk                                                   6.008e+03
## BodyPartMultiple Upper Extremities                                       4.154e+03
## BodyPartNo Physical Injury                                              -2.756e+05
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             9.839e+03
## BodyPartPelvis                                                           7.507e+02
## BodyPartSacrum And Coccyx                                                1.936e+04
## BodyPartShoulder(S)                                                      6.654e+03
## BodyPartSkull                                                            4.699e+04
## BodyPartSoft Tissue-Head                                                -1.759e+04
## BodyPartSoft Tissue-Neck                                                -1.805e+04
## BodyPartSpinal Cord-Trunk                                                9.208e+04
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                           -2.801e+03
## BodyPartToes                                                            -8.322e+03
## BodyPartTrachea                                                         -5.600e+04
## BodyPartUpper Arm                                                        3.218e+03
## BodyPartUpper Back Area                                                  6.851e+03
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                       8.033e+00
##                                                                         Std. Error
## (Intercept)                                                              8.063e+04
## ClaimantAge_at_DOI                                                       4.036e+01
## GenderMale                                                               9.244e+02
## GenderNot Available                                                      8.412e+03
## ClaimantTypeMedical Only                                                 1.152e+03
## ClaimantTypeReport Only                                                  2.596e+03
## InjuryNatureAll Other Specific Injuries, Noc                             8.019e+04
## InjuryNatureAmputation                                                   8.502e+04
## InjuryNatureAngina Pectoris                                              9.965e+04
## InjuryNatureAsbestosis                                                   8.190e+04
## InjuryNatureAsphyxiation                                                 1.134e+05
## InjuryNatureBlack Lung                                                   1.134e+05
## InjuryNatureBurn                                                         8.029e+04
## InjuryNatureCancer                                                       8.962e+04
## InjuryNatureCarpal Tunnel Syndrome                                       8.036e+04
## InjuryNatureConcussion                                                   8.056e+04
## InjuryNatureContagious Disease                                           8.067e+04
## InjuryNatureContusion                                                    8.018e+04
## InjuryNatureCrushing                                                     8.045e+04
## InjuryNatureDermatitis                                                   8.026e+04
## InjuryNatureDislocation                                                  8.043e+04
## InjuryNatureDust Disease, NOC                                            9.279e+04
## InjuryNatureElectric Shock                                               8.116e+04
## InjuryNatureForeign Body                                                 8.024e+04
## InjuryNatureFracture                                                     8.022e+04
## InjuryNatureFreezing                                                     9.252e+04
## InjuryNatureHearing Loss Or Impairment                                   8.260e+04
## InjuryNatureHeat Prostration                                             8.102e+04
## InjuryNatureHernia                                                       8.088e+04
## InjuryNatureInfection                                                    8.057e+04
## InjuryNatureInflammation                                                 8.029e+04
## InjuryNatureLaceration                                                   8.019e+04
## InjuryNatureLoss of Hearing                                              8.309e+04
## InjuryNatureMental Disorder                                              8.799e+04
## InjuryNatureMental Stress                                                8.077e+04
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  8.279e+04
## InjuryNatureMultiple Physical Injuries Only                              8.025e+04
## InjuryNatureMyocardial Infarction                                        8.664e+04
## InjuryNatureNo Physical Injury                                           8.011e+04
## InjuryNatureNon-Standard Code                                            8.082e+04
## InjuryNatureNot Available                                                1.133e+05
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       8.081e+04
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              8.261e+04
## InjuryNaturePuncture                                                     8.020e+04
## InjuryNatureRadiation                                                    8.297e+04
## InjuryNatureRespiratory Disorders                                        8.038e+04
## InjuryNatureRupture                                                      8.119e+04
## InjuryNatureSeverance                                                    8.321e+04
## InjuryNatureSprain                                                       8.019e+04
## InjuryNatureStrain                                                       8.018e+04
## InjuryNatureSyncope                                                      8.093e+04
## InjuryNatureVascular                                                     1.132e+05
## InjuryNatureVDT-Related Disease                                          1.133e+05
## InjuryNatureVision Loss                                                  8.347e+04
## BodyPartRegionLower Extremities                                          9.834e+03
## BodyPartRegionMultiple Body Parts                                        3.140e+04
## BodyPartRegionNeck                                                       4.088e+04
## BodyPartRegionNon-Standard Code                                          1.367e+04
## BodyPartRegionTrunk                                                      9.718e+03
## BodyPartRegionUpper Extremities                                          8.743e+03
## BodyPartAnkle                                                            5.588e+03
## BodyPartArtificial Appliance                                             4.685e+04
## BodyPartBody Systems and Multiple Body Systems                           3.117e+04
## BodyPartBrain                                                            3.768e+04
## BodyPartButtocks                                                         9.258e+03
## BodyPartChest                                                            5.913e+03
## BodyPartDisc-Trunk                                                       7.302e+03
## BodyPartEar(S)                                                           1.227e+04
## BodyPartElbow                                                            4.234e+03
## BodyPartEyes                                                             8.927e+03
## BodyPartFacial Bones                                                     9.857e+03
## BodyPartFinger(S)                                                        2.933e+03
## BodyPartFoot                                                             5.699e+03
## BodyPartGreat Toe                                                        1.081e+04
## BodyPartHand                                                             2.960e+03
## BodyPartHeart                                                            3.530e+04
## BodyPartHip                                                              6.760e+03
## BodyPartInsufficient Info to Properly Identify?Unclassified              3.066e+04
## BodyPartInternal Organs                                                  1.275e+04
## BodyPartKnee                                                             5.259e+03
## BodyPartLarynx                                                           8.940e+04
## BodyPartLower Arm                                                        3.719e+03
## BodyPartLower Back Area                                                  4.984e+03
## BodyPartLower Leg                                                        5.884e+03
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)              5.937e+03
## BodyPartLungs                                                            9.118e+03
## BodyPartMouth                                                            1.054e+04
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      3.026e+04
## BodyPartMultiple Head Injury                                             8.836e+03
## BodyPartMultiple Lower Extremities                                       6.542e+03
## BodyPartMultiple Neck Injury                                             4.016e+04
## BodyPartMultiple Trunk                                                   1.184e+04
## BodyPartMultiple Upper Extremities                                       4.255e+03
## BodyPartNo Physical Injury                                               3.086e+04
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                             1.060e+04
## BodyPartPelvis                                                           1.139e+04
## BodyPartSacrum And Coccyx                                                1.612e+04
## BodyPartShoulder(S)                                                      3.078e+03
## BodyPartSkull                                                            1.638e+04
## BodyPartSoft Tissue-Head                                                 8.066e+04
## BodyPartSoft Tissue-Neck                                                 4.032e+04
## BodyPartSpinal Cord-Trunk                                                1.418e+04
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                            3.799e+03
## BodyPartToes                                                             7.792e+03
## BodyPartTrachea                                                          5.036e+04
## BodyPartUpper Arm                                                        4.484e+03
## BodyPartUpper Back Area                                                  6.937e+03
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                       2.081e+00
##                                                                         t value
## (Intercept)                                                              -0.295
## ClaimantAge_at_DOI                                                        3.871
## GenderMale                                                                1.389
## GenderNot Available                                                       7.952
## ClaimantTypeMedical Only                                                -48.261
## ClaimantTypeReport Only                                                 -19.300
## InjuryNatureAll Other Specific Injuries, Noc                              0.707
## InjuryNatureAmputation                                                    0.468
## InjuryNatureAngina Pectoris                                              -0.034
## InjuryNatureAsbestosis                                                    0.783
## InjuryNatureAsphyxiation                                                  0.538
## InjuryNatureBlack Lung                                                    0.530
## InjuryNatureBurn                                                          0.725
## InjuryNatureCancer                                                        0.753
## InjuryNatureCarpal Tunnel Syndrome                                        0.494
## InjuryNatureConcussion                                                    1.057
## InjuryNatureContagious Disease                                            0.915
## InjuryNatureContusion                                                     0.662
## InjuryNatureCrushing                                                      0.706
## InjuryNatureDermatitis                                                    0.636
## InjuryNatureDislocation                                                   0.476
## InjuryNatureDust Disease, NOC                                             0.645
## InjuryNatureElectric Shock                                                0.788
## InjuryNatureForeign Body                                                  0.654
## InjuryNatureFracture                                                      0.624
## InjuryNatureFreezing                                                      0.512
## InjuryNatureHearing Loss Or Impairment                                    0.563
## InjuryNatureHeat Prostration                                              0.565
## InjuryNatureHernia                                                        0.285
## InjuryNatureInfection                                                     0.582
## InjuryNatureInflammation                                                  0.762
## InjuryNatureLaceration                                                    0.659
## InjuryNatureLoss of Hearing                                               0.513
## InjuryNatureMental Disorder                                              -0.435
## InjuryNatureMental Stress                                                 0.621
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.478
## InjuryNatureMultiple Physical Injuries Only                               0.740
## InjuryNatureMyocardial Infarction                                         0.370
## InjuryNatureNo Physical Injury                                            0.598
## InjuryNatureNon-Standard Code                                             0.462
## InjuryNatureNot Available                                                 0.467
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.715
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.562
## InjuryNaturePuncture                                                      0.666
## InjuryNatureRadiation                                                     0.661
## InjuryNatureRespiratory Disorders                                         0.633
## InjuryNatureRupture                                                       0.771
## InjuryNatureSeverance                                                     1.044
## InjuryNatureSprain                                                        0.653
## InjuryNatureStrain                                                        0.591
## InjuryNatureSyncope                                                       0.575
## InjuryNatureVascular                                                      0.002
## InjuryNatureVDT-Related Disease                                           0.005
## InjuryNatureVision Loss                                                   0.652
## BodyPartRegionLower Extremities                                           1.778
## BodyPartRegionMultiple Body Parts                                         9.277
## BodyPartRegionNeck                                                        1.247
## BodyPartRegionNon-Standard Code                                           0.421
## BodyPartRegionTrunk                                                       0.892
## BodyPartRegionUpper Extremities                                           1.491
## BodyPartAnkle                                                            -1.210
## BodyPartArtificial Appliance                                             -6.068
## BodyPartBody Systems and Multiple Body Systems                           -8.871
## BodyPartBrain                                                            10.951
## BodyPartButtocks                                                          2.030
## BodyPartChest                                                             0.658
## BodyPartDisc-Trunk                                                        2.412
## BodyPartEar(S)                                                            0.850
## BodyPartElbow                                                            -0.042
## BodyPartEyes                                                              1.534
## BodyPartFacial Bones                                                      1.392
## BodyPartFinger(S)                                                        -0.954
## BodyPartFoot                                                             -1.488
## BodyPartGreat Toe                                                        -0.808
## BodyPartHand                                                             -0.967
## BodyPartHeart                                                             0.174
## BodyPartHip                                                               1.014
## BodyPartInsufficient Info to Properly Identify?Unclassified              -9.218
## BodyPartInternal Organs                                                   0.964
## BodyPartKnee                                                             -0.227
## BodyPartLarynx                                                           -0.954
## BodyPartLower Arm                                                        -0.719
## BodyPartLower Back Area                                                   5.080
## BodyPartLower Leg                                                        -0.010
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               2.985
## BodyPartLungs                                                            -0.054
## BodyPartMouth                                                             1.281
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      -8.957
## BodyPartMultiple Head Injury                                              1.869
## BodyPartMultiple Lower Extremities                                        0.292
## BodyPartMultiple Neck Injury                                             -0.793
## BodyPartMultiple Trunk                                                    0.508
## BodyPartMultiple Upper Extremities                                        0.976
## BodyPartNo Physical Injury                                               -8.930
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                              0.929
## BodyPartPelvis                                                            0.066
## BodyPartSacrum And Coccyx                                                 1.201
## BodyPartShoulder(S)                                                       2.162
## BodyPartSkull                                                             2.868
## BodyPartSoft Tissue-Head                                                 -0.218
## BodyPartSoft Tissue-Neck                                                 -0.448
## BodyPartSpinal Cord-Trunk                                                 6.495
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                            -0.737
## BodyPartToes                                                             -1.068
## BodyPartTrachea                                                          -1.112
## BodyPartUpper Arm                                                         0.718
## BodyPartUpper Back Area                                                   0.988
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## AverageWeeklyWage1                                                        3.860
##                                                                         Pr(>|t|)
## (Intercept)                                                             0.768018
## ClaimantAge_at_DOI                                                      0.000109
## GenderMale                                                              0.164980
## GenderNot Available                                                     1.90e-15
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                  < 2e-16
## InjuryNatureAll Other Specific Injuries, Noc                            0.479316
## InjuryNatureAmputation                                                  0.639614
## InjuryNatureAngina Pectoris                                             0.972499
## InjuryNatureAsbestosis                                                  0.433548
## InjuryNatureAsphyxiation                                                0.590606
## InjuryNatureBlack Lung                                                  0.595936
## InjuryNatureBurn                                                        0.468425
## InjuryNatureCancer                                                      0.451230
## InjuryNatureCarpal Tunnel Syndrome                                      0.621353
## InjuryNatureConcussion                                                  0.290675
## InjuryNatureContagious Disease                                          0.360437
## InjuryNatureContusion                                                   0.507791
## InjuryNatureCrushing                                                    0.480165
## InjuryNatureDermatitis                                                  0.524685
## InjuryNatureDislocation                                                 0.634034
## InjuryNatureDust Disease, NOC                                           0.518712
## InjuryNatureElectric Shock                                              0.430906
## InjuryNatureForeign Body                                                0.513297
## InjuryNatureFracture                                                    0.532576
## InjuryNatureFreezing                                                    0.608538
## InjuryNatureHearing Loss Or Impairment                                  0.573195
## InjuryNatureHeat Prostration                                            0.572386
## InjuryNatureHernia                                                      0.775742
## InjuryNatureInfection                                                   0.560845
## InjuryNatureInflammation                                                0.446283
## InjuryNatureLaceration                                                  0.509641
## InjuryNatureLoss of Hearing                                             0.607631
## InjuryNatureMental Disorder                                             0.663656
## InjuryNatureMental Stress                                               0.534599
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.632666
## InjuryNatureMultiple Physical Injuries Only                             0.459316
## InjuryNatureMyocardial Infarction                                       0.711606
## InjuryNatureNo Physical Injury                                          0.549606
## InjuryNatureNon-Standard Code                                           0.643982
## InjuryNatureNot Available                                               0.640612
## InjuryNaturePoisoning?Chemical (Other Than Metals)                      0.474557
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)             0.573890
## InjuryNaturePuncture                                                    0.505543
## InjuryNatureRadiation                                                   0.508337
## InjuryNatureRespiratory Disorders                                       0.526623
## InjuryNatureRupture                                                     0.440943
## InjuryNatureSeverance                                                   0.296341
## InjuryNatureSprain                                                      0.513860
## InjuryNatureStrain                                                      0.554392
## InjuryNatureSyncope                                                     0.565167
## InjuryNatureVascular                                                    0.998477
## InjuryNatureVDT-Related Disease                                         0.995749
## InjuryNatureVision Loss                                                 0.514091
## BodyPartRegionLower Extremities                                         0.075477
## BodyPartRegionMultiple Body Parts                                        < 2e-16
## BodyPartRegionNeck                                                      0.212527
## BodyPartRegionNon-Standard Code                                         0.673656
## BodyPartRegionTrunk                                                     0.372556
## BodyPartRegionUpper Extremities                                         0.135999
## BodyPartAnkle                                                           0.226456
## BodyPartArtificial Appliance                                            1.31e-09
## BodyPartBody Systems and Multiple Body Systems                           < 2e-16
## BodyPartBrain                                                            < 2e-16
## BodyPartButtocks                                                        0.042366
## BodyPartChest                                                           0.510385
## BodyPartDisc-Trunk                                                      0.015884
## BodyPartEar(S)                                                          0.395371
## BodyPartElbow                                                           0.966846
## BodyPartEyes                                                            0.125140
## BodyPartFacial Bones                                                    0.164062
## BodyPartFinger(S)                                                       0.339968
## BodyPartFoot                                                            0.136747
## BodyPartGreat Toe                                                       0.419364
## BodyPartHand                                                            0.333304
## BodyPartHeart                                                           0.861813
## BodyPartHip                                                             0.310615
## BodyPartInsufficient Info to Properly Identify?Unclassified              < 2e-16
## BodyPartInternal Organs                                                 0.335180
## BodyPartKnee                                                            0.820407
## BodyPartLarynx                                                          0.340075
## BodyPartLower Arm                                                       0.472158
## BodyPartLower Back Area                                                 3.80e-07
## BodyPartLower Leg                                                       0.992390
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             0.002835
## BodyPartLungs                                                           0.956579
## BodyPartMouth                                                           0.200318
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      < 2e-16
## BodyPartMultiple Head Injury                                            0.061608
## BodyPartMultiple Lower Extremities                                      0.770137
## BodyPartMultiple Neck Injury                                            0.427779
## BodyPartMultiple Trunk                                                  0.611717
## BodyPartMultiple Upper Extremities                                      0.328914
## BodyPartNo Physical Injury                                               < 2e-16
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                            0.353155
## BodyPartPelvis                                                          0.947456
## BodyPartSacrum And Coccyx                                               0.229765
## BodyPartShoulder(S)                                                     0.030656
## BodyPartSkull                                                           0.004132
## BodyPartSoft Tissue-Head                                                0.827415
## BodyPartSoft Tissue-Neck                                                0.654345
## BodyPartSpinal Cord-Trunk                                               8.40e-11
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                           0.460854
## BodyPartToes                                                            0.285566
## BodyPartTrachea                                                         0.266149
## BodyPartUpper Arm                                                       0.472978
## BodyPartUpper Back Area                                                 0.323337
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## AverageWeeklyWage1                                                      0.000114
##                                                                            
## (Intercept)                                                                
## ClaimantAge_at_DOI                                                      ***
## GenderMale                                                                 
## GenderNot Available                                                     ***
## ClaimantTypeMedical Only                                                ***
## ClaimantTypeReport Only                                                 ***
## InjuryNatureAll Other Specific Injuries, Noc                               
## InjuryNatureAmputation                                                     
## InjuryNatureAngina Pectoris                                                
## InjuryNatureAsbestosis                                                     
## InjuryNatureAsphyxiation                                                   
## InjuryNatureBlack Lung                                                     
## InjuryNatureBurn                                                           
## InjuryNatureCancer                                                         
## 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                                                      
## InjuryNatureSprain                                                         
## InjuryNatureStrain                                                         
## InjuryNatureSyncope                                                        
## InjuryNatureVascular                                                       
## InjuryNatureVDT-Related Disease                                            
## 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                                                              
## AverageWeeklyWage1                                                      ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 79930 on 31511 degrees of freedom
## Multiple R-squared:  0.1034, Adjusted R-squared:  0.1004 
## F-statistic: 33.98 on 107 and 31511 DF,  p-value: < 2.2e-16

Consturir Modelo Predictivo

datos_nuevos <- data.frame(ClaimantAge_at_DOI = c(20, 30, 40, 50, 60, 70, 80) , Gender ="Male" ,ClaimantType ="Medical Only", InjuryNature = "Amputation", BodyPartRegion = "Multiple Body Parts", BodyPart = "Brain" , AverageWeeklyWage1 = 537)
predict(regresion,datos_nuevos)
## Warning in predict.lm(regresion, datos_nuevos): prediction from a rank-deficient
## fit may be misleading
##        1        2        3        4        5        6        7 
## 673115.3 674677.3 676239.3 677801.3 679363.3 680925.3 682487.3

Conclusion

La Regresión Lineal permite aproximar y entender la relación que se tiene entre variables dependiente e independientes. Cuando una variable se quiere predecir esa es la variable dependiente, en este caso se buscaba conocer los Costos Totales Incurrentes y se puso esa variable en la formula de regresión junto con todas las demás variables para de ese modo conocer cual o cuales de ellas perjudican o afectan los Costos Totales Incurrentes. Con esta formula logramos conocer las variables significativas e hicimos un modelo predictivo para extraer aquellos datos y variables que tienen mayor impacto en los Costos Totales Incurrentes.

También agregamos una columna llamada “Días de incapacidad” con el objetivo de de conocer cuantos días el empleado deja de trabajar ya que esto puede afectar en la efectividad de la empresa. Esa columna la creamos con las variables de la fecha de regreso al trabajo y la fecha de incidente. Con la regresión extraimos datos que indican que con personas de genero masculino de edades de 20 a 80 años con lesiones de amputaciones los gasots de la aseguradora incrementan conforme a los años comenzando con 673115.3 y para el 7mo año alcanzando 682487.3.

De este modo aprendimos y nos dimos cuenta que con esta herramienta somos capaces de extraer información y ver la revelancia y relación entre las variables.

LS0tCnRpdGxlOiA8c3BhbiBzdHlsZSA9ICJjb2xvcjpvcmFuZ2UiPioqU2VndXJvcyoqCmF1dGhvcjogIlZhbmVzc2EgRWxpem9uZG8gLSBBMDA4Mjc2NzIiCmRhdGU6ICIyMDIyLTA5LTA2IgpvdXRwdXQ6IAogIGh0bWxfZG9jdW1lbnQ6CiAgICB0aGVtZTogc2FuZHN0b25lCiAgICBoaWdobGlnaHQ6IHRhbmdvCiAgICB0b2M6IHRydWUKICAgIHRvY19mbG9hdDogdHJ1ZQogICAgY29kZV9kb3dubG9hZDogdHJ1ZQotLS0KPGltZyBzcmM9ICIvVXNlcnMvdmFuZXNzYWVsaXpvbmRvL0Rlc2t0b3AvVGVjL1NlbWVzdHJlIDcvRW50cmVnYSAzLjEvZm90b3Mvc2VndXJvcy5qcGVnIj4KCiMjIEltcG9ydGFyIGJhc2UgZGUgZGF0b3MKYGBge3J9CiNmaWxlLmNob29zZSgpCmJkIDwtIHJlYWQuY3N2ICgiL1VzZXJzL3ZhbmVzc2FlbGl6b25kby9EZXNrdG9wL1RlYy9TZW1lc3RyZSA3L0NTVi9zZWd1cm9zLmNzdiIpCmBgYAoKIyMgRW50ZW5kZXIgbGEgYmFzZSBkZSBkYXRvcwpgYGB7cn0KcmVzdW1lbiA8LSBzdW1tYXJ5KGJ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