Instalar programas requeridos

#install.packages("dplyr")
#install.packages("tidyverse")
#install.packages("janitor")
#install.packages("ggplot2")
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
library(tidyverse)
## ── Attaching packages
## ───────────────────────────────────────
## tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6     ✔ purrr   0.3.4
## ✔ tibble  3.1.8     ✔ stringr 1.4.1
## ✔ tidyr   1.2.1     ✔ forcats 0.5.2
## ✔ readr   2.1.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(janitor)
## 
## Attaching package: 'janitor'
## 
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(ggplot2)

Importar base de datos

seguros.db<-read.csv("/Users/daviddrums180/Desktop/seguros.csv")

Entender la base de datos

summary(seguros.db)
##     ClaimID           TotalPaid       TotalReserves     TotalRecovery      
##  Min.   :  777632   Min.   :      0   Min.   :      0   Min.   :     0.00  
##  1st Qu.:  800748   1st Qu.:     83   1st Qu.:      0   1st Qu.:     0.00  
##  Median :  812128   Median :    271   Median :      0   Median :     0.00  
##  Mean   : 1864676   Mean   :  10404   Mean   :   3368   Mean   :    66.05  
##  3rd Qu.:  824726   3rd Qu.:   1122   3rd Qu.:      0   3rd Qu.:     0.00  
##  Max.   :62203364   Max.   :4527291   Max.   :1529053   Max.   :100000.00  
##                                                                            
##  IndemnityPaid      OtherPaid       TotalIncurredCost ClaimStatus       
##  Min.   :     0   Min.   :      0   Min.   : -10400   Length:31619      
##  1st Qu.:     0   1st Qu.:     80   1st Qu.:     80   Class :character  
##  Median :     0   Median :    265   Median :    266   Mode  :character  
##  Mean   :  4977   Mean   :   5427   Mean   :  13706                     
##  3rd Qu.:     0   3rd Qu.:   1023   3rd Qu.:   1098                     
##  Max.   :640732   Max.   :4129915   Max.   :4734750                     
##                                                                         
##  IncidentDate       IncidentDescription ReturnToWorkDate   ClaimantOpenedDate
##  Length:31619       Length:31619        Length:31619       Length:31619      
##  Class :character   Class :character    Class :character   Class :character  
##  Mode  :character   Mode  :character    Mode  :character   Mode  :character  
##                                                                              
##                                                                              
##                                                                              
##                                                                              
##  ClaimantClosedDate EmployerNotificationDate ReceivedDate      
##  Length:31619       Length:31619             Length:31619      
##  Class :character   Class :character         Class :character  
##  Mode  :character   Mode  :character         Mode  :character  
##                                                                
##                                                                
##                                                                
##                                                                
##     IsDenied       Transaction_Time Procesing_Time     ClaimantAge_at_DOI
##  Min.   :0.00000   Min.   :    0    Min.   :    0.00   Min.   :14.0      
##  1st Qu.:0.00000   1st Qu.:  211    1st Qu.:    4.00   1st Qu.:33.0      
##  Median :0.00000   Median :  780    Median :   10.00   Median :42.0      
##  Mean   :0.04463   Mean   : 1004    Mean   :   62.99   Mean   :41.6      
##  3rd Qu.:0.00000   3rd Qu.: 1440    3rd Qu.:   24.00   3rd Qu.:50.0      
##  Max.   :1.00000   Max.   :16428    Max.   :11558.00   Max.   :94.0      
##                    NA's   :614                                           
##     Gender          ClaimantType       InjuryNature       BodyPartRegion    
##  Length:31619       Length:31619       Length:31619       Length:31619      
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    BodyPart         AverageWeeklyWage1    ClaimID1        BillReviewALE    
##  Length:31619       Min.   : 100.0     Min.   :  777632   Min.   : -448.0  
##  Class :character   1st Qu.: 492.0     1st Qu.:  800748   1st Qu.:   16.0  
##  Mode  :character   Median : 492.0     Median :  812128   Median :   24.0  
##                     Mean   : 536.5     Mean   : 1864676   Mean   :  188.7  
##                     3rd Qu.: 492.0     3rd Qu.:  824726   3rd Qu.:   64.1  
##                     Max.   :8613.5     Max.   :62203364   Max.   :46055.3  
##                                                           NA's   :14912    
##     Hospital         PhysicianOutpatient       Rx          
##  Min.   : -12570.4   Min.   :   -549.5   Min.   :  -160.7  
##  1st Qu.:    210.5   1st Qu.:    105.8   1st Qu.:    22.9  
##  Median :    613.9   Median :    218.0   Median :    61.5  
##  Mean   :   5113.2   Mean   :   1813.2   Mean   :  1695.2  
##  3rd Qu.:   2349.1   3rd Qu.:    680.6   3rd Qu.:   189.0  
##  Max.   :2759604.0   Max.   :1219766.6   Max.   :631635.5  
##  NA's   :19655       NA's   :2329        NA's   :20730

Graficas de conocimiento de costo contra edad

Grafica de dispersion de Edad vs Costo

plot(seguros.db$ClaimantAge_at_DOI,seguros.db$TotalIncurredCost)

## Grafica de caja y bigote de Edad

boxplot(seguros.db$ClaimantAge_at_DOI,horizontal=TRUE)

## Grafica de caja y bigote de Costo Incurrido

boxplot(seguros.db$TotalIncurredCost,horizontal=TRUE)

Generar Modelo Predictivo

1ra Regression Lineal

