# file.choose()
bd <- read.csv("/Users/ivannagarza/Desktop/TEC/7 SEMESTRE/seguros.csv")# install.packages("janitor")
library("janitor")##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
bd<- clean_names(bd)resumen <- summary(bd)
resumen## claim_id total_paid total_reserves total_recovery
## 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
##
## indemnity_paid other_paid total_incurred_cost claim_status
## 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
##
## incident_date incident_description return_to_work_date
## Length:31619 Length:31619 Length:31619
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## claimant_opened_date claimant_closed_date employer_notification_date
## Length:31619 Length:31619 Length:31619
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
##
## received_date is_denied transaction_time procesing_time
## Length:31619 Min. :0.00000 Min. : 0 Min. : 0.00
## Class :character 1st Qu.:0.00000 1st Qu.: 211 1st Qu.: 4.00
## Mode :character Median :0.00000 Median : 780 Median : 10.00
## Mean :0.04463 Mean : 1004 Mean : 62.99
## 3rd Qu.:0.00000 3rd Qu.: 1440 3rd Qu.: 24.00
## Max. :1.00000 Max. :16428 Max. :11558.00
## NA's :614
## claimant_age_at_doi gender claimant_type injury_nature
## Min. :14.0 Length:31619 Length:31619 Length:31619
## 1st Qu.:33.0 Class :character Class :character Class :character
## Median :42.0 Mode :character Mode :character Mode :character
## Mean :41.6
## 3rd Qu.:50.0
## Max. :94.0
##
## body_part_region body_part average_weekly_wage1 claim_id1
## Length:31619 Length:31619 Min. : 100.0 Min. : 777632
## Class :character Class :character 1st Qu.: 492.0 1st Qu.: 800748
## Mode :character Mode :character Median : 492.0 Median : 812128
## Mean : 536.5 Mean : 1864676
## 3rd Qu.: 492.0 3rd Qu.: 824726
## Max. :8613.5 Max. :62203364
##
## bill_review_ale hospital physician_outpatient rx
## Min. : -448.0 Min. : -12570.4 Min. : -549.5 Min. : -160.7
## 1st Qu.: 16.0 1st Qu.: 210.5 1st Qu.: 105.8 1st Qu.: 22.9
## Median : 24.0 Median : 613.9 Median : 218.0 Median : 61.5
## Mean : 188.7 Mean : 5113.2 Mean : 1813.2 Mean : 1695.2
## 3rd Qu.: 64.1 3rd Qu.: 2349.1 3rd Qu.: 680.6 3rd Qu.: 189.0
## Max. :46055.3 Max. :2759604.0 Max. :1219766.6 Max. :631635.5
## NA's :14912 NA's :19655 NA's :2329 NA's :20730
library(dplyr)##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
count(bd,claimant_type, sort= TRUE)## claimant_type n
## 1 Medical Only 23073
## 2 Indemnity 7315
## 3 Report Only 1231
count(bd,injury_nature, sort = TRUE)## injury_nature n
## 1 Contusion 9087
## 2 Strain 8999
## 3 Sprain 2419
## 4 Laceration 2291
## 5 Puncture 1435
## 6 All Other Specific Injuries, Noc 1365
## 7 Fracture 889
## 8 Foreign Body 867
## 9 Non-Standard Code 685
## 10 Multiple Physical Injuries Only 547
## 11 Dermatitis 424
## 12 Inflammation 350
## 13 No Physical Injury 339
## 14 Burn 337
## 15 Respiratory Disorders 267
## 16 Carpal Tunnel Syndrome 224
## 17 Dislocation 155
## 18 Crushing 148
## 19 Concussion 105
## 20 Infection 101
## 21 Contagious Disease 73
## 22 Hernia 63
## 23 Poisoning?Chemical (Other Than Metals) 59
## 24 Mental Stress 49
## 25 Syncope 48
## 26 Heat Prostration 42
## 27 Electric Shock 39
## 28 Rupture 39
## 29 Asbestosis 23
## 30 Hearing Loss Or Impairment 20
## 31 Loss of Hearing 16
## 32 Poisoning?General (NOT OD or Cumulative Injury) 16
## 33 Multiple Injuries Including Both Physical and Psychological 15
## 34 Radiation 14
## 35 Myocardial Infarction 13
## 36 Severance 13
## 37 Vision Loss 12
## 38 Amputation 8
## 39 Mental Disorder 5
## 40 Cancer 4
## 41 Dust Disease, NOC 3
## 42 Freezing 3
## 43 Angina Pectoris 2
## 44 AIDS 1
## 45 Asphyxiation 1
## 46 Black Lung 1
## 47 Not Available 1
## 48 Vascular 1
## 49 VDT-Related Disease 1
count(bd,body_part_region,sort = TRUE)## body_part_region n
## 1 Upper Extremities 9927
## 2 Lower Extremities 7033
## 3 Trunk 5704
## 4 Multiple Body Parts 4237
## 5 Head 3120
## 6 Neck 971
## 7 Non-Standard Code 627
count(bd,body_part, sort = TRUE)## body_part n
## 1 Multiple Body Parts (Including Body Systems and Body Parts) 3542
## 2 Lower Back Area 3359
## 3 Knee 2904
## 4 Finger(S) 2287
## 5 Hand 1874
## 6 Shoulder(S) 1555
## 7 Ankle 1361
## 8 Wrist 1287
## 9 Eyes 1267
## 10 Multiple Head Injury 1040
## 11 Foot 907
## 12 Lower Arm 759
## 13 Thumb 727
## 14 Lower Leg 675
## 15 Multiple Neck Injury 668
## 16 Non-Standard Code 627
## 17 Chest 531
## 18 Lumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 518
## 19 Elbow 508
## 20 Multiple Upper Extremities 498
## 21 Upper Arm 432
## 22 Multiple Lower Extremities 364
## 23 Hip 315
## 24 Abdomen 310
## 25 No Physical Injury 294
## 26 Soft Tissue-Neck 291
## 27 Insufficient Info to Properly Identify?Unclassified 260
## 28 Upper Leg 255
## 29 Upper Back Area 253
## 30 Facial Bones 249
## 31 Disc-Trunk 208
## 32 Lungs 189
## 33 Toes 182
## 34 Mouth 162
## 35 Nose 153
## 36 Body Systems and Multiple Body Systems 129
## 37 Ear(S) 118
## 38 Buttocks 102
## 39 Teeth 92
## 40 Great Toe 70
## 41 Pelvis 59
## 42 Multiple Trunk 54
## 43 Internal Organs 46
## 44 Spinal Cord-Trunk 36
## 45 Skull 33
## 46 Sacrum And Coccyx 27
## 47 Heart 12
## 48 Trachea 7
## 49 Whole Body 7
## 50 Artificial Appliance 5
## 51 Brain 5
## 52 Vertebrae 4
## 53 Larynx 1
## 54 Soft Tissue-Head 1
regresion <-lm(total_incurred_cost ~ claimant_age_at_doi + gender + claimant_type + injury_nature + body_part_region + body_part + average_weekly_wage1, data = bd)
summary(regresion) ##
## Call:
## lm(formula = total_incurred_cost ~ claimant_age_at_doi + gender +
## claimant_type + injury_nature + body_part_region + body_part +
## average_weekly_wage1, data = bd)
##
## Residuals:
## Min 1Q Median 3Q Max
## -477362 -12697 -550 5168 4673472
##
## Coefficients: (6 not defined because of singularities)
## Estimate
## (Intercept) -2.378e+04
## claimant_age_at_doi 1.562e+02
## genderMale 1.284e+03
## genderNot Available 6.689e+04
## claimant_typeMedical Only -5.558e+04
## claimant_typeReport Only -5.011e+04
## injury_natureAll Other Specific Injuries, Noc 5.673e+04
## injury_natureAmputation 3.981e+04
## injury_natureAngina Pectoris -3.435e+03
## injury_natureAsbestosis 6.414e+04
## injury_natureAsphyxiation 6.103e+04
## injury_natureBlack Lung 6.015e+04
## injury_natureBurn 5.822e+04
## injury_natureCancer 6.751e+04
## injury_natureCarpal Tunnel Syndrome 3.969e+04
## injury_natureConcussion 8.513e+04
## injury_natureContagious Disease 7.377e+04
## injury_natureContusion 5.310e+04
## injury_natureCrushing 5.680e+04
## injury_natureDermatitis 5.106e+04
## injury_natureDislocation 3.829e+04
## injury_natureDust Disease, NOC 5.988e+04
## injury_natureElectric Shock 6.393e+04
## injury_natureForeign Body 5.245e+04
## injury_natureFracture 5.006e+04
## injury_natureFreezing 4.739e+04
## injury_natureHearing Loss Or Impairment 4.654e+04
## injury_natureHeat Prostration 4.574e+04
## injury_natureHernia 2.304e+04
## injury_natureInfection 4.686e+04
## injury_natureInflammation 6.115e+04
## injury_natureLaceration 5.288e+04
## injury_natureLoss of Hearing 4.266e+04
## injury_natureMental Disorder -3.827e+04
## injury_natureMental Stress 5.016e+04
## injury_natureMultiple Injuries Including Both Physical and Psychological 3.957e+04
## injury_natureMultiple Physical Injuries Only 5.938e+04
## injury_natureMyocardial Infarction 3.203e+04
## injury_natureNo Physical Injury 4.793e+04
## injury_natureNon-Standard Code 3.735e+04
## injury_natureNot Available 5.287e+04
## injury_naturePoisoning?Chemical (Other Than Metals) 5.778e+04
## injury_naturePoisoning?General (NOT OD or Cumulative Injury) 4.645e+04
## injury_naturePuncture 5.340e+04
## injury_natureRadiation 5.488e+04
## injury_natureRespiratory Disorders 5.089e+04
## injury_natureRupture 6.257e+04
## injury_natureSeverance 8.690e+04
## injury_natureSprain 5.235e+04
## injury_natureStrain 4.740e+04
## injury_natureSyncope 4.655e+04
## injury_natureVascular 2.162e+02
## injury_natureVDT-Related Disease 6.035e+02
## injury_natureVision Loss 5.446e+04
## body_part_regionLower Extremities 1.748e+04
## body_part_regionMultiple Body Parts 2.913e+05
## body_part_regionNeck 5.097e+04
## body_part_regionNon-Standard Code 5.759e+03
## body_part_regionTrunk 8.666e+03
## body_part_regionUpper Extremities 1.304e+04
## body_partAnkle -6.760e+03
## body_partArtificial Appliance -2.843e+05
## body_partBody Systems and Multiple Body Systems -2.765e+05
## body_partBrain 4.126e+05
## body_partButtocks 1.879e+04
## body_partChest 3.892e+03
## body_partDisc-Trunk 1.761e+04
## body_partEar(S) 1.043e+04
## body_partElbow -1.760e+02
## body_partEyes 1.369e+04
## body_partFacial Bones 1.372e+04
## body_partFinger(S) -2.799e+03
## body_partFoot -8.480e+03
## body_partGreat Toe -8.733e+03
## body_partHand -2.864e+03
## body_partHeart 6.144e+03
## body_partHip 6.854e+03
## body_partInsufficient Info to Properly Identify?Unclassified -2.826e+05
## body_partInternal Organs 1.228e+04
## body_partKnee -1.194e+03
## body_partLarynx -8.529e+04
## body_partLower Arm -2.674e+03
## body_partLower Back Area 2.532e+04
## body_partLower Leg -5.612e+01
## body_partLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 1.772e+04
## body_partLungs -4.964e+02
## body_partMouth 1.350e+04
## body_partMultiple Body Parts (Including Body Systems and Body Parts) -2.711e+05
## body_partMultiple Head Injury 1.652e+04
## body_partMultiple Lower Extremities 1.911e+03
## body_partMultiple Neck Injury -3.185e+04
## body_partMultiple Trunk 6.008e+03
## body_partMultiple Upper Extremities 4.154e+03
## body_partNo Physical Injury -2.756e+05
## body_partNon-Standard Code NA
## body_partNose 9.839e+03
## body_partPelvis 7.507e+02
## body_partSacrum And Coccyx 1.936e+04
## body_partShoulder(S) 6.654e+03
## body_partSkull 4.699e+04
## body_partSoft Tissue-Head -1.759e+04
## body_partSoft Tissue-Neck -1.805e+04
## body_partSpinal Cord-Trunk 9.208e+04
## body_partTeeth NA
## body_partThumb -2.801e+03
## body_partToes -8.322e+03
## body_partTrachea -5.600e+04
## body_partUpper Arm 3.218e+03
## body_partUpper Back Area 6.851e+03
## body_partUpper Leg NA
## body_partVertebrae NA
## body_partWhole Body NA
## body_partWrist NA
## average_weekly_wage1 8.033e+00
## Std. Error
## (Intercept) 8.063e+04
## claimant_age_at_doi 4.036e+01
## genderMale 9.244e+02
## genderNot Available 8.412e+03
## claimant_typeMedical Only 1.152e+03
## claimant_typeReport Only 2.596e+03
## injury_natureAll Other Specific Injuries, Noc 8.019e+04
## injury_natureAmputation 8.502e+04
## injury_natureAngina Pectoris 9.965e+04
## injury_natureAsbestosis 8.190e+04
## injury_natureAsphyxiation 1.134e+05
## injury_natureBlack Lung 1.134e+05
## injury_natureBurn 8.029e+04
## injury_natureCancer 8.962e+04
## injury_natureCarpal Tunnel Syndrome 8.036e+04
## injury_natureConcussion 8.056e+04
## injury_natureContagious Disease 8.067e+04
## injury_natureContusion 8.018e+04
## injury_natureCrushing 8.045e+04
## injury_natureDermatitis 8.026e+04
## injury_natureDislocation 8.043e+04
## injury_natureDust Disease, NOC 9.279e+04
## injury_natureElectric Shock 8.116e+04
## injury_natureForeign Body 8.024e+04
## injury_natureFracture 8.022e+04
## injury_natureFreezing 9.252e+04
## injury_natureHearing Loss Or Impairment 8.260e+04
## injury_natureHeat Prostration 8.102e+04
## injury_natureHernia 8.088e+04
## injury_natureInfection 8.057e+04
## injury_natureInflammation 8.029e+04
## injury_natureLaceration 8.019e+04
## injury_natureLoss of Hearing 8.309e+04
## injury_natureMental Disorder 8.799e+04
## injury_natureMental Stress 8.077e+04
## injury_natureMultiple Injuries Including Both Physical and Psychological 8.279e+04
## injury_natureMultiple Physical Injuries Only 8.025e+04
## injury_natureMyocardial Infarction 8.664e+04
## injury_natureNo Physical Injury 8.011e+04
## injury_natureNon-Standard Code 8.082e+04
## injury_natureNot Available 1.133e+05
## injury_naturePoisoning?Chemical (Other Than Metals) 8.081e+04
## injury_naturePoisoning?General (NOT OD or Cumulative Injury) 8.261e+04
## injury_naturePuncture 8.020e+04
## injury_natureRadiation 8.297e+04
## injury_natureRespiratory Disorders 8.038e+04
## injury_natureRupture 8.119e+04
## injury_natureSeverance 8.321e+04
## injury_natureSprain 8.019e+04
## injury_natureStrain 8.018e+04
## injury_natureSyncope 8.093e+04
## injury_natureVascular 1.132e+05
## injury_natureVDT-Related Disease 1.133e+05
## injury_natureVision Loss 8.347e+04
## body_part_regionLower Extremities 9.834e+03
## body_part_regionMultiple Body Parts 3.140e+04
## body_part_regionNeck 4.088e+04
## body_part_regionNon-Standard Code 1.367e+04
## body_part_regionTrunk 9.718e+03
## body_part_regionUpper Extremities 8.743e+03
## body_partAnkle 5.588e+03
## body_partArtificial Appliance 4.685e+04
## body_partBody Systems and Multiple Body Systems 3.117e+04
## body_partBrain 3.768e+04
## body_partButtocks 9.258e+03
## body_partChest 5.913e+03
## body_partDisc-Trunk 7.302e+03
## body_partEar(S) 1.227e+04
## body_partElbow 4.234e+03
## body_partEyes 8.927e+03
## body_partFacial Bones 9.857e+03
## body_partFinger(S) 2.933e+03
## body_partFoot 5.699e+03
## body_partGreat Toe 1.081e+04
## body_partHand 2.960e+03
## body_partHeart 3.530e+04
## body_partHip 6.760e+03
## body_partInsufficient Info to Properly Identify?Unclassified 3.066e+04
## body_partInternal Organs 1.275e+04
## body_partKnee 5.259e+03
## body_partLarynx 8.940e+04
## body_partLower Arm 3.719e+03
## body_partLower Back Area 4.984e+03
## body_partLower Leg 5.884e+03
## body_partLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 5.937e+03
## body_partLungs 9.118e+03
## body_partMouth 1.054e+04
## body_partMultiple Body Parts (Including Body Systems and Body Parts) 3.026e+04
## body_partMultiple Head Injury 8.836e+03
## body_partMultiple Lower Extremities 6.542e+03
## body_partMultiple Neck Injury 4.016e+04
## body_partMultiple Trunk 1.184e+04
## body_partMultiple Upper Extremities 4.255e+03
## body_partNo Physical Injury 3.086e+04
## body_partNon-Standard Code NA
## body_partNose 1.060e+04
## body_partPelvis 1.139e+04
## body_partSacrum And Coccyx 1.612e+04
## body_partShoulder(S) 3.078e+03
## body_partSkull 1.638e+04
## body_partSoft Tissue-Head 8.066e+04
## body_partSoft Tissue-Neck 4.032e+04
## body_partSpinal Cord-Trunk 1.418e+04
## body_partTeeth NA
## body_partThumb 3.799e+03
## body_partToes 7.792e+03
## body_partTrachea 5.036e+04
## body_partUpper Arm 4.484e+03
## body_partUpper Back Area 6.937e+03
## body_partUpper Leg NA
## body_partVertebrae NA
## body_partWhole Body NA
## body_partWrist NA
## average_weekly_wage1 2.081e+00
## t value
## (Intercept) -0.295
## claimant_age_at_doi 3.871
## genderMale 1.389
## genderNot Available 7.952
## claimant_typeMedical Only -48.261
## claimant_typeReport Only -19.300
## injury_natureAll Other Specific Injuries, Noc 0.707
## injury_natureAmputation 0.468
## injury_natureAngina Pectoris -0.034
## injury_natureAsbestosis 0.783
## injury_natureAsphyxiation 0.538
## injury_natureBlack Lung 0.530
## injury_natureBurn 0.725
## injury_natureCancer 0.753
## injury_natureCarpal Tunnel Syndrome 0.494
## injury_natureConcussion 1.057
## injury_natureContagious Disease 0.915
## injury_natureContusion 0.662
## injury_natureCrushing 0.706
## injury_natureDermatitis 0.636
## injury_natureDislocation 0.476
## injury_natureDust Disease, NOC 0.645
## injury_natureElectric Shock 0.788
## injury_natureForeign Body 0.654
## injury_natureFracture 0.624
## injury_natureFreezing 0.512
## injury_natureHearing Loss Or Impairment 0.563
## injury_natureHeat Prostration 0.565
## injury_natureHernia 0.285
## injury_natureInfection 0.582
## injury_natureInflammation 0.762
## injury_natureLaceration 0.659
## injury_natureLoss of Hearing 0.513
## injury_natureMental Disorder -0.435
## injury_natureMental Stress 0.621
## injury_natureMultiple Injuries Including Both Physical and Psychological 0.478
## injury_natureMultiple Physical Injuries Only 0.740
## injury_natureMyocardial Infarction 0.370
## injury_natureNo Physical Injury 0.598
## injury_natureNon-Standard Code 0.462
## injury_natureNot Available 0.467
## injury_naturePoisoning?Chemical (Other Than Metals) 0.715
## injury_naturePoisoning?General (NOT OD or Cumulative Injury) 0.562
## injury_naturePuncture 0.666
## injury_natureRadiation 0.661
## injury_natureRespiratory Disorders 0.633
## injury_natureRupture 0.771
## injury_natureSeverance 1.044
## injury_natureSprain 0.653
## injury_natureStrain 0.591
## injury_natureSyncope 0.575
## injury_natureVascular 0.002
## injury_natureVDT-Related Disease 0.005
## injury_natureVision Loss 0.652
## body_part_regionLower Extremities 1.778
## body_part_regionMultiple Body Parts 9.277
## body_part_regionNeck 1.247
## body_part_regionNon-Standard Code 0.421
## body_part_regionTrunk 0.892
## body_part_regionUpper Extremities 1.491
## body_partAnkle -1.210
## body_partArtificial Appliance -6.068
## body_partBody Systems and Multiple Body Systems -8.871
## body_partBrain 10.951
## body_partButtocks 2.030
## body_partChest 0.658
## body_partDisc-Trunk 2.412
## body_partEar(S) 0.850
## body_partElbow -0.042
## body_partEyes 1.534
## body_partFacial Bones 1.392
## body_partFinger(S) -0.954
## body_partFoot -1.488
## body_partGreat Toe -0.808
## body_partHand -0.967
## body_partHeart 0.174
## body_partHip 1.014
## body_partInsufficient Info to Properly Identify?Unclassified -9.218
## body_partInternal Organs 0.964
## body_partKnee -0.227
## body_partLarynx -0.954
## body_partLower Arm -0.719
## body_partLower Back Area 5.080
## body_partLower Leg -0.010
## body_partLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 2.985
## body_partLungs -0.054
## body_partMouth 1.281
## body_partMultiple Body Parts (Including Body Systems and Body Parts) -8.957
## body_partMultiple Head Injury 1.869
## body_partMultiple Lower Extremities 0.292
## body_partMultiple Neck Injury -0.793
## body_partMultiple Trunk 0.508
## body_partMultiple Upper Extremities 0.976
## body_partNo Physical Injury -8.930
## body_partNon-Standard Code NA
## body_partNose 0.929
## body_partPelvis 0.066
## body_partSacrum And Coccyx 1.201
## body_partShoulder(S) 2.162
## body_partSkull 2.868
## body_partSoft Tissue-Head -0.218
## body_partSoft Tissue-Neck -0.448
## body_partSpinal Cord-Trunk 6.495
## body_partTeeth NA
## body_partThumb -0.737
## body_partToes -1.068
## body_partTrachea -1.112
## body_partUpper Arm 0.718
## body_partUpper Back Area 0.988
## body_partUpper Leg NA
## body_partVertebrae NA
## body_partWhole Body NA
## body_partWrist NA
## average_weekly_wage1 3.860
## Pr(>|t|)
## (Intercept) 0.768018
## claimant_age_at_doi 0.000109
## genderMale 0.164980
## genderNot Available 1.90e-15
## claimant_typeMedical Only < 2e-16
## claimant_typeReport Only < 2e-16
## injury_natureAll Other Specific Injuries, Noc 0.479316
## injury_natureAmputation 0.639614
## injury_natureAngina Pectoris 0.972499
## injury_natureAsbestosis 0.433548
## injury_natureAsphyxiation 0.590606
## injury_natureBlack Lung 0.595936
## injury_natureBurn 0.468425
## injury_natureCancer 0.451230
## injury_natureCarpal Tunnel Syndrome 0.621353
## injury_natureConcussion 0.290675
## injury_natureContagious Disease 0.360437
## injury_natureContusion 0.507791
## injury_natureCrushing 0.480165
## injury_natureDermatitis 0.524685
## injury_natureDislocation 0.634034
## injury_natureDust Disease, NOC 0.518712
## injury_natureElectric Shock 0.430906
## injury_natureForeign Body 0.513297
## injury_natureFracture 0.532576
## injury_natureFreezing 0.608538
## injury_natureHearing Loss Or Impairment 0.573195
## injury_natureHeat Prostration 0.572386
## injury_natureHernia 0.775742
## injury_natureInfection 0.560845
## injury_natureInflammation 0.446283
## injury_natureLaceration 0.509641
## injury_natureLoss of Hearing 0.607631
## injury_natureMental Disorder 0.663656
## injury_natureMental Stress 0.534599
## injury_natureMultiple Injuries Including Both Physical and Psychological 0.632666
## injury_natureMultiple Physical Injuries Only 0.459316
## injury_natureMyocardial Infarction 0.711606
## injury_natureNo Physical Injury 0.549606
## injury_natureNon-Standard Code 0.643982
## injury_natureNot Available 0.640612
## injury_naturePoisoning?Chemical (Other Than Metals) 0.474557
## injury_naturePoisoning?General (NOT OD or Cumulative Injury) 0.573890
## injury_naturePuncture 0.505543
## injury_natureRadiation 0.508337
## injury_natureRespiratory Disorders 0.526623
## injury_natureRupture 0.440943
## injury_natureSeverance 0.296341
## injury_natureSprain 0.513860
## injury_natureStrain 0.554392
## injury_natureSyncope 0.565167
## injury_natureVascular 0.998477
## injury_natureVDT-Related Disease 0.995749
## injury_natureVision Loss 0.514091
## body_part_regionLower Extremities 0.075477
## body_part_regionMultiple Body Parts < 2e-16
## body_part_regionNeck 0.212527
## body_part_regionNon-Standard Code 0.673656
## body_part_regionTrunk 0.372556
## body_part_regionUpper Extremities 0.135999
## body_partAnkle 0.226456
## body_partArtificial Appliance 1.31e-09
## body_partBody Systems and Multiple Body Systems < 2e-16
## body_partBrain < 2e-16
## body_partButtocks 0.042366
## body_partChest 0.510385
## body_partDisc-Trunk 0.015884
## body_partEar(S) 0.395371
## body_partElbow 0.966846
## body_partEyes 0.125140
## body_partFacial Bones 0.164062
## body_partFinger(S) 0.339968
## body_partFoot 0.136747
## body_partGreat Toe 0.419364
## body_partHand 0.333304
## body_partHeart 0.861813
## body_partHip 0.310615
## body_partInsufficient Info to Properly Identify?Unclassified < 2e-16
## body_partInternal Organs 0.335180
## body_partKnee 0.820407
## body_partLarynx 0.340075
## body_partLower Arm 0.472158
## body_partLower Back Area 3.80e-07
## body_partLower Leg 0.992390
## body_partLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 0.002835
## body_partLungs 0.956579
## body_partMouth 0.200318
## body_partMultiple Body Parts (Including Body Systems and Body Parts) < 2e-16
## body_partMultiple Head Injury 0.061608
## body_partMultiple Lower Extremities 0.770137
## body_partMultiple Neck Injury 0.427779
## body_partMultiple Trunk 0.611717
## body_partMultiple Upper Extremities 0.328914
## body_partNo Physical Injury < 2e-16
## body_partNon-Standard Code NA
## body_partNose 0.353155
## body_partPelvis 0.947456
## body_partSacrum And Coccyx 0.229765
## body_partShoulder(S) 0.030656
## body_partSkull 0.004132
## body_partSoft Tissue-Head 0.827415
## body_partSoft Tissue-Neck 0.654345
## body_partSpinal Cord-Trunk 8.40e-11
## body_partTeeth NA
## body_partThumb 0.460854
## body_partToes 0.285566
## body_partTrachea 0.266149
## body_partUpper Arm 0.472978
## body_partUpper Back Area 0.323337
## body_partUpper Leg NA
## body_partVertebrae NA
## body_partWhole Body NA
## body_partWrist NA
## average_weekly_wage1 0.000114
##
## (Intercept)
## claimant_age_at_doi ***
## genderMale
## genderNot Available ***
## claimant_typeMedical Only ***
## claimant_typeReport Only ***
## injury_natureAll Other Specific Injuries, Noc
## injury_natureAmputation
## injury_natureAngina Pectoris
## injury_natureAsbestosis
## injury_natureAsphyxiation
## injury_natureBlack Lung
## injury_natureBurn
## injury_natureCancer
## injury_natureCarpal Tunnel Syndrome
## injury_natureConcussion
## injury_natureContagious Disease
## injury_natureContusion
## injury_natureCrushing
## injury_natureDermatitis
## injury_natureDislocation
## injury_natureDust Disease, NOC
## injury_natureElectric Shock
## injury_natureForeign Body
## injury_natureFracture
## injury_natureFreezing
## injury_natureHearing Loss Or Impairment
## injury_natureHeat Prostration
## injury_natureHernia
## injury_natureInfection
## injury_natureInflammation
## injury_natureLaceration
## injury_natureLoss of Hearing
## injury_natureMental Disorder
## injury_natureMental Stress
## injury_natureMultiple Injuries Including Both Physical and Psychological
## injury_natureMultiple Physical Injuries Only
## injury_natureMyocardial Infarction
## injury_natureNo Physical Injury
## injury_natureNon-Standard Code
## injury_natureNot Available
## injury_naturePoisoning?Chemical (Other Than Metals)
## injury_naturePoisoning?General (NOT OD or Cumulative Injury)
## injury_naturePuncture
## injury_natureRadiation
## injury_natureRespiratory Disorders
## injury_natureRupture
## injury_natureSeverance
## injury_natureSprain
## injury_natureStrain
## injury_natureSyncope
## injury_natureVascular
## injury_natureVDT-Related Disease
## injury_natureVision Loss
## body_part_regionLower Extremities .
## body_part_regionMultiple Body Parts ***
## body_part_regionNeck
## body_part_regionNon-Standard Code
## body_part_regionTrunk
## body_part_regionUpper Extremities
## body_partAnkle
## body_partArtificial Appliance ***
## body_partBody Systems and Multiple Body Systems ***
## body_partBrain ***
## body_partButtocks *
## body_partChest
## body_partDisc-Trunk *
## body_partEar(S)
## body_partElbow
## body_partEyes
## body_partFacial Bones
## body_partFinger(S)
## body_partFoot
## body_partGreat Toe
## body_partHand
## body_partHeart
## body_partHip
## body_partInsufficient Info to Properly Identify?Unclassified ***
## body_partInternal Organs
## body_partKnee
## body_partLarynx
## body_partLower Arm
## body_partLower Back Area ***
## body_partLower Leg
## body_partLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) **
## body_partLungs
## body_partMouth
## body_partMultiple Body Parts (Including Body Systems and Body Parts) ***
## body_partMultiple Head Injury .
## body_partMultiple Lower Extremities
## body_partMultiple Neck Injury
## body_partMultiple Trunk
## body_partMultiple Upper Extremities
## body_partNo Physical Injury ***
## body_partNon-Standard Code
## body_partNose
## body_partPelvis
## body_partSacrum And Coccyx
## body_partShoulder(S) *
## body_partSkull **
## body_partSoft Tissue-Head
## body_partSoft Tissue-Neck
## body_partSpinal Cord-Trunk ***
## body_partTeeth
## body_partThumb
## body_partToes
## body_partTrachea
## body_partUpper Arm
## body_partUpper Back Area
## body_partUpper Leg
## body_partVertebrae
## body_partWhole Body
## body_partWrist
## average_weekly_wage1 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 79930 on 31511 degrees of freedom
## Multiple R-squared: 0.1034, Adjusted R-squared: 0.1004
## F-statistic: 33.98 on 107 and 31511 DF, p-value: < 2.2e-16
datos_nuevos <- data.frame (claimant_age_at_doi = c(20,30,40,50,60,70,80,90) , gender = "Male" , claimant_type = "Medical Only" , injury_nature = "Amputation" , body_part_region = "Multiple Body Parts" , body_part = "Brain" , average_weekly_wage1 = 537)
datos_nuevos## claimant_age_at_doi gender claimant_type injury_nature body_part_region
## 1 20 Male Medical Only Amputation Multiple Body Parts
## 2 30 Male Medical Only Amputation Multiple Body Parts
## 3 40 Male Medical Only Amputation Multiple Body Parts
## 4 50 Male Medical Only Amputation Multiple Body Parts
## 5 60 Male Medical Only Amputation Multiple Body Parts
## 6 70 Male Medical Only Amputation Multiple Body Parts
## 7 80 Male Medical Only Amputation Multiple Body Parts
## 8 90 Male Medical Only Amputation Multiple Body Parts
## body_part average_weekly_wage1
## 1 Brain 537
## 2 Brain 537
## 3 Brain 537
## 4 Brain 537
## 5 Brain 537
## 6 Brain 537
## 7 Brain 537
## 8 Brain 537
predict(regresion,datos_nuevos)## Warning in predict.lm(regresion, datos_nuevos): prediction from a rank-deficient
## fit may be misleading
## 1 2 3 4 5 6 7 8
## 673115.3 674677.3 676239.3 677801.3 679363.3 680925.3 682487.3 684049.4
El propósito de este código de R es realizar un modelo predictivo, el cual es una herramienta estadística que arroja resultados apoyados del Big Data que sirve para predecir y/o pronosticar resultados a futuro.
En este caso, se usaron las variables que son relevantes y que tienen mucha relación. Esta relación se obtuvo realizando una regresión con las variables que tienen impacto directo con la variable total_incurred_cost.
Finalmente, podemos ver como en la predicción se incertaron valores y characters los cuales tienen una relación fuerte de acuerdo con la regresión, esto para poder observar el comportamiento y concluir con una recomendación basada en datos existentes.