ACTIVIDAD 1 REGRESIÓN LINEAL
1.Instalar Paquetes
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(readr)
library(readr)
completa <- read_csv("C:\\Users\\luisa\\Documents\\R LUISA\\MODULO 4\\completa.csv")
## Rows: 186456 Columns: 29
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (7): ClaimStatus, IncidentDescription, Gender, ClaimantType, InjuryNat...
## dbl (16): ClaimID, TotalPaid, TotalReserves, TotalRecovery, IndemnityPaid, ...
## date (6): IncidentDate, ReturnToWorkDate, ClaimantOpenedDate, ClaimantClose...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(completa)
2.Entender la base de datos
summary(completa)
## ClaimID TotalPaid TotalReserves TotalRecovery
## Min. : 633915 Min. : 0 Min. : 0 Min. : 0.00
## 1st Qu.: 810280 1st Qu.: 60 1st Qu.: 0 1st Qu.: 0.00
## Median : 856982 Median : 235 Median : 0 Median : 0.00
## Mean :12353268 Mean : 6750 Mean : 2236 Mean : 66.83
## 3rd Qu.:22716452 3rd Qu.: 937 3rd Qu.: 0 3rd Qu.: 0.00
## Max. :62246496 Max. :4527291 Max. :2069575 Max. :130541.03
## NA's :52662 NA's :52662 NA's :52662
## IndemnityPaid OtherPaid ClaimStatus IncidentDate
## Min. : 0 Min. : 0 Length:186456 Min. :1947-02-24
## 1st Qu.: 0 1st Qu.: 58 Class :character 1st Qu.:1998-12-21
## Median : 0 Median : 230 Mode :character Median :2004-01-07
## Mean : 3062 Mean : 3687 Mean :2003-12-09
## 3rd Qu.: 0 3rd Qu.: 855 3rd Qu.:2009-02-05
## Max. :640732 Max. :4129915 Max. :2014-06-27
## NA's :52662 NA's :52662 NA's :52662
## IncidentDescription ReturnToWorkDate AverageWeeklyWage
## Length:186456 Min. :1976-10-29 Min. : 0.0
## Class :character 1st Qu.:2002-04-26 1st Qu.: 300.0
## Mode :character Median :2007-07-10 Median : 491.8
## Mean :2006-06-02 Mean : 587.5
## 3rd Qu.:2011-06-01 3rd Qu.: 660.4
## Max. :2015-05-07 Max. :2024000.0
## NA's :111188 NA's :137466
## ClaimantOpenedDate ClaimantClosedDate EmployerNotificationDate
## Min. :1947-02-24 Min. :1999-06-01 Min. :1972-09-10
## 1st Qu.:1999-02-09 1st Qu.:2005-03-31 1st Qu.:2000-03-13
## Median :2004-02-18 Median :2006-04-05 Median :2004-12-29
## Mean :2004-01-24 Mean :2007-05-24 Mean :2005-08-30
## 3rd Qu.:2009-04-14 3rd Qu.:2009-11-16 3rd Qu.:2009-11-04
## Max. :2014-06-30 Max. :2014-06-30 Max. :9999-07-21
## NA's :52662 NA's :57339 NA's :74915
## ReceivedDate IsDenied ClaimantAge_at_DOI Gender
## Min. :1947-02-24 Min. :0.00 Min. : 0.00 Length:186456
## 1st Qu.:1999-02-09 1st Qu.:0.00 1st Qu.:33.00 Class :character
## Median :2004-02-13 Median :0.00 Median :42.00 Mode :character
## Mean :2004-07-20 Mean :0.04 Mean :42.05
## 3rd Qu.:2009-03-03 3rd Qu.:0.00 3rd Qu.:51.00
## Max. :9999-07-21 Max. :1.00 Max. :94.00
## NA's :52662 NA's :52662 NA's :97688
## ClaimantType InjuryNature BodyPartRegion BodyPart
## Length:186456 Length:186456 Length:186456 Length:186456
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## BillReviewALE Hospital PhysicianOutpatient Rx
## Min. : 0.0 Min. : 0.0 Min. : 0.0 Min. : 0.0
## 1st Qu.: 16.0 1st Qu.: 194.0 1st Qu.: 107.6 1st Qu.: 23.3
## Median : 32.0 Median : 559.1 Median : 221.6 Median : 58.3
## Mean : 191.1 Mean : 4392.8 Mean : 1751.1 Mean : 1138.3
## 3rd Qu.: 80.0 3rd Qu.: 2252.6 3rd Qu.: 710.3 3rd Qu.: 174.4
## Max. :56475.3 Max. :2759604.0 Max. :1481468.5 Max. :631635.5
## NA's :139699 NA's :145110 NA's :84883 NA's :145590
## Total_Incurred_Cost_Claim Total_Paid_calc tiempo_de_procesamiento_days
## Min. : 0 Min. : 0 Min. : 0
## 1st Qu.: 59 1st Qu.: 60 1st Qu.: 161
## Median : 235 Median : 235 Median : 991
## Mean : 8919 Mean : 6750 Mean : 1317
## 3rd Qu.: 968 3rd Qu.: 937 3rd Qu.: 2142
## Max. :5054823 Max. :4527291 Max. :19177
## NA's :52662 NA's :52662 NA's :57339
observaciones
1.En promedio el TotalPaid es de $6750 por atenderlos(IndemnityPaid + OtherPaid”.
2.En promedio se hacen 22236 reservas totales.
3.En promedio el seguro le paga a sus empleados por accidente 3062.
5.En promedio los accidentados pagan 3687 adicional por su consulta.
3.Generar la regregión lineal
# Ajustar un modelo de regresión lineal
modelo_regresion <- lm(Total_Paid_calc ~ AverageWeeklyWage + ClaimantAge_at_DOI + InjuryNature + BodyPartRegion + BodyPart + ClaimStatus + Gender + ClaimantType, data = completa)
# Ver un resumen del modelo
summary(modelo_regresion)
##
## Call:
## lm(formula = Total_Paid_calc ~ AverageWeeklyWage + ClaimantAge_at_DOI +
## InjuryNature + BodyPartRegion + BodyPart + ClaimStatus +
## Gender + ClaimantType, data = completa)
##
## Residuals:
## Min 1Q Median 3Q Max
## -168282 -15064 -1924 6845 4399680
##
## Coefficients: (7 not defined because of singularities)
## Estimate
## (Intercept) -7.667e+03
## AverageWeeklyWage 6.136e-03
## ClaimantAge_at_DOI 9.607e+01
## InjuryNatureAll Other Cumulative Injury, NOC -6.215e+03
## InjuryNatureAll Other Occupational Disease Injury, NOC 7.174e+04
## InjuryNatureAll Other Specific Injuries, Noc 1.717e+04
## InjuryNatureAmputation 1.483e+04
## InjuryNatureAngina Pectoris 1.204e+04
## InjuryNatureAsbestosis 1.694e+04
## InjuryNatureAsphyxiation 1.455e+04
## InjuryNatureBurn 1.790e+04
## InjuryNatureCancer 1.813e+04
## InjuryNatureCarpal Tunnel Syndrome 8.181e+03
## InjuryNatureConcussion 2.354e+04
## InjuryNatureContagious Disease 1.663e+04
## InjuryNatureContusion 1.121e+04
## InjuryNatureCrushing 1.040e+04
## InjuryNatureDermatitis 7.460e+03
## InjuryNatureDislocation 8.042e+03
## InjuryNatureDust Disease, NOC 7.958e+03
## InjuryNatureElectric Shock 1.113e+04
## InjuryNatureForeign Body 1.315e+04
## InjuryNatureFracture 1.322e+04
## InjuryNatureFreezing -9.928e+03
## InjuryNatureHearing Loss Or Impairment 9.858e+03
## InjuryNatureHeat Prostration 9.352e+02
## InjuryNatureHernia 4.436e+03
## InjuryNatureInfection 4.678e+03
## InjuryNatureInflammation 1.402e+04
## InjuryNatureLaceration 1.330e+04
## InjuryNatureLoss of Hearing 1.342e+04
## InjuryNatureMental Disorder 1.121e+04
## InjuryNatureMental Stress 5.681e+03
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 6.992e+04
## InjuryNatureMultiple Physical Injuries Only 7.932e+03
## InjuryNatureMyocardial Infarction 1.036e+04
## InjuryNatureNo Physical Injury 7.689e+03
## InjuryNatureNon-Standard Code 1.294e+03
## InjuryNatureNot Available 1.141e+04
## InjuryNaturePoisoning?Chemical (Other Than Metals) 8.868e+03
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 3.713e+03
## InjuryNaturePuncture 1.341e+04
## InjuryNatureRadiation 3.173e+04
## InjuryNatureRespiratory Disorders 1.218e+04
## InjuryNatureRupture 1.342e+04
## InjuryNatureSeverance 3.988e+04
## InjuryNatureSilicosis 1.015e+04
## InjuryNatureSprain 6.342e+03
## InjuryNatureStrain 7.129e+03
## InjuryNatureSyncope 6.481e+03
## InjuryNatureVascular 8.138e+03
## InjuryNatureVDT-Related Disease 5.415e+03
## InjuryNatureVision Loss 1.297e+04
## BodyPartRegionLower Extremities 1.512e+04
## BodyPartRegionMultiple Body Parts 3.812e+04
## BodyPartRegionNeck 9.589e+03
## BodyPartRegionNon-Standard Code 9.752e+03
## BodyPartRegionNot Available 1.955e+04
## BodyPartRegionTrunk 6.329e+03
## BodyPartRegionUpper Extremities 1.229e+04
## BodyPartAnkle -5.272e+03
## BodyPartArtificial Appliance -2.825e+04
## BodyPartBody Systems and Multiple Body Systems -2.734e+04
## BodyPartBrain 4.265e+04
## BodyPartButtocks 1.280e+03
## BodyPartChest 2.294e+03
## BodyPartDisc-Trunk 2.275e+04
## BodyPartEar(S) 6.019e+03
## BodyPartElbow -3.086e+03
## BodyPartEyes 8.497e+03
## BodyPartFacial Bones 9.606e+03
## BodyPartFinger(S) -6.139e+03
## BodyPartFoot -6.975e+03
## BodyPartGreat Toe -7.583e+03
## BodyPartHand -5.351e+03
## BodyPartHeart -5.802e+03
## BodyPartHip -7.785e+02
## BodyPartInsufficient Info to Properly Identify?Unclassified -2.627e+04
## BodyPartInternal Organs 1.087e+04
## BodyPartKnee -2.093e+03
## BodyPartLarynx -4.706e+03
## BodyPartLower Arm -2.536e+03
## BodyPartLower Back Area 2.169e+04
## BodyPartLower Leg 9.356e+01
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 1.974e+04
## BodyPartLungs 8.563e+01
## BodyPartMouth 9.067e+03
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) -1.369e+04
## BodyPartMultiple Head Injury 1.506e+04
## BodyPartMultiple Lower Extremities 7.356e+03
## BodyPartMultiple Neck Injury 1.226e+04
## BodyPartMultiple Trunk 1.130e+04
## BodyPartMultiple Upper Extremities 4.449e+03
## BodyPartNo Physical Injury -2.381e+04
## BodyPartNon-Standard Code NA
## BodyPartNose 4.087e+03
## BodyPartNot Available NA
## BodyPartPelvis 1.939e+03
## BodyPartSacrum And Coccyx 5.297e+03
## BodyPartShoulder(S) 4.055e+03
## BodyPartSkull 1.076e+04
## BodyPartSoft Tissue-Head -5.751e+03
## BodyPartSoft Tissue-Neck -8.373e+03
## BodyPartSpinal Cord-Trunk 6.451e+04
## BodyPartTeeth NA
## BodyPartThumb -5.582e+03
## BodyPartToes -8.808e+03
## BodyPartTrachea -3.326e+03
## BodyPartUpper Arm 2.374e+03
## BodyPartUpper Back Area 1.441e+04
## BodyPartUpper Leg NA
## BodyPartVertebrae NA
## BodyPartWhole Body NA
## BodyPartWrist NA
## ClaimStatusO 7.454e+04
## ClaimStatusR 9.709e+04
## GenderMale 2.055e+03
## GenderNot Available 1.892e+04
## ClaimantTypeMedical Only -2.287e+04
## ClaimantTypeReport Only -2.100e+04
## Std. Error
## (Intercept) 3.516e+04
## AverageWeeklyWage 2.437e-02
## ClaimantAge_at_DOI 2.641e+01
## InjuryNatureAll Other Cumulative Injury, NOC 3.624e+04
## InjuryNatureAll Other Occupational Disease Injury, NOC 4.067e+04
## InjuryNatureAll Other Specific Injuries, Noc 3.468e+04
## InjuryNatureAmputation 3.611e+04
## InjuryNatureAngina Pectoris 3.770e+04
## InjuryNatureAsbestosis 3.621e+04
## InjuryNatureAsphyxiation 4.382e+04
## InjuryNatureBurn 3.479e+04
## InjuryNatureCancer 4.587e+04
## InjuryNatureCarpal Tunnel Syndrome 3.480e+04
## InjuryNatureConcussion 3.490e+04
## InjuryNatureContagious Disease 3.517e+04
## InjuryNatureContusion 3.466e+04
## InjuryNatureCrushing 3.486e+04
## InjuryNatureDermatitis 3.475e+04
## InjuryNatureDislocation 3.486e+04
## InjuryNatureDust Disease, NOC 3.819e+04
## InjuryNatureElectric Shock 3.557e+04
## InjuryNatureForeign Body 3.479e+04
## InjuryNatureFracture 3.468e+04
## InjuryNatureFreezing 4.901e+04
## InjuryNatureHearing Loss Or Impairment 3.749e+04
## InjuryNatureHeat Prostration 3.523e+04
## InjuryNatureHernia 3.512e+04
## InjuryNatureInfection 3.495e+04
## InjuryNatureInflammation 3.473e+04
## InjuryNatureLaceration 3.468e+04
## InjuryNatureLoss of Hearing 3.761e+04
## InjuryNatureMental Disorder 4.150e+04
## InjuryNatureMental Stress 3.502e+04
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 3.570e+04
## InjuryNatureMultiple Physical Injuries Only 3.469e+04
## InjuryNatureMyocardial Infarction 3.906e+04
## InjuryNatureNo Physical Injury 3.474e+04
## InjuryNatureNon-Standard Code 3.490e+04
## InjuryNatureNot Available 3.500e+04
## InjuryNaturePoisoning?Chemical (Other Than Metals) 3.538e+04
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 3.715e+04
## InjuryNaturePuncture 3.471e+04
## InjuryNatureRadiation 4.245e+04
## InjuryNatureRespiratory Disorders 3.488e+04
## InjuryNatureRupture 3.509e+04
## InjuryNatureSeverance 3.874e+04
## InjuryNatureSilicosis 4.900e+04
## InjuryNatureSprain 3.467e+04
## InjuryNatureStrain 3.466e+04
## InjuryNatureSyncope 3.534e+04
## InjuryNatureVascular 4.245e+04
## InjuryNatureVDT-Related Disease 5.478e+04
## InjuryNatureVision Loss 3.765e+04
## BodyPartRegionLower Extremities 6.873e+03
## BodyPartRegionMultiple Body Parts 1.004e+04
## BodyPartRegionNeck 1.764e+04
## BodyPartRegionNon-Standard Code 7.207e+03
## BodyPartRegionNot Available 6.042e+04
## BodyPartRegionTrunk 6.583e+03
## BodyPartRegionUpper Extremities 6.065e+03
## BodyPartAnkle 3.871e+03
## BodyPartArtificial Appliance 4.319e+04
## BodyPartBody Systems and Multiple Body Systems 9.312e+03
## BodyPartBrain 1.238e+04
## BodyPartButtocks 5.350e+03
## BodyPartChest 3.787e+03
## BodyPartDisc-Trunk 4.799e+03
## BodyPartEar(S) 8.243e+03
## BodyPartElbow 2.754e+03
## BodyPartEyes 6.325e+03
## BodyPartFacial Bones 7.018e+03
## BodyPartFinger(S) 2.116e+03
## BodyPartFoot 3.982e+03
## BodyPartGreat Toe 7.804e+03
## BodyPartHand 2.055e+03
## BodyPartHeart 1.465e+04
## BodyPartHip 4.439e+03
## BodyPartInsufficient Info to Properly Identify?Unclassified 9.107e+03
## BodyPartInternal Organs 7.100e+03
## BodyPartKnee 3.698e+03
## BodyPartLarynx 2.460e+04
## BodyPartLower Arm 2.582e+03
## BodyPartLower Back Area 3.110e+03
## BodyPartLower Leg 4.112e+03
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 4.020e+03
## BodyPartLungs 5.897e+03
## BodyPartMouth 7.650e+03
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 8.208e+03
## BodyPartMultiple Head Injury 6.256e+03
## BodyPartMultiple Lower Extremities 4.858e+03
## BodyPartMultiple Neck Injury 1.680e+04
## BodyPartMultiple Trunk 7.456e+03
## BodyPartMultiple Upper Extremities 3.480e+03
## BodyPartNo Physical Injury 8.933e+03
## BodyPartNon-Standard Code NA
## BodyPartNose 7.574e+03
## BodyPartNot Available NA
## BodyPartPelvis 7.563e+03
## BodyPartSacrum And Coccyx 1.135e+04
## BodyPartShoulder(S) 1.997e+03
## BodyPartSkull 7.250e+03
## BodyPartSoft Tissue-Head 6.670e+03
## BodyPartSoft Tissue-Neck 1.673e+04
## BodyPartSpinal Cord-Trunk 9.333e+03
## BodyPartTeeth NA
## BodyPartThumb 2.916e+03
## BodyPartToes 5.702e+03
## BodyPartTrachea 2.968e+04
## BodyPartUpper Arm 3.008e+03
## BodyPartUpper Back Area 4.378e+03
## BodyPartUpper Leg NA
## BodyPartVertebrae NA
## BodyPartWhole Body NA
## BodyPartWrist NA
## ClaimStatusO 1.216e+03
## ClaimStatusR 2.137e+03
## GenderMale 6.289e+02
## GenderNot Available 3.776e+03
## ClaimantTypeMedical Only 6.745e+02
## ClaimantTypeReport Only 2.000e+03
## t value
## (Intercept) -0.218
## AverageWeeklyWage 0.252
## ClaimantAge_at_DOI 3.637
## InjuryNatureAll Other Cumulative Injury, NOC -0.171
## InjuryNatureAll Other Occupational Disease Injury, NOC 1.764
## InjuryNatureAll Other Specific Injuries, Noc 0.495
## InjuryNatureAmputation 0.411
## InjuryNatureAngina Pectoris 0.319
## InjuryNatureAsbestosis 0.468
## InjuryNatureAsphyxiation 0.332
## InjuryNatureBurn 0.515
## InjuryNatureCancer 0.395
## InjuryNatureCarpal Tunnel Syndrome 0.235
## InjuryNatureConcussion 0.674
## InjuryNatureContagious Disease 0.473
## InjuryNatureContusion 0.323
## InjuryNatureCrushing 0.298
## InjuryNatureDermatitis 0.215
## InjuryNatureDislocation 0.231
## InjuryNatureDust Disease, NOC 0.208
## InjuryNatureElectric Shock 0.313
## InjuryNatureForeign Body 0.378
## InjuryNatureFracture 0.381
## InjuryNatureFreezing -0.203
## InjuryNatureHearing Loss Or Impairment 0.263
## InjuryNatureHeat Prostration 0.027
## InjuryNatureHernia 0.126
## InjuryNatureInfection 0.134
## InjuryNatureInflammation 0.404
## InjuryNatureLaceration 0.384
## InjuryNatureLoss of Hearing 0.357
## InjuryNatureMental Disorder 0.270
## InjuryNatureMental Stress 0.162
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 1.959
## InjuryNatureMultiple Physical Injuries Only 0.229
## InjuryNatureMyocardial Infarction 0.265
## InjuryNatureNo Physical Injury 0.221
## InjuryNatureNon-Standard Code 0.037
## InjuryNatureNot Available 0.326
## InjuryNaturePoisoning?Chemical (Other Than Metals) 0.251
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 0.100
## InjuryNaturePuncture 0.387
## InjuryNatureRadiation 0.748
## InjuryNatureRespiratory Disorders 0.349
## InjuryNatureRupture 0.383
## InjuryNatureSeverance 1.029
## InjuryNatureSilicosis 0.207
## InjuryNatureSprain 0.183
## InjuryNatureStrain 0.206
## InjuryNatureSyncope 0.183
## InjuryNatureVascular 0.192
## InjuryNatureVDT-Related Disease 0.099
## InjuryNatureVision Loss 0.344
## BodyPartRegionLower Extremities 2.200
## BodyPartRegionMultiple Body Parts 3.797
## BodyPartRegionNeck 0.544
## BodyPartRegionNon-Standard Code 1.353
## BodyPartRegionNot Available 0.324
## BodyPartRegionTrunk 0.962
## BodyPartRegionUpper Extremities 2.026
## BodyPartAnkle -1.362
## BodyPartArtificial Appliance -0.654
## BodyPartBody Systems and Multiple Body Systems -2.936
## BodyPartBrain 3.445
## BodyPartButtocks 0.239
## BodyPartChest 0.606
## BodyPartDisc-Trunk 4.741
## BodyPartEar(S) 0.730
## BodyPartElbow -1.120
## BodyPartEyes 1.343
## BodyPartFacial Bones 1.369
## BodyPartFinger(S) -2.901
## BodyPartFoot -1.752
## BodyPartGreat Toe -0.972
## BodyPartHand -2.604
## BodyPartHeart -0.396
## BodyPartHip -0.175
## BodyPartInsufficient Info to Properly Identify?Unclassified -2.884
## BodyPartInternal Organs 1.530
## BodyPartKnee -0.566
## BodyPartLarynx -0.191
## BodyPartLower Arm -0.982
## BodyPartLower Back Area 6.975
## BodyPartLower Leg 0.023
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 4.910
## BodyPartLungs 0.015
## BodyPartMouth 1.185
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) -1.668
## BodyPartMultiple Head Injury 2.408
## BodyPartMultiple Lower Extremities 1.514
## BodyPartMultiple Neck Injury 0.730
## BodyPartMultiple Trunk 1.515
## BodyPartMultiple Upper Extremities 1.279
## BodyPartNo Physical Injury -2.665
## BodyPartNon-Standard Code NA
## BodyPartNose 0.540
## BodyPartNot Available NA
## BodyPartPelvis 0.256
## BodyPartSacrum And Coccyx 0.467
## BodyPartShoulder(S) 2.031
## BodyPartSkull 1.484
## BodyPartSoft Tissue-Head -0.862
## BodyPartSoft Tissue-Neck -0.500
## BodyPartSpinal Cord-Trunk 6.913
## BodyPartTeeth NA
## BodyPartThumb -1.914
## BodyPartToes -1.545
## BodyPartTrachea -0.112
## BodyPartUpper Arm 0.789
## BodyPartUpper Back Area 3.292
## BodyPartUpper Leg NA
## BodyPartVertebrae NA
## BodyPartWhole Body NA
## BodyPartWrist NA
## ClaimStatusO 61.291
## ClaimStatusR 45.441
## GenderMale 3.267
## GenderNot Available 5.011
## ClaimantTypeMedical Only -33.911
## ClaimantTypeReport Only -10.500
## Pr(>|t|)
## (Intercept) 0.827374
## AverageWeeklyWage 0.801184
## ClaimantAge_at_DOI 0.000276
## InjuryNatureAll Other Cumulative Injury, NOC 0.863849
## InjuryNatureAll Other Occupational Disease Injury, NOC 0.077737
## InjuryNatureAll Other Specific Injuries, Noc 0.620623
## InjuryNatureAmputation 0.681407
## InjuryNatureAngina Pectoris 0.749517
## InjuryNatureAsbestosis 0.639859
## InjuryNatureAsphyxiation 0.739916
## InjuryNatureBurn 0.606819
## InjuryNatureCancer 0.692732
## InjuryNatureCarpal Tunnel Syndrome 0.814158
## InjuryNatureConcussion 0.500007
## InjuryNatureContagious Disease 0.636253
## InjuryNatureContusion 0.746399
## InjuryNatureCrushing 0.765462
## InjuryNatureDermatitis 0.830017
## InjuryNatureDislocation 0.817543
## InjuryNatureDust Disease, NOC 0.834934
## InjuryNatureElectric Shock 0.754233
## InjuryNatureForeign Body 0.705444
## InjuryNatureFracture 0.703123
## InjuryNatureFreezing 0.839458
## InjuryNatureHearing Loss Or Impairment 0.792597
## InjuryNatureHeat Prostration 0.978820
## InjuryNatureHernia 0.899485
## InjuryNatureInfection 0.893537
## InjuryNatureInflammation 0.686506
## InjuryNatureLaceration 0.701309
## InjuryNatureLoss of Hearing 0.721143
## InjuryNatureMental Disorder 0.787087
## InjuryNatureMental Stress 0.871135
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.050174
## InjuryNatureMultiple Physical Injuries Only 0.819149
## InjuryNatureMyocardial Infarction 0.790808
## InjuryNatureNo Physical Injury 0.824834
## InjuryNatureNon-Standard Code 0.970415
## InjuryNatureNot Available 0.744518
## InjuryNaturePoisoning?Chemical (Other Than Metals) 0.802076
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 0.920389
## InjuryNaturePuncture 0.699098
## InjuryNatureRadiation 0.454728
## InjuryNatureRespiratory Disorders 0.727052
## InjuryNatureRupture 0.702056
## InjuryNatureSeverance 0.303262
## InjuryNatureSilicosis 0.835946
## InjuryNatureSprain 0.854840
## InjuryNatureStrain 0.837021
## InjuryNatureSyncope 0.854480
## InjuryNatureVascular 0.847981
## InjuryNatureVDT-Related Disease 0.921257
## InjuryNatureVision Loss 0.730547
## BodyPartRegionLower Extremities 0.027794
## BodyPartRegionMultiple Body Parts 0.000147
## BodyPartRegionNeck 0.586759
## BodyPartRegionNon-Standard Code 0.176028
## BodyPartRegionNot Available 0.746219
## BodyPartRegionTrunk 0.336293
## BodyPartRegionUpper Extremities 0.042823
## BodyPartAnkle 0.173283
## BodyPartArtificial Appliance 0.513133
## BodyPartBody Systems and Multiple Body Systems 0.003332
## BodyPartBrain 0.000571
## BodyPartButtocks 0.810917
## BodyPartChest 0.544778
## BodyPartDisc-Trunk 2.13e-06
## BodyPartEar(S) 0.465270
## BodyPartElbow 0.262557
## BodyPartEyes 0.179143
## BodyPartFacial Bones 0.171074
## BodyPartFinger(S) 0.003718
## BodyPartFoot 0.079817
## BodyPartGreat Toe 0.331249
## BodyPartHand 0.009218
## BodyPartHeart 0.692161
## BodyPartHip 0.860786
## BodyPartInsufficient Info to Properly Identify?Unclassified 0.003926
## BodyPartInternal Organs 0.125934
## BodyPartKnee 0.571387
## BodyPartLarynx 0.848317
## BodyPartLower Arm 0.326047
## BodyPartLower Back Area 3.11e-12
## BodyPartLower Leg 0.981850
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 9.17e-07
## BodyPartLungs 0.988413
## BodyPartMouth 0.235985
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 0.095313
## BodyPartMultiple Head Injury 0.016057
## BodyPartMultiple Lower Extremities 0.129933
## BodyPartMultiple Neck Injury 0.465392
## BodyPartMultiple Trunk 0.129681
## BodyPartMultiple Upper Extremities 0.201078
## BodyPartNo Physical Injury 0.007695
## BodyPartNon-Standard Code NA
## BodyPartNose 0.589507
## BodyPartNot Available NA
## BodyPartPelvis 0.797626
## BodyPartSacrum And Coccyx 0.640793
## BodyPartShoulder(S) 0.042271
## BodyPartSkull 0.137894
## BodyPartSoft Tissue-Head 0.388586
## BodyPartSoft Tissue-Neck 0.616753
## BodyPartSpinal Cord-Trunk 4.82e-12
## BodyPartTeeth NA
## BodyPartThumb 0.055575
## BodyPartToes 0.122401
## BodyPartTrachea 0.910770
## BodyPartUpper Arm 0.429971
## BodyPartUpper Back Area 0.000995
## BodyPartUpper Leg NA
## BodyPartVertebrae NA
## BodyPartWhole Body NA
## BodyPartWrist NA
## ClaimStatusO < 2e-16
## ClaimStatusR < 2e-16
## GenderMale 0.001088
## GenderNot Available 5.44e-07
## ClaimantTypeMedical Only < 2e-16
## ClaimantTypeReport Only < 2e-16
##
## (Intercept)
## AverageWeeklyWage
## ClaimantAge_at_DOI ***
## InjuryNatureAll Other Cumulative Injury, NOC
## InjuryNatureAll Other Occupational Disease Injury, NOC .
## InjuryNatureAll Other Specific Injuries, Noc
## InjuryNatureAmputation
## InjuryNatureAngina Pectoris
## InjuryNatureAsbestosis
## InjuryNatureAsphyxiation
## 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
## InjuryNatureSilicosis
## InjuryNatureSprain
## InjuryNatureStrain
## InjuryNatureSyncope
## InjuryNatureVascular
## InjuryNatureVDT-Related Disease
## InjuryNatureVision Loss
## BodyPartRegionLower Extremities *
## BodyPartRegionMultiple Body Parts ***
## BodyPartRegionNeck
## BodyPartRegionNon-Standard Code
## BodyPartRegionNot Available
## 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
## BodyPartNot Available
## 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
## ClaimStatusO ***
## ClaimStatusR ***
## GenderMale **
## GenderNot Available ***
## ClaimantTypeMedical Only ***
## ClaimantTypeReport Only ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 59970 on 38203 degrees of freedom
## (148140 observations deleted due to missingness)
## Multiple R-squared: 0.2045, Adjusted R-squared: 0.2022
## F-statistic: 87.7 on 112 and 38203 DF, p-value: < 2.2e-16
# Ajustar un modelo de regresión lineal
modelo_regresion2 <- lm(tiempo_de_procesamiento_days ~ BodyPart + BodyPartRegion + InjuryNature + ClaimantType + ClaimantAge_at_DOI, data = completa)
# Ver un resumen del modelo
summary(modelo_regresion2)
##
## Call:
## lm(formula = tiempo_de_procesamiento_days ~ BodyPart + BodyPartRegion +
## InjuryNature + ClaimantType + ClaimantAge_at_DOI, data = completa)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3044.8 -540.7 -265.9 365.0 15550.5
##
## Coefficients: (7 not defined because of singularities)
## Estimate
## (Intercept) 1421.2395
## BodyPartAnkle 287.5393
## BodyPartArtificial Appliance 160.2746
## BodyPartBody Systems and Multiple Body Systems 100.8179
## BodyPartBrain 98.9147
## BodyPartButtocks 17.2942
## BodyPartChest 268.0926
## BodyPartDisc-Trunk 684.0048
## BodyPartEar(S) 87.2217
## BodyPartElbow 188.0967
## BodyPartEyes 108.0302
## BodyPartFacial Bones 165.7703
## BodyPartFinger(S) 278.5418
## BodyPartFoot 221.7562
## BodyPartGreat Toe 42.3028
## BodyPartHand 198.2752
## BodyPartHeart -70.4868
## BodyPartHip 238.3993
## BodyPartInsufficient Info to Properly Identify?Unclassified 94.7922
## BodyPartInternal Organs 723.9379
## BodyPartKnee 252.8470
## BodyPartLarynx -34.8740
## BodyPartLower Arm 31.8411
## BodyPartLower Back Area 372.1787
## BodyPartLower Leg 170.6203
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 275.4583
## BodyPartLungs -79.5051
## BodyPartMouth 232.7530
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 538.8373
## BodyPartMultiple Head Injury 379.0680
## BodyPartMultiple Lower Extremities 570.2529
## BodyPartMultiple Neck Injury 424.1944
## BodyPartMultiple Trunk 577.5065
## BodyPartMultiple Upper Extremities 764.0842
## BodyPartNo Physical Injury 272.1650
## BodyPartNon-Standard Code 1635.4109
## BodyPartNose 197.0453
## BodyPartNot Available -114.9313
## BodyPartPelvis 217.7858
## BodyPartSacrum And Coccyx 82.3275
## BodyPartShoulder(S) 137.1203
## BodyPartSkull -42.8122
## BodyPartSoft Tissue-Head -305.1435
## BodyPartSoft Tissue-Neck -111.5493
## BodyPartSpinal Cord-Trunk 282.3982
## BodyPartTeeth -244.0964
## BodyPartThumb 208.7945
## BodyPartToes 102.8798
## BodyPartTrachea 107.1487
## BodyPartUpper Arm 575.4461
## BodyPartUpper Back Area 199.1654
## BodyPartUpper Leg 115.4029
## BodyPartVertebrae 532.0350
## BodyPartWhole Body -32.4244
## BodyPartWrist 276.2520
## BodyPartRegionLower Extremities NA
## BodyPartRegionMultiple Body Parts NA
## BodyPartRegionNeck NA
## BodyPartRegionNon-Standard Code NA
## BodyPartRegionNot Available NA
## BodyPartRegionTrunk NA
## BodyPartRegionUpper Extremities NA
## InjuryNatureAll Other Cumulative Injury, NOC -949.2913
## InjuryNatureAll Other Occupational Disease Injury, NOC -686.4685
## InjuryNatureAll Other Specific Injuries, Noc 504.2598
## InjuryNatureAmputation -148.3662
## InjuryNatureAngina Pectoris -949.5286
## InjuryNatureAsbestosis 26.1773
## InjuryNatureAsphyxiation -526.3144
## InjuryNatureBlack Lung -270.4743
## InjuryNatureBurn -466.7250
## InjuryNatureCancer 417.8899
## InjuryNatureCarpal Tunnel Syndrome -407.3270
## InjuryNatureConcussion -421.6922
## InjuryNatureContagious Disease -250.1432
## InjuryNatureContusion -384.8437
## InjuryNatureCrushing -438.4410
## InjuryNatureDermatitis -597.5724
## InjuryNatureDislocation -425.3347
## InjuryNatureDust Disease, NOC -822.1871
## InjuryNatureElectric Shock -341.6996
## InjuryNatureForeign Body -165.4627
## InjuryNatureFracture -463.9997
## InjuryNatureFreezing 632.9201
## InjuryNatureHearing Loss Or Impairment -215.4369
## InjuryNatureHeat Prostration -691.0929
## InjuryNatureHernia -484.1576
## InjuryNatureInfection -621.9498
## InjuryNatureInflammation -571.6166
## InjuryNatureLaceration -405.6768
## InjuryNatureLoss of Hearing -254.5894
## InjuryNatureMental Disorder 204.4346
## InjuryNatureMental Stress -676.3126
## InjuryNatureMultiple Injuries Including Both Physical and Psychological -1009.9163
## InjuryNatureMultiple Physical Injuries Only -874.3814
## InjuryNatureMyocardial Infarction -534.8598
## InjuryNatureNo Physical Injury -699.1226
## InjuryNatureNon-Standard Code -216.3118
## InjuryNatureNot Available -923.3807
## InjuryNaturePoisoning?Chemical (Other Than Metals) -256.3541
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) -627.6408
## InjuryNaturePuncture -387.7447
## InjuryNatureRadiation 274.1813
## InjuryNatureRespiratory Disorders -354.8989
## InjuryNatureRupture -538.1883
## InjuryNatureSeverance 553.0571
## InjuryNatureSilicosis -771.2150
## InjuryNatureSprain -570.1602
## InjuryNatureStrain -453.5838
## InjuryNatureSyncope -582.9483
## InjuryNatureVascular -465.2955
## InjuryNatureVDT-Related Disease -494.5093
## InjuryNatureVision Loss -714.5404
## ClaimantTypeMedical Only -278.5314
## ClaimantTypeReport Only -327.3681
## ClaimantAge_at_DOI -8.1170
## Std. Error
## (Intercept) 390.7621
## BodyPartAnkle 32.5914
## BodyPartArtificial Appliance 356.8161
## BodyPartBody Systems and Multiple Body Systems 55.8781
## BodyPartBrain 160.5164
## BodyPartButtocks 56.8060
## BodyPartChest 36.3784
## BodyPartDisc-Trunk 51.0194
## BodyPartEar(S) 59.0686
## BodyPartElbow 36.2596
## BodyPartEyes 34.4200
## BodyPartFacial Bones 43.5540
## BodyPartFinger(S) 31.3049
## BodyPartFoot 33.7524
## BodyPartGreat Toe 73.7881
## BodyPartHand 31.4631
## BodyPartHeart 190.2387
## BodyPartHip 39.9591
## BodyPartInsufficient Info to Properly Identify?Unclassified 50.4512
## BodyPartInternal Organs 76.4269
## BodyPartKnee 30.4202
## BodyPartLarynx 253.2507
## BodyPartLower Arm 33.9724
## BodyPartLower Back Area 30.3633
## BodyPartLower Leg 34.5587
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 41.5684
## BodyPartLungs 59.3007
## BodyPartMouth 53.1895
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 30.4151
## BodyPartMultiple Head Injury 35.8079
## BodyPartMultiple Lower Extremities 44.2695
## BodyPartMultiple Neck Injury 38.2236
## BodyPartMultiple Trunk 80.8457
## BodyPartMultiple Upper Extremities 40.5788
## BodyPartNo Physical Injury 46.1078
## BodyPartNon-Standard Code 38.6550
## BodyPartNose 53.6375
## BodyPartNot Available 331.1945
## BodyPartPelvis 80.8872
## BodyPartSacrum And Coccyx 114.3174
## BodyPartShoulder(S) 31.7603
## BodyPartSkull 44.6002
## BodyPartSoft Tissue-Head 42.4777
## BodyPartSoft Tissue-Neck 35.1670
## BodyPartSpinal Cord-Trunk 57.7574
## BodyPartTeeth 65.5789
## BodyPartThumb 35.6821
## BodyPartToes 50.6330
## BodyPartTrachea 254.1715
## BodyPartUpper Arm 37.6825
## BodyPartUpper Back Area 43.0757
## BodyPartUpper Leg 44.2065
## BodyPartVertebrae 196.9411
## BodyPartWhole Body 99.8154
## BodyPartWrist 32.3147
## BodyPartRegionLower Extremities NA
## BodyPartRegionMultiple Body Parts NA
## BodyPartRegionNeck NA
## BodyPartRegionNon-Standard Code NA
## BodyPartRegionNot Available NA
## BodyPartRegionTrunk NA
## BodyPartRegionUpper Extremities NA
## InjuryNatureAll Other Cumulative Injury, NOC 415.7548
## InjuryNatureAll Other Occupational Disease Injury, NOC 446.4981
## InjuryNatureAll Other Specific Injuries, Noc 389.7940
## InjuryNatureAmputation 408.6423
## InjuryNatureAngina Pectoris 444.6949
## InjuryNatureAsbestosis 407.7118
## InjuryNatureAsphyxiation 469.8491
## InjuryNatureBlack Lung 636.5688
## InjuryNatureBurn 390.6318
## InjuryNatureCancer 527.7465
## InjuryNatureCarpal Tunnel Syndrome 391.6752
## InjuryNatureConcussion 391.5670
## InjuryNatureContagious Disease 393.5568
## InjuryNatureContusion 389.6459
## InjuryNatureCrushing 391.3363
## InjuryNatureDermatitis 390.4199
## InjuryNatureDislocation 392.6655
## InjuryNatureDust Disease, NOC 435.7569
## InjuryNatureElectric Shock 399.7118
## InjuryNatureForeign Body 390.2999
## InjuryNatureFracture 390.0295
## InjuryNatureFreezing 584.3044
## InjuryNatureHearing Loss Or Impairment 406.8476
## InjuryNatureHeat Prostration 396.3403
## InjuryNatureHernia 395.1347
## InjuryNatureInfection 392.8502
## InjuryNatureInflammation 390.4858
## InjuryNatureLaceration 389.7277
## InjuryNatureLoss of Hearing 415.8735
## InjuryNatureMental Disorder 479.5370
## InjuryNatureMental Stress 396.2062
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 410.7491
## InjuryNatureMultiple Physical Injuries Only 390.1487
## InjuryNatureMyocardial Infarction 447.8161
## InjuryNatureNo Physical Injury 390.2234
## InjuryNatureNon-Standard Code 390.2147
## InjuryNatureNot Available 392.5219
## InjuryNaturePoisoning?Chemical (Other Than Metals) 395.7951
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 398.5130
## InjuryNaturePuncture 389.9041
## InjuryNatureRadiation 433.4877
## InjuryNatureRespiratory Disorders 391.9360
## InjuryNatureRupture 400.0920
## InjuryNatureSeverance 429.9817
## InjuryNatureSilicosis 636.2369
## InjuryNatureSprain 389.7416
## InjuryNatureStrain 389.6399
## InjuryNatureSyncope 397.8653
## InjuryNatureVascular 477.2126
## InjuryNatureVDT-Related Disease 728.8181
## InjuryNatureVision Loss 420.2030
## ClaimantTypeMedical Only 7.5490
## ClaimantTypeReport Only 13.4507
## ClaimantAge_at_DOI 0.2565
## t value
## (Intercept) 3.637
## BodyPartAnkle 8.823
## BodyPartArtificial Appliance 0.449
## BodyPartBody Systems and Multiple Body Systems 1.804
## BodyPartBrain 0.616
## BodyPartButtocks 0.304
## BodyPartChest 7.370
## BodyPartDisc-Trunk 13.407
## BodyPartEar(S) 1.477
## BodyPartElbow 5.188
## BodyPartEyes 3.139
## BodyPartFacial Bones 3.806
## BodyPartFinger(S) 8.898
## BodyPartFoot 6.570
## BodyPartGreat Toe 0.573
## BodyPartHand 6.302
## BodyPartHeart -0.371
## BodyPartHip 5.966
## BodyPartInsufficient Info to Properly Identify?Unclassified 1.879
## BodyPartInternal Organs 9.472
## BodyPartKnee 8.312
## BodyPartLarynx -0.138
## BodyPartLower Arm 0.937
## BodyPartLower Back Area 12.258
## BodyPartLower Leg 4.937
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 6.627
## BodyPartLungs -1.341
## BodyPartMouth 4.376
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 17.716
## BodyPartMultiple Head Injury 10.586
## BodyPartMultiple Lower Extremities 12.881
## BodyPartMultiple Neck Injury 11.098
## BodyPartMultiple Trunk 7.143
## BodyPartMultiple Upper Extremities 18.830
## BodyPartNo Physical Injury 5.903
## BodyPartNon-Standard Code 42.308
## BodyPartNose 3.674
## BodyPartNot Available -0.347
## BodyPartPelvis 2.692
## BodyPartSacrum And Coccyx 0.720
## BodyPartShoulder(S) 4.317
## BodyPartSkull -0.960
## BodyPartSoft Tissue-Head -7.184
## BodyPartSoft Tissue-Neck -3.172
## BodyPartSpinal Cord-Trunk 4.889
## BodyPartTeeth -3.722
## BodyPartThumb 5.852
## BodyPartToes 2.032
## BodyPartTrachea 0.422
## BodyPartUpper Arm 15.271
## BodyPartUpper Back Area 4.624
## BodyPartUpper Leg 2.611
## BodyPartVertebrae 2.701
## BodyPartWhole Body -0.325
## BodyPartWrist 8.549
## BodyPartRegionLower Extremities NA
## BodyPartRegionMultiple Body Parts NA
## BodyPartRegionNeck NA
## BodyPartRegionNon-Standard Code NA
## BodyPartRegionNot Available NA
## BodyPartRegionTrunk NA
## BodyPartRegionUpper Extremities NA
## InjuryNatureAll Other Cumulative Injury, NOC -2.283
## InjuryNatureAll Other Occupational Disease Injury, NOC -1.537
## InjuryNatureAll Other Specific Injuries, Noc 1.294
## InjuryNatureAmputation -0.363
## InjuryNatureAngina Pectoris -2.135
## InjuryNatureAsbestosis 0.064
## InjuryNatureAsphyxiation -1.120
## InjuryNatureBlack Lung -0.425
## InjuryNatureBurn -1.195
## InjuryNatureCancer 0.792
## InjuryNatureCarpal Tunnel Syndrome -1.040
## InjuryNatureConcussion -1.077
## InjuryNatureContagious Disease -0.636
## InjuryNatureContusion -0.988
## InjuryNatureCrushing -1.120
## InjuryNatureDermatitis -1.531
## InjuryNatureDislocation -1.083
## InjuryNatureDust Disease, NOC -1.887
## InjuryNatureElectric Shock -0.855
## InjuryNatureForeign Body -0.424
## InjuryNatureFracture -1.190
## InjuryNatureFreezing 1.083
## InjuryNatureHearing Loss Or Impairment -0.530
## InjuryNatureHeat Prostration -1.744
## InjuryNatureHernia -1.225
## InjuryNatureInfection -1.583
## InjuryNatureInflammation -1.464
## InjuryNatureLaceration -1.041
## InjuryNatureLoss of Hearing -0.612
## InjuryNatureMental Disorder 0.426
## InjuryNatureMental Stress -1.707
## InjuryNatureMultiple Injuries Including Both Physical and Psychological -2.459
## InjuryNatureMultiple Physical Injuries Only -2.241
## InjuryNatureMyocardial Infarction -1.194
## InjuryNatureNo Physical Injury -1.792
## InjuryNatureNon-Standard Code -0.554
## InjuryNatureNot Available -2.352
## InjuryNaturePoisoning?Chemical (Other Than Metals) -0.648
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) -1.575
## InjuryNaturePuncture -0.994
## InjuryNatureRadiation 0.633
## InjuryNatureRespiratory Disorders -0.906
## InjuryNatureRupture -1.345
## InjuryNatureSeverance 1.286
## InjuryNatureSilicosis -1.212
## InjuryNatureSprain -1.463
## InjuryNatureStrain -1.164
## InjuryNatureSyncope -1.465
## InjuryNatureVascular -0.975
## InjuryNatureVDT-Related Disease -0.679
## InjuryNatureVision Loss -1.700
## ClaimantTypeMedical Only -36.897
## ClaimantTypeReport Only -24.338
## ClaimantAge_at_DOI -31.646
## Pr(>|t|)
## (Intercept) 0.000276
## BodyPartAnkle < 2e-16
## BodyPartArtificial Appliance 0.653303
## BodyPartBody Systems and Multiple Body Systems 0.071196
## BodyPartBrain 0.537746
## BodyPartButtocks 0.760791
## BodyPartChest 1.73e-13
## BodyPartDisc-Trunk < 2e-16
## BodyPartEar(S) 0.139782
## BodyPartElbow 2.14e-07
## BodyPartEyes 0.001698
## BodyPartFacial Bones 0.000141
## BodyPartFinger(S) < 2e-16
## BodyPartFoot 5.06e-11
## BodyPartGreat Toe 0.566442
## BodyPartHand 2.96e-10
## BodyPartHeart 0.710998
## BodyPartHip 2.44e-09
## BodyPartInsufficient Info to Properly Identify?Unclassified 0.060263
## BodyPartInternal Organs < 2e-16
## BodyPartKnee < 2e-16
## BodyPartLarynx 0.890474
## BodyPartLower Arm 0.348626
## BodyPartLower Back Area < 2e-16
## BodyPartLower Leg 7.94e-07
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 3.45e-11
## BodyPartLungs 0.180017
## BodyPartMouth 1.21e-05
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) < 2e-16
## BodyPartMultiple Head Injury < 2e-16
## BodyPartMultiple Lower Extremities < 2e-16
## BodyPartMultiple Neck Injury < 2e-16
## BodyPartMultiple Trunk 9.18e-13
## BodyPartMultiple Upper Extremities < 2e-16
## BodyPartNo Physical Injury 3.59e-09
## BodyPartNon-Standard Code < 2e-16
## BodyPartNose 0.000239
## BodyPartNot Available 0.728577
## BodyPartPelvis 0.007094
## BodyPartSacrum And Coccyx 0.471425
## BodyPartShoulder(S) 1.58e-05
## BodyPartSkull 0.337103
## BodyPartSoft Tissue-Head 6.85e-13
## BodyPartSoft Tissue-Neck 0.001515
## BodyPartSpinal Cord-Trunk 1.01e-06
## BodyPartTeeth 0.000198
## BodyPartThumb 4.89e-09
## BodyPartToes 0.042170
## BodyPartTrachea 0.673347
## BodyPartUpper Arm < 2e-16
## BodyPartUpper Back Area 3.78e-06
## BodyPartUpper Leg 0.009041
## BodyPartVertebrae 0.006904
## BodyPartWhole Body 0.745300
## BodyPartWrist < 2e-16
## BodyPartRegionLower Extremities NA
## BodyPartRegionMultiple Body Parts NA
## BodyPartRegionNeck NA
## BodyPartRegionNon-Standard Code NA
## BodyPartRegionNot Available NA
## BodyPartRegionTrunk NA
## BodyPartRegionUpper Extremities NA
## InjuryNatureAll Other Cumulative Injury, NOC 0.022415
## InjuryNatureAll Other Occupational Disease Injury, NOC 0.124187
## InjuryNatureAll Other Specific Injuries, Noc 0.195787
## InjuryNatureAmputation 0.716553
## InjuryNatureAngina Pectoris 0.032745
## InjuryNatureAsbestosis 0.948807
## InjuryNatureAsphyxiation 0.262641
## InjuryNatureBlack Lung 0.670915
## InjuryNatureBurn 0.232170
## InjuryNatureCancer 0.428457
## InjuryNatureCarpal Tunnel Syndrome 0.298361
## InjuryNatureConcussion 0.281512
## InjuryNatureContagious Disease 0.525041
## InjuryNatureContusion 0.323314
## InjuryNatureCrushing 0.262560
## InjuryNatureDermatitis 0.125875
## InjuryNatureDislocation 0.278723
## InjuryNatureDust Disease, NOC 0.059190
## InjuryNatureElectric Shock 0.392628
## InjuryNatureForeign Body 0.671613
## InjuryNatureFracture 0.234186
## InjuryNatureFreezing 0.278722
## InjuryNatureHearing Loss Or Impairment 0.596441
## InjuryNatureHeat Prostration 0.081218
## InjuryNatureHernia 0.220466
## InjuryNatureInfection 0.113386
## InjuryNatureInflammation 0.143236
## InjuryNatureLaceration 0.297914
## InjuryNatureLoss of Hearing 0.540420
## InjuryNatureMental Disorder 0.669878
## InjuryNatureMental Stress 0.087831
## InjuryNatureMultiple Injuries Including Both Physical and Psychological 0.013945
## InjuryNatureMultiple Physical Injuries Only 0.025019
## InjuryNatureMyocardial Infarction 0.232335
## InjuryNatureNo Physical Injury 0.073201
## InjuryNatureNon-Standard Code 0.579347
## InjuryNatureNot Available 0.018653
## InjuryNaturePoisoning?Chemical (Other Than Metals) 0.517185
## InjuryNaturePoisoning?General (NOT OD or Cumulative Injury) 0.115270
## InjuryNaturePuncture 0.320001
## InjuryNatureRadiation 0.527061
## InjuryNatureRespiratory Disorders 0.365202
## InjuryNatureRupture 0.178577
## InjuryNatureSeverance 0.198365
## InjuryNatureSilicosis 0.225458
## InjuryNatureSprain 0.143493
## InjuryNatureStrain 0.244383
## InjuryNatureSyncope 0.142873
## InjuryNatureVascular 0.329549
## InjuryNatureVDT-Related Disease 0.497451
## InjuryNatureVision Loss 0.089047
## ClaimantTypeMedical Only < 2e-16
## ClaimantTypeReport Only < 2e-16
## ClaimantAge_at_DOI < 2e-16
##
## (Intercept) ***
## 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 ***
## BodyPartNot Available
## 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 ***
## BodyPartRegionLower Extremities
## BodyPartRegionMultiple Body Parts
## BodyPartRegionNeck
## BodyPartRegionNon-Standard Code
## BodyPartRegionNot Available
## BodyPartRegionTrunk
## BodyPartRegionUpper Extremities
## InjuryNatureAll Other Cumulative Injury, NOC *
## InjuryNatureAll Other Occupational Disease Injury, NOC
## 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
## InjuryNatureSilicosis
## InjuryNatureSprain
## InjuryNatureStrain
## InjuryNatureSyncope
## InjuryNatureVascular
## InjuryNatureVDT-Related Disease
## InjuryNatureVision Loss .
## ClaimantTypeMedical Only ***
## ClaimantTypeReport Only ***
## ClaimantAge_at_DOI ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 870.9 on 84023 degrees of freedom
## (102324 observations deleted due to missingness)
## Multiple R-squared: 0.2033, Adjusted R-squared: 0.2023
## F-statistic: 198.5 on 108 and 84023 DF, p-value: < 2.2e-16
4.Ajustar el Modelo
# Ajustar un modelo de regresión lineal
#modelo_regresion <- lm(Total_Paid_calc ~ AverageWeeklyWage + ClaimantAge_at_DOI + InjuryNature + BodyPartRegion + BodyPart + ClaimStatus + Gender + ClaimantType, data = base_act_4_6)
# Ver un resumen del modelo
#summary(modelo_regresion)
#Se mantiene igual esta regresión linealel R-cuadrado múltiple es 0.09633, lo que significa que aproximadamente el 9.63% de la variabilidad en la variable dependiente es explicada por las variables predictoras incluidas en el modelo.
# El valor p asociado es "< 2.2e-16", lo que indica que el modelo en su conjunto es significativo en relación.
#Se ajuta el modelo con las variables que si tienen relación.
modelo_regresion2 <- lm(tiempo_de_procesamiento_days ~ BodyPart + ClaimantType, data = completa)
summary(modelo_regresion2)
##
## Call:
## lm(formula = tiempo_de_procesamiento_days ~ BodyPart + ClaimantType,
## data = completa)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2929.2 -910.0 -258.6 840.8 16247.8
##
## Coefficients:
## Estimate
## (Intercept) 747.280
## BodyPartAnkle 449.751
## BodyPartArtificial Appliance 306.695
## BodyPartBody Systems and Multiple Body Systems 331.196
## BodyPartBrain 212.495
## BodyPartButtocks -47.021
## BodyPartChest 500.923
## BodyPartDisc-Trunk 940.498
## BodyPartEar(S) 433.492
## BodyPartElbow 275.940
## BodyPartEyes 550.974
## BodyPartFacial Bones 459.064
## BodyPartFinger(S) 654.123
## BodyPartFoot 454.386
## BodyPartGreat Toe -30.318
## BodyPartHand 516.558
## BodyPartHeart 60.604
## BodyPartHip 472.856
## BodyPartInsufficient Info to Properly Identify?Unclassified 554.963
## BodyPartInternal Organs 1321.751
## BodyPartKnee 425.944
## BodyPartLarynx -140.343
## BodyPartLower Arm 110.598
## BodyPartLower Back Area 626.630
## BodyPartLower Leg 314.399
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 306.091
## BodyPartLungs 32.154
## BodyPartMouth 752.596
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 988.430
## BodyPartMultiple Head Injury 797.134
## BodyPartMultiple Lower Extremities 1060.606
## BodyPartMultiple Neck Injury 664.797
## BodyPartMultiple Trunk 1021.560
## BodyPartMultiple Upper Extremities 1414.735
## BodyPartNo Physical Injury 240.880
## BodyPartNon-Standard Code 2077.732
## BodyPartNose 532.410
## BodyPartNot Available -808.658
## BodyPartPelvis 280.557
## BodyPartSacrum And Coccyx 343.713
## BodyPartShoulder(S) 43.383
## BodyPartSkull -162.644
## BodyPartSoft Tissue-Head -545.083
## BodyPartSoft Tissue-Neck -220.582
## BodyPartSpinal Cord-Trunk 229.280
## BodyPartTeeth 205.781
## BodyPartThumb 457.872
## BodyPartToes 462.064
## BodyPartTrachea 483.725
## BodyPartUpper Arm 1042.198
## BodyPartUpper Back Area 344.011
## BodyPartUpper Leg 329.035
## BodyPartVertebrae 535.554
## BodyPartWhole Body -316.772
## BodyPartWrist 491.997
## ClaimantTypeMedical Only -194.273
## ClaimantTypeReport Only 104.153
## Std. Error
## (Intercept) 32.862
## BodyPartAnkle 35.854
## BodyPartArtificial Appliance 340.358
## BodyPartBody Systems and Multiple Body Systems 59.799
## BodyPartBrain 185.154
## BodyPartButtocks 66.493
## BodyPartChest 40.579
## BodyPartDisc-Trunk 48.698
## BodyPartEar(S) 58.390
## BodyPartElbow 41.014
## BodyPartEyes 36.198
## BodyPartFacial Bones 47.497
## BodyPartFinger(S) 34.554
## BodyPartFoot 37.542
## BodyPartGreat Toe 88.359
## BodyPartHand 35.097
## BodyPartHeart 168.847
## BodyPartHip 44.382
## BodyPartInsufficient Info to Properly Identify?Unclassified 53.578
## BodyPartInternal Organs 71.876
## BodyPartKnee 34.268
## BodyPartLarynx 313.338
## BodyPartLower Arm 38.663
## BodyPartLower Back Area 34.062
## BodyPartLower Leg 39.080
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 46.528
## BodyPartLungs 57.488
## BodyPartMouth 55.809
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 33.862
## BodyPartMultiple Head Injury 38.677
## BodyPartMultiple Lower Extremities 46.843
## BodyPartMultiple Neck Injury 41.890
## BodyPartMultiple Trunk 83.063
## BodyPartMultiple Upper Extremities 41.791
## BodyPartNo Physical Injury 46.359
## BodyPartNon-Standard Code 34.230
## BodyPartNose 58.431
## BodyPartNot Available 426.046
## BodyPartPelvis 92.090
## BodyPartSacrum And Coccyx 126.128
## BodyPartShoulder(S) 36.298
## BodyPartSkull 53.172
## BodyPartSoft Tissue-Head 51.220
## BodyPartSoft Tissue-Neck 41.087
## BodyPartSpinal Cord-Trunk 70.569
## BodyPartTeeth 73.843
## BodyPartThumb 39.255
## BodyPartToes 54.807
## BodyPartTrachea 274.463
## BodyPartUpper Arm 39.809
## BodyPartUpper Back Area 48.768
## BodyPartUpper Leg 49.363
## BodyPartVertebrae 227.071
## BodyPartWhole Body 125.449
## BodyPartWrist 36.176
## ClaimantTypeMedical Only 7.812
## ClaimantTypeReport Only 12.386
## t value
## (Intercept) 22.740
## BodyPartAnkle 12.544
## BodyPartArtificial Appliance 0.901
## BodyPartBody Systems and Multiple Body Systems 5.538
## BodyPartBrain 1.148
## BodyPartButtocks -0.707
## BodyPartChest 12.344
## BodyPartDisc-Trunk 19.313
## BodyPartEar(S) 7.424
## BodyPartElbow 6.728
## BodyPartEyes 15.221
## BodyPartFacial Bones 9.665
## BodyPartFinger(S) 18.930
## BodyPartFoot 12.104
## BodyPartGreat Toe -0.343
## BodyPartHand 14.718
## BodyPartHeart 0.359
## BodyPartHip 10.654
## BodyPartInsufficient Info to Properly Identify?Unclassified 10.358
## BodyPartInternal Organs 18.389
## BodyPartKnee 12.430
## BodyPartLarynx -0.448
## BodyPartLower Arm 2.861
## BodyPartLower Back Area 18.397
## BodyPartLower Leg 8.045
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 6.579
## BodyPartLungs 0.559
## BodyPartMouth 13.485
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) 29.190
## BodyPartMultiple Head Injury 20.610
## BodyPartMultiple Lower Extremities 22.642
## BodyPartMultiple Neck Injury 15.870
## BodyPartMultiple Trunk 12.299
## BodyPartMultiple Upper Extremities 33.853
## BodyPartNo Physical Injury 5.196
## BodyPartNon-Standard Code 60.700
## BodyPartNose 9.112
## BodyPartNot Available -1.898
## BodyPartPelvis 3.047
## BodyPartSacrum And Coccyx 2.725
## BodyPartShoulder(S) 1.195
## BodyPartSkull -3.059
## BodyPartSoft Tissue-Head -10.642
## BodyPartSoft Tissue-Neck -5.369
## BodyPartSpinal Cord-Trunk 3.249
## BodyPartTeeth 2.787
## BodyPartThumb 11.664
## BodyPartToes 8.431
## BodyPartTrachea 1.762
## BodyPartUpper Arm 26.180
## BodyPartUpper Back Area 7.054
## BodyPartUpper Leg 6.666
## BodyPartVertebrae 2.359
## BodyPartWhole Body -2.525
## BodyPartWrist 13.600
## ClaimantTypeMedical Only -24.867
## ClaimantTypeReport Only 8.409
## Pr(>|t|)
## (Intercept) < 2e-16
## BodyPartAnkle < 2e-16
## BodyPartArtificial Appliance 0.36754
## BodyPartBody Systems and Multiple Body Systems 3.06e-08
## BodyPartBrain 0.25111
## BodyPartButtocks 0.47947
## BodyPartChest < 2e-16
## BodyPartDisc-Trunk < 2e-16
## BodyPartEar(S) 1.14e-13
## BodyPartElbow 1.73e-11
## BodyPartEyes < 2e-16
## BodyPartFacial Bones < 2e-16
## BodyPartFinger(S) < 2e-16
## BodyPartFoot < 2e-16
## BodyPartGreat Toe 0.73151
## BodyPartHand < 2e-16
## BodyPartHeart 0.71965
## BodyPartHip < 2e-16
## BodyPartInsufficient Info to Properly Identify?Unclassified < 2e-16
## BodyPartInternal Organs < 2e-16
## BodyPartKnee < 2e-16
## BodyPartLarynx 0.65423
## BodyPartLower Arm 0.00423
## BodyPartLower Back Area < 2e-16
## BodyPartLower Leg 8.69e-16
## BodyPartLumbar and/or Sacral Vertebrae (Vertebra NOC Trunk) 4.77e-11
## BodyPartLungs 0.57595
## BodyPartMouth < 2e-16
## BodyPartMultiple Body Parts (Including Body Systems and Body Parts) < 2e-16
## BodyPartMultiple Head Injury < 2e-16
## BodyPartMultiple Lower Extremities < 2e-16
## BodyPartMultiple Neck Injury < 2e-16
## BodyPartMultiple Trunk < 2e-16
## BodyPartMultiple Upper Extremities < 2e-16
## BodyPartNo Physical Injury 2.04e-07
## BodyPartNon-Standard Code < 2e-16
## BodyPartNose < 2e-16
## BodyPartNot Available 0.05769
## BodyPartPelvis 0.00232
## BodyPartSacrum And Coccyx 0.00643
## BodyPartShoulder(S) 0.23202
## BodyPartSkull 0.00222
## BodyPartSoft Tissue-Head < 2e-16
## BodyPartSoft Tissue-Neck 7.94e-08
## BodyPartSpinal Cord-Trunk 0.00116
## BodyPartTeeth 0.00532
## BodyPartThumb < 2e-16
## BodyPartToes < 2e-16
## BodyPartTrachea 0.07800
## BodyPartUpper Arm < 2e-16
## BodyPartUpper Back Area 1.75e-12
## BodyPartUpper Leg 2.65e-11
## BodyPartVertebrae 0.01835
## BodyPartWhole Body 0.01157
## BodyPartWrist < 2e-16
## ClaimantTypeMedical Only < 2e-16
## ClaimantTypeReport Only < 2e-16
##
## (Intercept) ***
## 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 ***
## BodyPartNot Available .
## 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 ***
## ClaimantTypeMedical Only ***
## ClaimantTypeReport Only ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1124 on 129060 degrees of freedom
## (57339 observations deleted due to missingness)
## Multiple R-squared: 0.2155, Adjusted R-squared: 0.2152
## F-statistic: 633.1 on 56 and 129060 DF, p-value: < 2.2e-16
5.Construir el modelo predictivo
# Crear un nuevo DataFrame con los datos de entrada que deseas predecir
datos <- data.frame(
InjuryNature = "Fracture",
AverageWeeklyWage = 1649.00,
ClaimantAge_at_DOI = 47,
BodyPartRegion = "Upper Extremities",
BodyPart = "Hand",
ClaimStatus = "C", # Mantener 'ClaimStatus' como character
Gender = "Male",
ClaimantType = "Indemnity",
Total_Paid_calc = 9295.89
)
# Eliminar el nivel "777646" de 'ClaimStatus'
datos$ClaimStatus <- factor(datos$ClaimStatus, levels = levels(modelo_regresion$ClaimStatus))
# Realizar la predicción
prediccion <- predict(modelo_regresion, datos)
# Mostrar el resultado de la predicción
print(prediccion)
## 1
## NA
datos2 <- data.frame(BodyPart="Shoulder(S)",ClaimantType="Indemnity",tiempo_de_procesamiento_days=2080)
predict(modelo_regresion2,datos2)
## 1
## 790.6632
datos2
## BodyPart ClaimantType tiempo_de_procesamiento_days
## 1 Shoulder(S) Indemnity 2080
6.Visualización de las regresiones lineales
# No se puede crear una gráfica para visualizar estos datos debido a los resultados obtenidos debido a la baja R2.
library(ggplot2)
ggplot(completa, aes(x = BodyPart, y =tiempo_de_procesamiento_days)) +
geom_point() + # Puntos de dispersión
geom_smooth(method = "lm", se = FALSE, color = "blue") + # Línea de regresión
labs(title = "Gráfico de Regresión Lineal",
x = "BodyPart",
y = "tiempo_de_procesamiento_days") +
geom_point(data = completa, aes(x = BodyPart, y = tiempo_de_procesamiento_days), color = "red")
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 57339 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 57339 rows containing missing values (`geom_point()`).
## Removed 57339 rows containing missing values (`geom_point()`).