regresion <- lm(TotalIncurredCost ~ ClaimStatus+ClaimantAge_at_DOI+Gender+ClaimantType+InjuryNature+BodyPartRegion+BodyPart+AverageWeeklyWage1, data = seguros.db)
summary(regresion)
## 
## Call:
## lm(formula = TotalIncurredCost ~ ClaimStatus + ClaimantAge_at_DOI + 
##     Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + 
##     AverageWeeklyWage1, data = seguros.db)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -546912   -4781      51    2867 4398247 
## 
## Coefficients: (6 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                             -12054.839
## ClaimStatusO                                                            458989.520
## ClaimStatusR                                                            302807.718
## ClaimantAge_at_DOI                                                          37.378
## GenderMale                                                                 497.091
## GenderNot Available                                                      24957.283
## ClaimantTypeMedical Only                                                -23109.035
## ClaimantTypeReport Only                                                 -21574.350
## InjuryNatureAll Other Specific Injuries, Noc                             27713.829
## InjuryNatureAmputation                                                   -3826.157
## InjuryNatureAngina Pectoris                                              -5254.722
## InjuryNatureAsbestosis                                                   42863.800
## InjuryNatureAsphyxiation                                                 24525.019
## InjuryNatureBlack Lung                                                   24364.011
## InjuryNatureBurn                                                         24858.027
## InjuryNatureCancer                                                       47168.680
## InjuryNatureCarpal Tunnel Syndrome                                       15722.832
## InjuryNatureConcussion                                                   39888.060
## InjuryNatureContagious Disease                                           32615.179
## InjuryNatureContusion                                                    22237.690
## InjuryNatureCrushing                                                     26136.504
## InjuryNatureDermatitis                                                   20096.673
## InjuryNatureDislocation                                                  13347.595
## InjuryNatureDust Disease, NOC                                            24112.838
## InjuryNatureElectric Shock                                               11309.135
## InjuryNatureForeign Body                                                 23317.610
## InjuryNatureFracture                                                     24799.266
## InjuryNatureFreezing                                                     21727.381
## InjuryNatureHearing Loss Or Impairment                                   12201.392
## InjuryNatureHeat Prostration                                             20127.370
## InjuryNatureHernia                                                       13169.363
## InjuryNatureInfection                                                    20288.423
## InjuryNatureInflammation                                                 22854.318
## InjuryNatureLaceration                                                   21814.054
## InjuryNatureLoss of Hearing                                              20597.191
## InjuryNatureMental Disorder                                             -10131.023
## InjuryNatureMental Stress                                                 3240.846
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  32007.981
## InjuryNatureMultiple Physical Injuries Only                              24061.453
## InjuryNatureMyocardial Infarction                                        17222.119
## InjuryNatureNo Physical Injury                                           19785.111
## InjuryNatureNon-Standard Code                                            20667.206
## InjuryNatureNot Available                                                22963.260
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       18153.906
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              18305.539
## InjuryNaturePuncture                                                     21508.432
## InjuryNatureRadiation                                                    31294.533
## InjuryNatureRespiratory Disorders                                        22596.184
## InjuryNatureRupture                                                      16321.835
## InjuryNatureSeverance                                                    33982.474
## InjuryNatureSprain                                                       21123.851
## InjuryNatureStrain                                                       18701.276
## InjuryNatureSyncope                                                      23598.587
## InjuryNatureVascular                                                      2434.048
## InjuryNatureVDT-Related Disease                                          -1629.459
## InjuryNatureVision Loss                                                  24461.732
## BodyPartRegionLower Extremities                                          10938.761
## BodyPartRegionMultiple Body Parts                                        54560.501
## BodyPartRegionNeck                                                       75647.117
## BodyPartRegionNon-Standard Code                                           1292.662
## BodyPartRegionTrunk                                                       7224.490
## BodyPartRegionUpper Extremities                                           7402.627
## BodyPartAnkle                                                            -5750.330
## BodyPartArtificial Appliance                                            -48342.728
## BodyPartBody Systems and Multiple Body Systems                          -49757.464
## BodyPartBrain                                                           282874.852
## BodyPartButtocks                                                          4216.771
## BodyPartChest                                                             1922.942
## BodyPartDisc-Trunk                                                        4030.697
## BodyPartEar(S)                                                            6400.452
## BodyPartElbow                                                             1660.272
## BodyPartEyes                                                              6040.248
## BodyPartFacial Bones                                                      8016.966
## BodyPartFinger(S)                                                         -853.203
## BodyPartFoot                                                             -4966.957
## BodyPartGreat Toe                                                        -5528.886
## BodyPartHand                                                              -490.414
## BodyPartHeart                                                             8496.081
## BodyPartHip                                                               6930.183
## BodyPartInsufficient Info to Properly Identify?Unclassified             -49263.993
## BodyPartInternal Organs                                                  -1474.355
## BodyPartKnee                                                             -2328.976
## BodyPartLarynx                                                          -84313.406
## BodyPartLower Arm                                                         -647.651
## BodyPartLower Back Area                                                   9490.350
## BodyPartLower Leg                                                         2723.705
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               4730.038
## BodyPartLungs                                                             -923.554
## BodyPartMouth                                                             6927.317
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     -42263.554
## BodyPartMultiple Head Injury                                              9744.197
## BodyPartMultiple Lower Extremities                                        2213.054
## BodyPartMultiple Neck Injury                                            -66671.905
## BodyPartMultiple Trunk                                                   -2734.663
## BodyPartMultiple Upper Extremities                                        1133.997
## BodyPartNo Physical Injury                                              -44122.838
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                              7775.369
## BodyPartPelvis                                                            3590.250
## BodyPartSacrum And Coccyx                                                 9105.332
## BodyPartShoulder(S)                                                       1336.918
## BodyPartSkull                                                            35455.585
## BodyPartSoft Tissue-Head                                                  9000.027
## BodyPartSoft Tissue-Neck                                                -67926.613
## BodyPartSpinal Cord-Trunk                                                59992.020
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                                9.964
## BodyPartToes                                                             -6786.988
## BodyPartTrachea                                                         -75037.299
## BodyPartUpper Arm                                                         5418.842
## BodyPartUpper Back Area                                                   2389.807
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                           5.501
##                                                                         Std. Error
## (Intercept)                                                              59426.111
## ClaimStatusO                                                              3120.185
## ClaimStatusR                                                              3956.989
## ClaimantAge_at_DOI                                                          29.752
## GenderMale                                                                 681.311
## GenderNot Available                                                       6205.116
## ClaimantTypeMedical Only                                                   872.976
## ClaimantTypeReport Only                                                   1922.056
## InjuryNatureAll Other Specific Injuries, Noc                             59103.389
## InjuryNatureAmputation                                                   62662.181
## InjuryNatureAngina Pectoris                                              73442.404
## InjuryNatureAsbestosis                                                   60362.571
## InjuryNatureAsphyxiation                                                 83605.038
## InjuryNatureBlack Lung                                                   83605.036
## InjuryNatureBurn                                                         59175.544
## InjuryNatureCancer                                                       66048.075
## InjuryNatureCarpal Tunnel Syndrome                                       59224.143
## InjuryNatureConcussion                                                   59375.338
## InjuryNatureContagious Disease                                           59451.697
## InjuryNatureContusion                                                    59091.930
## InjuryNatureCrushing                                                     59293.651
## InjuryNatureDermatitis                                                   59151.312
## InjuryNatureDislocation                                                  59277.996
## InjuryNatureDust Disease, NOC                                            68385.376
## InjuryNatureElectric Shock                                               59818.410
## InjuryNatureForeign Body                                                 59135.755
## InjuryNatureFracture                                                     59121.418
## InjuryNatureFreezing                                                     68187.869
## InjuryNatureHearing Loss Or Impairment                                   60881.236
## InjuryNatureHeat Prostration                                             59711.631
## InjuryNatureHernia                                                       59609.907
## InjuryNatureInfection                                                    59379.617
## InjuryNatureInflammation                                                 59173.881
## InjuryNatureLaceration                                                   59103.896
## InjuryNatureLoss of Hearing                                              61237.376
## InjuryNatureMental Disorder                                              64852.413
## InjuryNatureMental Stress                                                59527.967
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  61013.876
## InjuryNatureMultiple Physical Injuries Only                              59143.820
## InjuryNatureMyocardial Infarction                                        63855.117
## InjuryNatureNo Physical Injury                                           59040.408
## InjuryNatureNon-Standard Code                                            59562.707
## InjuryNatureNot Available                                                83468.706
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       59556.210
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              60882.029
## InjuryNaturePuncture                                                     59111.027
## InjuryNatureRadiation                                                    61153.103
## InjuryNatureRespiratory Disorders                                        59240.361
## InjuryNatureRupture                                                      59838.725
## InjuryNatureSeverance                                                    61328.003
## InjuryNatureSprain                                                       59104.309
## InjuryNatureStrain                                                       59093.460
## InjuryNatureSyncope                                                      59646.978
## InjuryNatureVascular                                                     83455.009
## InjuryNatureVDT-Related Disease                                          83481.939
## InjuryNatureVision Loss                                                  61517.923
## BodyPartRegionLower Extremities                                           7247.724
## BodyPartRegionMultiple Body Parts                                        23202.076
## BodyPartRegionNeck                                                       30132.665
## BodyPartRegionNon-Standard Code                                          10078.182
## BodyPartRegionTrunk                                                       7162.505
## BodyPartRegionUpper Extremities                                           6443.987
## BodyPartAnkle                                                             4118.764
## BodyPartArtificial Appliance                                             34571.995
## BodyPartBody Systems and Multiple Body Systems                           23027.030
## BodyPartBrain                                                            27785.215
## BodyPartButtocks                                                          6823.854
## BodyPartChest                                                             4357.965
## BodyPartDisc-Trunk                                                        5382.643
## BodyPartEar(S)                                                            9042.399
## BodyPartElbow                                                             3120.339
## BodyPartEyes                                                              6579.578
## BodyPartFacial Bones                                                      7264.551
## BodyPartFinger(S)                                                         2161.932
## BodyPartFoot                                                              4200.107
## BodyPartGreat Toe                                                         7969.989
## BodyPartHand                                                              2181.759
## BodyPartHeart                                                            26013.809
## BodyPartHip                                                               4982.332
## BodyPartInsufficient Info to Properly Identify?Unclassified              22655.125
## BodyPartInternal Organs                                                   9394.449
## BodyPartKnee                                                              3875.638
## BodyPartLarynx                                                           65890.327
## BodyPartLower Arm                                                         2740.803
## BodyPartLower Back Area                                                   3674.188
## BodyPartLower Leg                                                         4336.445
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               4376.302
## BodyPartLungs                                                             6719.828
## BodyPartMouth                                                             7769.960
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      22361.391
## BodyPartMultiple Head Injury                                              6512.187
## BodyPartMultiple Lower Extremities                                        4821.370
## BodyPartMultiple Neck Injury                                             29601.268
## BodyPartMultiple Trunk                                                    8723.523
## BodyPartMultiple Upper Extremities                                        3136.065
## BodyPartNo Physical Injury                                               22804.174
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                              7809.752
## BodyPartPelvis                                                            8395.431
## BodyPartSacrum And Coccyx                                                11879.447
## BodyPartShoulder(S)                                                       2268.815
## BodyPartSkull                                                            12075.446
## BodyPartSoft Tissue-Head                                                 59447.943
## BodyPartSoft Tissue-Neck                                                 29720.306
## BodyPartSpinal Cord-Trunk                                                10450.615
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                             2799.774
## BodyPartToes                                                              5743.065
## BodyPartTrachea                                                          37113.318
## BodyPartUpper Arm                                                         3304.575
## BodyPartUpper Back Area                                                   5112.680
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                           1.534
##                                                                         t value
## (Intercept)                                                              -0.203
## ClaimStatusO                                                            147.103
## ClaimStatusR                                                             76.525
## ClaimantAge_at_DOI                                                        1.256
## GenderMale                                                                0.730
## GenderNot Available                                                       4.022
## ClaimantTypeMedical Only                                                -26.472
## ClaimantTypeReport Only                                                 -11.225
## InjuryNatureAll Other Specific Injuries, Noc                              0.469
## InjuryNatureAmputation                                                   -0.061
## InjuryNatureAngina Pectoris                                              -0.072
## InjuryNatureAsbestosis                                                    0.710
## InjuryNatureAsphyxiation                                                  0.293
## InjuryNatureBlack Lung                                                    0.291
## InjuryNatureBurn                                                          0.420
## InjuryNatureCancer                                                        0.714
## InjuryNatureCarpal Tunnel Syndrome                                        0.265
## InjuryNatureConcussion                                                    0.672
## InjuryNatureContagious Disease                                            0.549
## InjuryNatureContusion                                                     0.376
## InjuryNatureCrushing                                                      0.441
## InjuryNatureDermatitis                                                    0.340
## InjuryNatureDislocation                                                   0.225
## InjuryNatureDust Disease, NOC                                             0.353
## InjuryNatureElectric Shock                                                0.189
## InjuryNatureForeign Body                                                  0.394
## InjuryNatureFracture                                                      0.419
## InjuryNatureFreezing                                                      0.319
## InjuryNatureHearing Loss Or Impairment                                    0.200
## InjuryNatureHeat Prostration                                              0.337
## InjuryNatureHernia                                                        0.221
## InjuryNatureInfection                                                     0.342
## InjuryNatureInflammation                                                  0.386
## InjuryNatureLaceration                                                    0.369
## InjuryNatureLoss of Hearing                                               0.336
## InjuryNatureMental Disorder                                              -0.156
## InjuryNatureMental Stress                                                 0.054
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.525
## InjuryNatureMultiple Physical Injuries Only                               0.407
## InjuryNatureMyocardial Infarction                                         0.270
## InjuryNatureNo Physical Injury                                            0.335
## InjuryNatureNon-Standard Code                                             0.347
## InjuryNatureNot Available                                                 0.275
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.305
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.301
## InjuryNaturePuncture                                                      0.364
## InjuryNatureRadiation                                                     0.512
## InjuryNatureRespiratory Disorders                                         0.381
## InjuryNatureRupture                                                       0.273
## InjuryNatureSeverance                                                     0.554
## InjuryNatureSprain                                                        0.357
## InjuryNatureStrain                                                        0.316
## InjuryNatureSyncope                                                       0.396
## InjuryNatureVascular                                                      0.029
## InjuryNatureVDT-Related Disease                                          -0.020
## InjuryNatureVision Loss                                                   0.398
## BodyPartRegionLower Extremities                                           1.509
## BodyPartRegionMultiple Body Parts                                         2.352
## BodyPartRegionNeck                                                        2.510
## BodyPartRegionNon-Standard Code                                           0.128
## BodyPartRegionTrunk                                                       1.009
## BodyPartRegionUpper Extremities                                           1.149
## BodyPartAnkle                                                            -1.396
## BodyPartArtificial Appliance                                             -1.398
## BodyPartBody Systems and Multiple Body Systems                           -2.161
## BodyPartBrain                                                            10.181
## BodyPartButtocks                                                          0.618
## BodyPartChest                                                             0.441
## BodyPartDisc-Trunk                                                        0.749
## BodyPartEar(S)                                                            0.708
## BodyPartElbow                                                             0.532
## BodyPartEyes                                                              0.918
## BodyPartFacial Bones                                                      1.104
## BodyPartFinger(S)                                                        -0.395
## BodyPartFoot                                                             -1.183
## BodyPartGreat Toe                                                        -0.694
## BodyPartHand                                                             -0.225
## BodyPartHeart                                                             0.327
## BodyPartHip                                                               1.391
## BodyPartInsufficient Info to Properly Identify?Unclassified              -2.175
## BodyPartInternal Organs                                                  -0.157
## BodyPartKnee                                                             -0.601
## BodyPartLarynx                                                           -1.280
## BodyPartLower Arm                                                        -0.236
## BodyPartLower Back Area                                                   2.583
## BodyPartLower Leg                                                         0.628
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               1.081
## BodyPartLungs                                                            -0.137
## BodyPartMouth                                                             0.892
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      -1.890
## BodyPartMultiple Head Injury                                              1.496
## BodyPartMultiple Lower Extremities                                        0.459
## BodyPartMultiple Neck Injury                                             -2.252
## BodyPartMultiple Trunk                                                   -0.313
## BodyPartMultiple Upper Extremities                                        0.362
## BodyPartNo Physical Injury                                               -1.935
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                              0.996
## BodyPartPelvis                                                            0.428
## BodyPartSacrum And Coccyx                                                 0.766
## BodyPartShoulder(S)                                                       0.589
## BodyPartSkull                                                             2.936
## BodyPartSoft Tissue-Head                                                  0.151
## BodyPartSoft Tissue-Neck                                                 -2.286
## BodyPartSpinal Cord-Trunk                                                 5.741
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                             0.004
## BodyPartToes                                                             -1.182
## BodyPartTrachea                                                          -2.022
## BodyPartUpper Arm                                                         1.640
## BodyPartUpper Back Area                                                   0.467
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## AverageWeeklyWage1                                                        3.586
##                                                                         Pr(>|t|)
## (Intercept)                                                             0.839250
## ClaimStatusO                                                             < 2e-16
## ClaimStatusR                                                             < 2e-16
## ClaimantAge_at_DOI                                                      0.209008
## GenderMale                                                              0.465634
## GenderNot Available                                                     5.78e-05
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                  < 2e-16
## InjuryNatureAll Other Specific Injuries, Noc                            0.639141
## InjuryNatureAmputation                                                  0.951312
## InjuryNatureAngina Pectoris                                             0.942961
## InjuryNatureAsbestosis                                                  0.477644
## InjuryNatureAsphyxiation                                                0.769261
## InjuryNatureBlack Lung                                                  0.770734
## InjuryNatureBurn                                                        0.674435
## InjuryNatureCancer                                                      0.475136
## InjuryNatureCarpal Tunnel Syndrome                                      0.790641
## InjuryNatureConcussion                                                  0.501719
## InjuryNatureContagious Disease                                          0.583284
## InjuryNatureContusion                                                   0.706679
## InjuryNatureCrushing                                                    0.659363
## InjuryNatureDermatitis                                                  0.734047
## InjuryNatureDislocation                                                 0.821849
## InjuryNatureDust Disease, NOC                                           0.724389
## InjuryNatureElectric Shock                                              0.850049
## InjuryNatureForeign Body                                                0.693357
## InjuryNatureFracture                                                    0.674880
## InjuryNatureFreezing                                                    0.750002
## InjuryNatureHearing Loss Or Impairment                                  0.841159
## InjuryNatureHeat Prostration                                            0.736062
## InjuryNatureHernia                                                      0.825152
## InjuryNatureInfection                                                   0.732599
## InjuryNatureInflammation                                                0.699334
## InjuryNatureLaceration                                                  0.712071
## InjuryNatureLoss of Hearing                                             0.736609
## InjuryNatureMental Disorder                                             0.875863
## InjuryNatureMental Stress                                               0.956583
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.599864
## InjuryNatureMultiple Physical Injuries Only                             0.684136
## InjuryNatureMyocardial Infarction                                       0.787388
## InjuryNatureNo Physical Injury                                          0.737543
## InjuryNatureNon-Standard Code                                           0.728607
## InjuryNatureNot Available                                               0.783232
## InjuryNaturePoisoning?Chemical (Other Than Metals)                      0.760505
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)             0.763666
## InjuryNaturePuncture                                                    0.715961
## InjuryNatureRadiation                                                   0.608836
## InjuryNatureRespiratory Disorders                                       0.702885
## InjuryNatureRupture                                                     0.785037
## InjuryNatureSeverance                                                   0.579507
## InjuryNatureSprain                                                      0.720795
## InjuryNatureStrain                                                      0.751648
## InjuryNatureSyncope                                                     0.692375
## InjuryNatureVascular                                                    0.976732
## InjuryNatureVDT-Related Disease                                         0.984427
## InjuryNatureVision Loss                                                 0.690901
## BodyPartRegionLower Extremities                                         0.131240
## BodyPartRegionMultiple Body Parts                                       0.018702
## BodyPartRegionNeck                                                      0.012062
## BodyPartRegionNon-Standard Code                                         0.897941
## BodyPartRegionTrunk                                                     0.313148
## BodyPartRegionUpper Extremities                                         0.250662
## BodyPartAnkle                                                           0.162685
## BodyPartArtificial Appliance                                            0.162027
## BodyPartBody Systems and Multiple Body Systems                          0.030716
## BodyPartBrain                                                            < 2e-16
## BodyPartButtocks                                                        0.536616
## BodyPartChest                                                           0.659037
## BodyPartDisc-Trunk                                                      0.453964
## BodyPartEar(S)                                                          0.479058
## BodyPartElbow                                                           0.594674
## BodyPartEyes                                                            0.358610
## BodyPartFacial Bones                                                    0.269787
## BodyPartFinger(S)                                                       0.693105
## BodyPartFoot                                                            0.236985
## BodyPartGreat Toe                                                       0.487867
## BodyPartHand                                                            0.822153
## BodyPartHeart                                                           0.743973
## BodyPartHip                                                             0.164250
## BodyPartInsufficient Info to Properly Identify?Unclassified             0.029674
## BodyPartInternal Organs                                                 0.875294
## BodyPartKnee                                                            0.547893
## BodyPartLarynx                                                          0.200695
## BodyPartLower Arm                                                       0.813202
## BodyPartLower Back Area                                                 0.009800
## BodyPartLower Leg                                                       0.529945
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             0.279781
## BodyPartLungs                                                           0.890686
## BodyPartMouth                                                           0.372640
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     0.058764
## BodyPartMultiple Head Injury                                            0.134585
## BodyPartMultiple Lower Extremities                                      0.646231
## BodyPartMultiple Neck Injury                                            0.024308
## BodyPartMultiple Trunk                                                  0.753917
## BodyPartMultiple Upper Extremities                                      0.717654
## BodyPartNo Physical Injury                                              0.053017
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                            0.319453
## BodyPartPelvis                                                          0.668914
## BodyPartSacrum And Coccyx                                               0.443398
## BodyPartShoulder(S)                                                     0.555692
## BodyPartSkull                                                           0.003325
## BodyPartSoft Tissue-Head                                                0.879666
## BodyPartSoft Tissue-Neck                                                0.022288
## BodyPartSpinal Cord-Trunk                                               9.52e-09
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                           0.997160
## BodyPartToes                                                            0.237305
## BodyPartTrachea                                                         0.043201
## BodyPartUpper Arm                                                       0.101057
## BodyPartUpper Back Area                                                 0.640197
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## AverageWeeklyWage1                                                      0.000336
##                                                                            
## (Intercept)                                                                
## ClaimStatusO                                                            ***
## ClaimStatusR                                                            ***
## 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: 58910 on 31509 degrees of freedom
## Multiple R-squared:  0.513,  Adjusted R-squared:  0.5114 
## F-statistic: 304.6 on 109 and 31509 DF,  p-value: < 2.2e-16

2da Regression Lineal

regresion2 <- lm(TotalIncurredCost ~ ClaimantAge_at_DOI+Gender+ClaimantType+InjuryNature+BodyPartRegion+BodyPart+AverageWeeklyWage1, data = seguros.db)
summary(regresion)
## 
## Call:
## lm(formula = TotalIncurredCost ~ ClaimStatus + ClaimantAge_at_DOI + 
##     Gender + ClaimantType + InjuryNature + BodyPartRegion + BodyPart + 
##     AverageWeeklyWage1, data = seguros.db)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -546912   -4781      51    2867 4398247 
## 
## Coefficients: (6 not defined because of singularities)
##                                                                           Estimate
## (Intercept)                                                             -12054.839
## ClaimStatusO                                                            458989.520
## ClaimStatusR                                                            302807.718
## ClaimantAge_at_DOI                                                          37.378
## GenderMale                                                                 497.091
## GenderNot Available                                                      24957.283
## ClaimantTypeMedical Only                                                -23109.035
## ClaimantTypeReport Only                                                 -21574.350
## InjuryNatureAll Other Specific Injuries, Noc                             27713.829
## InjuryNatureAmputation                                                   -3826.157
## InjuryNatureAngina Pectoris                                              -5254.722
## InjuryNatureAsbestosis                                                   42863.800
## InjuryNatureAsphyxiation                                                 24525.019
## InjuryNatureBlack Lung                                                   24364.011
## InjuryNatureBurn                                                         24858.027
## InjuryNatureCancer                                                       47168.680
## InjuryNatureCarpal Tunnel Syndrome                                       15722.832
## InjuryNatureConcussion                                                   39888.060
## InjuryNatureContagious Disease                                           32615.179
## InjuryNatureContusion                                                    22237.690
## InjuryNatureCrushing                                                     26136.504
## InjuryNatureDermatitis                                                   20096.673
## InjuryNatureDislocation                                                  13347.595
## InjuryNatureDust Disease, NOC                                            24112.838
## InjuryNatureElectric Shock                                               11309.135
## InjuryNatureForeign Body                                                 23317.610
## InjuryNatureFracture                                                     24799.266
## InjuryNatureFreezing                                                     21727.381
## InjuryNatureHearing Loss Or Impairment                                   12201.392
## InjuryNatureHeat Prostration                                             20127.370
## InjuryNatureHernia                                                       13169.363
## InjuryNatureInfection                                                    20288.423
## InjuryNatureInflammation                                                 22854.318
## InjuryNatureLaceration                                                   21814.054
## InjuryNatureLoss of Hearing                                              20597.191
## InjuryNatureMental Disorder                                             -10131.023
## InjuryNatureMental Stress                                                 3240.846
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  32007.981
## InjuryNatureMultiple Physical Injuries Only                              24061.453
## InjuryNatureMyocardial Infarction                                        17222.119
## InjuryNatureNo Physical Injury                                           19785.111
## InjuryNatureNon-Standard Code                                            20667.206
## InjuryNatureNot Available                                                22963.260
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       18153.906
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              18305.539
## InjuryNaturePuncture                                                     21508.432
## InjuryNatureRadiation                                                    31294.533
## InjuryNatureRespiratory Disorders                                        22596.184
## InjuryNatureRupture                                                      16321.835
## InjuryNatureSeverance                                                    33982.474
## InjuryNatureSprain                                                       21123.851
## InjuryNatureStrain                                                       18701.276
## InjuryNatureSyncope                                                      23598.587
## InjuryNatureVascular                                                      2434.048
## InjuryNatureVDT-Related Disease                                          -1629.459
## InjuryNatureVision Loss                                                  24461.732
## BodyPartRegionLower Extremities                                          10938.761
## BodyPartRegionMultiple Body Parts                                        54560.501
## BodyPartRegionNeck                                                       75647.117
## BodyPartRegionNon-Standard Code                                           1292.662
## BodyPartRegionTrunk                                                       7224.490
## BodyPartRegionUpper Extremities                                           7402.627
## BodyPartAnkle                                                            -5750.330
## BodyPartArtificial Appliance                                            -48342.728
## BodyPartBody Systems and Multiple Body Systems                          -49757.464
## BodyPartBrain                                                           282874.852
## BodyPartButtocks                                                          4216.771
## BodyPartChest                                                             1922.942
## BodyPartDisc-Trunk                                                        4030.697
## BodyPartEar(S)                                                            6400.452
## BodyPartElbow                                                             1660.272
## BodyPartEyes                                                              6040.248
## BodyPartFacial Bones                                                      8016.966
## BodyPartFinger(S)                                                         -853.203
## BodyPartFoot                                                             -4966.957
## BodyPartGreat Toe                                                        -5528.886
## BodyPartHand                                                              -490.414
## BodyPartHeart                                                             8496.081
## BodyPartHip                                                               6930.183
## BodyPartInsufficient Info to Properly Identify?Unclassified             -49263.993
## BodyPartInternal Organs                                                  -1474.355
## BodyPartKnee                                                             -2328.976
## BodyPartLarynx                                                          -84313.406
## BodyPartLower Arm                                                         -647.651
## BodyPartLower Back Area                                                   9490.350
## BodyPartLower Leg                                                         2723.705
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               4730.038
## BodyPartLungs                                                             -923.554
## BodyPartMouth                                                             6927.317
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     -42263.554
## BodyPartMultiple Head Injury                                              9744.197
## BodyPartMultiple Lower Extremities                                        2213.054
## BodyPartMultiple Neck Injury                                            -66671.905
## BodyPartMultiple Trunk                                                   -2734.663
## BodyPartMultiple Upper Extremities                                        1133.997
## BodyPartNo Physical Injury                                              -44122.838
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                              7775.369
## BodyPartPelvis                                                            3590.250
## BodyPartSacrum And Coccyx                                                 9105.332
## BodyPartShoulder(S)                                                       1336.918
## BodyPartSkull                                                            35455.585
## BodyPartSoft Tissue-Head                                                  9000.027
## BodyPartSoft Tissue-Neck                                                -67926.613
## BodyPartSpinal Cord-Trunk                                                59992.020
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                                9.964
## BodyPartToes                                                             -6786.988
## BodyPartTrachea                                                         -75037.299
## BodyPartUpper Arm                                                         5418.842
## BodyPartUpper Back Area                                                   2389.807
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                           5.501
##                                                                         Std. Error
## (Intercept)                                                              59426.111
## ClaimStatusO                                                              3120.185
## ClaimStatusR                                                              3956.989
## ClaimantAge_at_DOI                                                          29.752
## GenderMale                                                                 681.311
## GenderNot Available                                                       6205.116
## ClaimantTypeMedical Only                                                   872.976
## ClaimantTypeReport Only                                                   1922.056
## InjuryNatureAll Other Specific Injuries, Noc                             59103.389
## InjuryNatureAmputation                                                   62662.181
## InjuryNatureAngina Pectoris                                              73442.404
## InjuryNatureAsbestosis                                                   60362.571
## InjuryNatureAsphyxiation                                                 83605.038
## InjuryNatureBlack Lung                                                   83605.036
## InjuryNatureBurn                                                         59175.544
## InjuryNatureCancer                                                       66048.075
## InjuryNatureCarpal Tunnel Syndrome                                       59224.143
## InjuryNatureConcussion                                                   59375.338
## InjuryNatureContagious Disease                                           59451.697
## InjuryNatureContusion                                                    59091.930
## InjuryNatureCrushing                                                     59293.651
## InjuryNatureDermatitis                                                   59151.312
## InjuryNatureDislocation                                                  59277.996
## InjuryNatureDust Disease, NOC                                            68385.376
## InjuryNatureElectric Shock                                               59818.410
## InjuryNatureForeign Body                                                 59135.755
## InjuryNatureFracture                                                     59121.418
## InjuryNatureFreezing                                                     68187.869
## InjuryNatureHearing Loss Or Impairment                                   60881.236
## InjuryNatureHeat Prostration                                             59711.631
## InjuryNatureHernia                                                       59609.907
## InjuryNatureInfection                                                    59379.617
## InjuryNatureInflammation                                                 59173.881
## InjuryNatureLaceration                                                   59103.896
## InjuryNatureLoss of Hearing                                              61237.376
## InjuryNatureMental Disorder                                              64852.413
## InjuryNatureMental Stress                                                59527.967
## InjuryNatureMultiple Injuries Including Both Physical and Psychological  61013.876
## InjuryNatureMultiple Physical Injuries Only                              59143.820
## InjuryNatureMyocardial Infarction                                        63855.117
## InjuryNatureNo Physical Injury                                           59040.408
## InjuryNatureNon-Standard Code                                            59562.707
## InjuryNatureNot Available                                                83468.706
## InjuryNaturePoisoning?Chemical (Other Than Metals)                       59556.210
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)              60882.029
## InjuryNaturePuncture                                                     59111.027
## InjuryNatureRadiation                                                    61153.103
## InjuryNatureRespiratory Disorders                                        59240.361
## InjuryNatureRupture                                                      59838.725
## InjuryNatureSeverance                                                    61328.003
## InjuryNatureSprain                                                       59104.309
## InjuryNatureStrain                                                       59093.460
## InjuryNatureSyncope                                                      59646.978
## InjuryNatureVascular                                                     83455.009
## InjuryNatureVDT-Related Disease                                          83481.939
## InjuryNatureVision Loss                                                  61517.923
## BodyPartRegionLower Extremities                                           7247.724
## BodyPartRegionMultiple Body Parts                                        23202.076
## BodyPartRegionNeck                                                       30132.665
## BodyPartRegionNon-Standard Code                                          10078.182
## BodyPartRegionTrunk                                                       7162.505
## BodyPartRegionUpper Extremities                                           6443.987
## BodyPartAnkle                                                             4118.764
## BodyPartArtificial Appliance                                             34571.995
## BodyPartBody Systems and Multiple Body Systems                           23027.030
## BodyPartBrain                                                            27785.215
## BodyPartButtocks                                                          6823.854
## BodyPartChest                                                             4357.965
## BodyPartDisc-Trunk                                                        5382.643
## BodyPartEar(S)                                                            9042.399
## BodyPartElbow                                                             3120.339
## BodyPartEyes                                                              6579.578
## BodyPartFacial Bones                                                      7264.551
## BodyPartFinger(S)                                                         2161.932
## BodyPartFoot                                                              4200.107
## BodyPartGreat Toe                                                         7969.989
## BodyPartHand                                                              2181.759
## BodyPartHeart                                                            26013.809
## BodyPartHip                                                               4982.332
## BodyPartInsufficient Info to Properly Identify?Unclassified              22655.125
## BodyPartInternal Organs                                                   9394.449
## BodyPartKnee                                                              3875.638
## BodyPartLarynx                                                           65890.327
## BodyPartLower Arm                                                         2740.803
## BodyPartLower Back Area                                                   3674.188
## BodyPartLower Leg                                                         4336.445
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               4376.302
## BodyPartLungs                                                             6719.828
## BodyPartMouth                                                             7769.960
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      22361.391
## BodyPartMultiple Head Injury                                              6512.187
## BodyPartMultiple Lower Extremities                                        4821.370
## BodyPartMultiple Neck Injury                                             29601.268
## BodyPartMultiple Trunk                                                    8723.523
## BodyPartMultiple Upper Extremities                                        3136.065
## BodyPartNo Physical Injury                                               22804.174
## BodyPartNon-Standard Code                                                       NA
## BodyPartNose                                                              7809.752
## BodyPartPelvis                                                            8395.431
## BodyPartSacrum And Coccyx                                                11879.447
## BodyPartShoulder(S)                                                       2268.815
## BodyPartSkull                                                            12075.446
## BodyPartSoft Tissue-Head                                                 59447.943
## BodyPartSoft Tissue-Neck                                                 29720.306
## BodyPartSpinal Cord-Trunk                                                10450.615
## BodyPartTeeth                                                                   NA
## BodyPartThumb                                                             2799.774
## BodyPartToes                                                              5743.065
## BodyPartTrachea                                                          37113.318
## BodyPartUpper Arm                                                         3304.575
## BodyPartUpper Back Area                                                   5112.680
## BodyPartUpper Leg                                                               NA
## BodyPartVertebrae                                                               NA
## BodyPartWhole Body                                                              NA
## BodyPartWrist                                                                   NA
## AverageWeeklyWage1                                                           1.534
##                                                                         t value
## (Intercept)                                                              -0.203
## ClaimStatusO                                                            147.103
## ClaimStatusR                                                             76.525
## ClaimantAge_at_DOI                                                        1.256
## GenderMale                                                                0.730
## GenderNot Available                                                       4.022
## ClaimantTypeMedical Only                                                -26.472
## ClaimantTypeReport Only                                                 -11.225
## InjuryNatureAll Other Specific Injuries, Noc                              0.469
## InjuryNatureAmputation                                                   -0.061
## InjuryNatureAngina Pectoris                                              -0.072
## InjuryNatureAsbestosis                                                    0.710
## InjuryNatureAsphyxiation                                                  0.293
## InjuryNatureBlack Lung                                                    0.291
## InjuryNatureBurn                                                          0.420
## InjuryNatureCancer                                                        0.714
## InjuryNatureCarpal Tunnel Syndrome                                        0.265
## InjuryNatureConcussion                                                    0.672
## InjuryNatureContagious Disease                                            0.549
## InjuryNatureContusion                                                     0.376
## InjuryNatureCrushing                                                      0.441
## InjuryNatureDermatitis                                                    0.340
## InjuryNatureDislocation                                                   0.225
## InjuryNatureDust Disease, NOC                                             0.353
## InjuryNatureElectric Shock                                                0.189
## InjuryNatureForeign Body                                                  0.394
## InjuryNatureFracture                                                      0.419
## InjuryNatureFreezing                                                      0.319
## InjuryNatureHearing Loss Or Impairment                                    0.200
## InjuryNatureHeat Prostration                                              0.337
## InjuryNatureHernia                                                        0.221
## InjuryNatureInfection                                                     0.342
## InjuryNatureInflammation                                                  0.386
## InjuryNatureLaceration                                                    0.369
## InjuryNatureLoss of Hearing                                               0.336
## InjuryNatureMental Disorder                                              -0.156
## InjuryNatureMental Stress                                                 0.054
## InjuryNatureMultiple Injuries Including Both Physical and Psychological   0.525
## InjuryNatureMultiple Physical Injuries Only                               0.407
## InjuryNatureMyocardial Infarction                                         0.270
## InjuryNatureNo Physical Injury                                            0.335
## InjuryNatureNon-Standard Code                                             0.347
## InjuryNatureNot Available                                                 0.275
## InjuryNaturePoisoning?Chemical (Other Than Metals)                        0.305
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)               0.301
## InjuryNaturePuncture                                                      0.364
## InjuryNatureRadiation                                                     0.512
## InjuryNatureRespiratory Disorders                                         0.381
## InjuryNatureRupture                                                       0.273
## InjuryNatureSeverance                                                     0.554
## InjuryNatureSprain                                                        0.357
## InjuryNatureStrain                                                        0.316
## InjuryNatureSyncope                                                       0.396
## InjuryNatureVascular                                                      0.029
## InjuryNatureVDT-Related Disease                                          -0.020
## InjuryNatureVision Loss                                                   0.398
## BodyPartRegionLower Extremities                                           1.509
## BodyPartRegionMultiple Body Parts                                         2.352
## BodyPartRegionNeck                                                        2.510
## BodyPartRegionNon-Standard Code                                           0.128
## BodyPartRegionTrunk                                                       1.009
## BodyPartRegionUpper Extremities                                           1.149
## BodyPartAnkle                                                            -1.396
## BodyPartArtificial Appliance                                             -1.398
## BodyPartBody Systems and Multiple Body Systems                           -2.161
## BodyPartBrain                                                            10.181
## BodyPartButtocks                                                          0.618
## BodyPartChest                                                             0.441
## BodyPartDisc-Trunk                                                        0.749
## BodyPartEar(S)                                                            0.708
## BodyPartElbow                                                             0.532
## BodyPartEyes                                                              0.918
## BodyPartFacial Bones                                                      1.104
## BodyPartFinger(S)                                                        -0.395
## BodyPartFoot                                                             -1.183
## BodyPartGreat Toe                                                        -0.694
## BodyPartHand                                                             -0.225
## BodyPartHeart                                                             0.327
## BodyPartHip                                                               1.391
## BodyPartInsufficient Info to Properly Identify?Unclassified              -2.175
## BodyPartInternal Organs                                                  -0.157
## BodyPartKnee                                                             -0.601
## BodyPartLarynx                                                           -1.280
## BodyPartLower Arm                                                        -0.236
## BodyPartLower Back Area                                                   2.583
## BodyPartLower Leg                                                         0.628
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)               1.081
## BodyPartLungs                                                            -0.137
## BodyPartMouth                                                             0.892
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)      -1.890
## BodyPartMultiple Head Injury                                              1.496
## BodyPartMultiple Lower Extremities                                        0.459
## BodyPartMultiple Neck Injury                                             -2.252
## BodyPartMultiple Trunk                                                   -0.313
## BodyPartMultiple Upper Extremities                                        0.362
## BodyPartNo Physical Injury                                               -1.935
## BodyPartNon-Standard Code                                                    NA
## BodyPartNose                                                              0.996
## BodyPartPelvis                                                            0.428
## BodyPartSacrum And Coccyx                                                 0.766
## BodyPartShoulder(S)                                                       0.589
## BodyPartSkull                                                             2.936
## BodyPartSoft Tissue-Head                                                  0.151
## BodyPartSoft Tissue-Neck                                                 -2.286
## BodyPartSpinal Cord-Trunk                                                 5.741
## BodyPartTeeth                                                                NA
## BodyPartThumb                                                             0.004
## BodyPartToes                                                             -1.182
## BodyPartTrachea                                                          -2.022
## BodyPartUpper Arm                                                         1.640
## BodyPartUpper Back Area                                                   0.467
## BodyPartUpper Leg                                                            NA
## BodyPartVertebrae                                                            NA
## BodyPartWhole Body                                                           NA
## BodyPartWrist                                                                NA
## AverageWeeklyWage1                                                        3.586
##                                                                         Pr(>|t|)
## (Intercept)                                                             0.839250
## ClaimStatusO                                                             < 2e-16
## ClaimStatusR                                                             < 2e-16
## ClaimantAge_at_DOI                                                      0.209008
## GenderMale                                                              0.465634
## GenderNot Available                                                     5.78e-05
## ClaimantTypeMedical Only                                                 < 2e-16
## ClaimantTypeReport Only                                                  < 2e-16
## InjuryNatureAll Other Specific Injuries, Noc                            0.639141
## InjuryNatureAmputation                                                  0.951312
## InjuryNatureAngina Pectoris                                             0.942961
## InjuryNatureAsbestosis                                                  0.477644
## InjuryNatureAsphyxiation                                                0.769261
## InjuryNatureBlack Lung                                                  0.770734
## InjuryNatureBurn                                                        0.674435
## InjuryNatureCancer                                                      0.475136
## InjuryNatureCarpal Tunnel Syndrome                                      0.790641
## InjuryNatureConcussion                                                  0.501719
## InjuryNatureContagious Disease                                          0.583284
## InjuryNatureContusion                                                   0.706679
## InjuryNatureCrushing                                                    0.659363
## InjuryNatureDermatitis                                                  0.734047
## InjuryNatureDislocation                                                 0.821849
## InjuryNatureDust Disease, NOC                                           0.724389
## InjuryNatureElectric Shock                                              0.850049
## InjuryNatureForeign Body                                                0.693357
## InjuryNatureFracture                                                    0.674880
## InjuryNatureFreezing                                                    0.750002
## InjuryNatureHearing Loss Or Impairment                                  0.841159
## InjuryNatureHeat Prostration                                            0.736062
## InjuryNatureHernia                                                      0.825152
## InjuryNatureInfection                                                   0.732599
## InjuryNatureInflammation                                                0.699334
## InjuryNatureLaceration                                                  0.712071
## InjuryNatureLoss of Hearing                                             0.736609
## InjuryNatureMental Disorder                                             0.875863
## InjuryNatureMental Stress                                               0.956583
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.599864
## InjuryNatureMultiple Physical Injuries Only                             0.684136
## InjuryNatureMyocardial Infarction                                       0.787388
## InjuryNatureNo Physical Injury                                          0.737543
## InjuryNatureNon-Standard Code                                           0.728607
## InjuryNatureNot Available                                               0.783232
## InjuryNaturePoisoning?Chemical (Other Than Metals)                      0.760505
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury)             0.763666
## InjuryNaturePuncture                                                    0.715961
## InjuryNatureRadiation                                                   0.608836
## InjuryNatureRespiratory Disorders                                       0.702885
## InjuryNatureRupture                                                     0.785037
## InjuryNatureSeverance                                                   0.579507
## InjuryNatureSprain                                                      0.720795
## InjuryNatureStrain                                                      0.751648
## InjuryNatureSyncope                                                     0.692375
## InjuryNatureVascular                                                    0.976732
## InjuryNatureVDT-Related Disease                                         0.984427
## InjuryNatureVision Loss                                                 0.690901
## BodyPartRegionLower Extremities                                         0.131240
## BodyPartRegionMultiple Body Parts                                       0.018702
## BodyPartRegionNeck                                                      0.012062
## BodyPartRegionNon-Standard Code                                         0.897941
## BodyPartRegionTrunk                                                     0.313148
## BodyPartRegionUpper Extremities                                         0.250662
## BodyPartAnkle                                                           0.162685
## BodyPartArtificial Appliance                                            0.162027
## BodyPartBody Systems and Multiple Body Systems                          0.030716
## BodyPartBrain                                                            < 2e-16
## BodyPartButtocks                                                        0.536616
## BodyPartChest                                                           0.659037
## BodyPartDisc-Trunk                                                      0.453964
## BodyPartEar(S)                                                          0.479058
## BodyPartElbow                                                           0.594674
## BodyPartEyes                                                            0.358610
## BodyPartFacial Bones                                                    0.269787
## BodyPartFinger(S)                                                       0.693105
## BodyPartFoot                                                            0.236985
## BodyPartGreat Toe                                                       0.487867
## BodyPartHand                                                            0.822153
## BodyPartHeart                                                           0.743973
## BodyPartHip                                                             0.164250
## BodyPartInsufficient Info to Properly Identify?Unclassified             0.029674
## BodyPartInternal Organs                                                 0.875294
## BodyPartKnee                                                            0.547893
## BodyPartLarynx                                                          0.200695
## BodyPartLower Arm                                                       0.813202
## BodyPartLower Back Area                                                 0.009800
## BodyPartLower Leg                                                       0.529945
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk)             0.279781
## BodyPartLungs                                                           0.890686
## BodyPartMouth                                                           0.372640
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts)     0.058764
## BodyPartMultiple Head Injury                                            0.134585
## BodyPartMultiple Lower Extremities                                      0.646231
## BodyPartMultiple Neck Injury                                            0.024308
## BodyPartMultiple Trunk                                                  0.753917
## BodyPartMultiple Upper Extremities                                      0.717654
## BodyPartNo Physical Injury                                              0.053017
## BodyPartNon-Standard Code                                                     NA
## BodyPartNose                                                            0.319453
## BodyPartPelvis                                                          0.668914
## BodyPartSacrum And Coccyx                                               0.443398
## BodyPartShoulder(S)                                                     0.555692
## BodyPartSkull                                                           0.003325
## BodyPartSoft Tissue-Head                                                0.879666
## BodyPartSoft Tissue-Neck                                                0.022288
## BodyPartSpinal Cord-Trunk                                               9.52e-09
## BodyPartTeeth                                                                 NA
## BodyPartThumb                                                           0.997160
## BodyPartToes                                                            0.237305
## BodyPartTrachea                                                         0.043201
## BodyPartUpper Arm                                                       0.101057
## BodyPartUpper Back Area                                                 0.640197
## BodyPartUpper Leg                                                             NA
## BodyPartVertebrae                                                             NA
## BodyPartWhole Body                                                            NA
## BodyPartWrist                                                                 NA
## AverageWeeklyWage1                                                      0.000336
##                                                                            
## (Intercept)                                                                
## ClaimStatusO                                                            ***
## ClaimStatusR                                                            ***
## 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: 58910 on 31509 degrees of freedom
## Multiple R-squared:  0.513,  Adjusted R-squared:  0.5114 
## F-statistic: 304.6 on 109 and 31509 DF,  p-value: < 2.2e-16

Construir el Modelo Predictivo

datos_nuevos <- data.frame(ClaimantAge_at_DOI=40,Gender="Male",ClaimantType="Medical Only",InjuryNature="Amputation",BodyPartRegion="Multiple Body Parts",BodyPart="Brain",AverageWeeklyWage1=537)
predict(regresion2,datos_nuevos)
## Warning in predict.lm(regresion2, datos_nuevos): prediction from a rank-
## deficient fit may be misleading
##        1 
## 676239.3