class: center, middle, inverse, title-slide .title[ # Stroke ] .subtitle[ ## What leads to a stroke? ] .author[ ### Connor McKee ] .institute[ ### West Chester University of Pennsylvania ] .date[ ### May 3, 2023 ] --- .center[ ## What is a stroke? ] **Mayo Clinic** defines a stroke to be when the blood supply to part of the brain is interrupted or reduced, preventing brain tissue from getting oxygen and nutrients. Brain cells begin to die in minutes. **WebMd** states major attributes that lead to strokes are: - High blood pressure - Carotid or coronary artery disease - Others --- .center[ ## What attributes lead to strokes? ] This data set consists of 4795 unique individuals, and we have 10 possible variables to analyze these individuals on. The variables include: 1. Gender (Male/Female) 2. Age 3. Hypertension (No/Yes) 4. Heart_disease (No/Yes) 5. Ever_married (No/Yes) 6. Work_type (Children, Self-employed, Private, Goverment) 7. Residence_type (Rural/Urban) 8. Average glucose level 9. BMI 10. Smoking_status (Formerly/Never/Smokes/Unknown) 11. Stroke (No/Yes) .center[ ** 249 patients recorded having a stroke which is 5% of the sample. ** ] --- .center[ ## Exploratory Analysis ] <img src="Final-Presentation2_files/figure-html/unnamed-chunk-3-1.png" style="display: block; margin: auto;" /> ``` ## NULL ``` --- .center[ ## Full Model ] <table class="table" style="font-size: 7px; margin-left: auto; margin-right: auto;"> <caption style="font-size: initial !important;">Summary of inferential statistics of the full model</caption> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> Estimate </th> <th style="text-align:right;"> Std. Error </th> <th style="text-align:right;"> z value </th> <th style="text-align:right;"> Pr(>|z|) </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> (Intercept) </td> <td style="text-align:right;"> -6.2178587 </td> <td style="text-align:right;"> 1.061345e+00 </td> <td style="text-align:right;"> -5.8584728 </td> <td style="text-align:right;"> 0.0000000 </td> </tr> <tr> <td style="text-align:left;"> genderMale </td> <td style="text-align:right;"> -0.0728082 </td> <td style="text-align:right;"> 1.516328e-01 </td> <td style="text-align:right;"> -0.4801611 </td> <td style="text-align:right;"> 0.6311128 </td> </tr> <tr> <td style="text-align:left;"> genderOther </td> <td style="text-align:right;"> -0.5942210 </td> <td style="text-align:right;"> 1.077026e+04 </td> <td style="text-align:right;"> -0.0000552 </td> <td style="text-align:right;"> 0.9999560 </td> </tr> <tr> <td style="text-align:left;"> grp.age21-24 </td> <td style="text-align:right;"> 0.0104641 </td> <td style="text-align:right;"> 9.558103e+02 </td> <td style="text-align:right;"> 0.0000109 </td> <td style="text-align:right;"> 0.9999913 </td> </tr> <tr> <td style="text-align:left;"> grp.age25-30 </td> <td style="text-align:right;"> 0.1043019 </td> <td style="text-align:right;"> 8.486763e+02 </td> <td style="text-align:right;"> 0.0001229 </td> <td style="text-align:right;"> 0.9999019 </td> </tr> <tr> <td style="text-align:left;"> grp.age31-40 </td> <td style="text-align:right;"> 14.9125675 </td> <td style="text-align:right;"> 6.087398e+02 </td> <td style="text-align:right;"> 0.0244974 </td> <td style="text-align:right;"> 0.9804558 </td> </tr> <tr> <td style="text-align:left;"> grp.age41-50 </td> <td style="text-align:right;"> 15.9398410 </td> <td style="text-align:right;"> 6.087397e+02 </td> <td style="text-align:right;"> 0.0261850 </td> <td style="text-align:right;"> 0.9791098 </td> </tr> <tr> <td style="text-align:left;"> grp.age50 + </td> <td style="text-align:right;"> 17.2267749 </td> <td style="text-align:right;"> 6.087397e+02 </td> <td style="text-align:right;"> 0.0282991 </td> <td style="text-align:right;"> 0.9774236 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> hypertension1 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.6272358 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.718666e-01 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 3.6495493 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0002627 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> heart_disease1 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.6452723 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.012008e-01 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 3.2071066 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0013408 </td> </tr> <tr> <td style="text-align:left;"> ever_marriedYes </td> <td style="text-align:right;"> -0.3057168 </td> <td style="text-align:right;"> 2.445262e-01 </td> <td style="text-align:right;"> -1.2502415 </td> <td style="text-align:right;"> 0.2112114 </td> </tr> <tr> <td style="text-align:left;"> work_typeGovt_job </td> <td style="text-align:right;"> -13.4838709 </td> <td style="text-align:right;"> 6.087405e+02 </td> <td style="text-align:right;"> -0.0221504 </td> <td style="text-align:right;"> 0.9823279 </td> </tr> <tr> <td style="text-align:left;"> work_typeNever_worked </td> <td style="text-align:right;"> -13.2717808 </td> <td style="text-align:right;"> 2.286195e+03 </td> <td style="text-align:right;"> -0.0058052 </td> <td style="text-align:right;"> 0.9953682 </td> </tr> <tr> <td style="text-align:left;"> work_typePrivate </td> <td style="text-align:right;"> -13.2311130 </td> <td style="text-align:right;"> 6.087404e+02 </td> <td style="text-align:right;"> -0.0217352 </td> <td style="text-align:right;"> 0.9826592 </td> </tr> <tr> <td style="text-align:left;"> work_typeSelf-employed </td> <td style="text-align:right;"> -13.3618875 </td> <td style="text-align:right;"> 6.087405e+02 </td> <td style="text-align:right;"> -0.0219501 </td> <td style="text-align:right;"> 0.9824878 </td> </tr> <tr> <td style="text-align:left;"> Residence_typeUrban </td> <td style="text-align:right;"> 0.0410236 </td> <td style="text-align:right;"> 1.473891e-01 </td> <td style="text-align:right;"> 0.2783355 </td> <td style="text-align:right;"> 0.7807548 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> avg_glucose_level </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0055324 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.285500e-03 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.3038432 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0000168 </td> </tr> <tr> <td style="text-align:left;"> bmi </td> <td style="text-align:right;"> -0.0187560 </td> <td style="text-align:right;"> 1.160620e-02 </td> <td style="text-align:right;"> -1.6160276 </td> <td style="text-align:right;"> 0.1060883 </td> </tr> <tr> <td style="text-align:left;"> smoking_statusnever smoked </td> <td style="text-align:right;"> -0.0665951 </td> <td style="text-align:right;"> 1.851887e-01 </td> <td style="text-align:right;"> -0.3596067 </td> <td style="text-align:right;"> 0.7191413 </td> </tr> <tr> <td style="text-align:left;"> smoking_statussmokes </td> <td style="text-align:right;"> 0.0844136 </td> <td style="text-align:right;"> 2.234039e-01 </td> <td style="text-align:right;"> 0.3778517 </td> <td style="text-align:right;"> 0.7055407 </td> </tr> <tr> <td style="text-align:left;"> smoking_statusUnknown </td> <td style="text-align:right;"> -0.2635420 </td> <td style="text-align:right;"> 2.439421e-01 </td> <td style="text-align:right;"> -1.0803465 </td> <td style="text-align:right;"> 0.2799879 </td> </tr> </tbody> </table> --- .center[ ## Manual Model ] <table> <caption>Summary of inferential statistics of the reduced model</caption> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> Estimate </th> <th style="text-align:right;"> Std. Error </th> <th style="text-align:right;"> z value </th> <th style="text-align:right;"> Pr(>|z|) </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> (Intercept) </td> <td style="text-align:right;"> -3.451502 </td> <td style="text-align:right;"> 0.0876580 </td> <td style="text-align:right;"> -39.374652 </td> <td style="text-align:right;"> 0 </td> </tr> <tr> <td style="text-align:left;"> hypertension1 </td> <td style="text-align:right;"> 1.307380 </td> <td style="text-align:right;"> 0.1666566 </td> <td style="text-align:right;"> 7.844756 </td> <td style="text-align:right;"> 0 </td> </tr> <tr> <td style="text-align:left;"> heart_disease1 </td> <td style="text-align:right;"> 1.407844 </td> <td style="text-align:right;"> 0.1970324 </td> <td style="text-align:right;"> 7.145241 </td> <td style="text-align:right;"> 0 </td> </tr> </tbody> </table> --- .center[ ## Stepwise Model ] <table> <caption>Summary of inferential statistics of the final model</caption> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> Estimate </th> <th style="text-align:right;"> Std. Error </th> <th style="text-align:right;"> z value </th> <th style="text-align:right;"> Pr(>|z|) </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> (Intercept) </td> <td style="text-align:right;"> -6.8909795 </td> <td style="text-align:right;"> 1.0339416 </td> <td style="text-align:right;"> -6.6647667 </td> <td style="text-align:right;"> 0.0000000 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> hypertension1 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.6515714 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.1705278 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 3.8209100 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0001330 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> heart_disease1 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.6680755 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.1980582 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 3.3731278 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0007432 </td> </tr> <tr> <td style="text-align:left;"> grp.age21-24 </td> <td style="text-align:right;"> -12.6870260 </td> <td style="text-align:right;"> 741.5158532 </td> <td style="text-align:right;"> -0.0171096 </td> <td style="text-align:right;"> 0.9863492 </td> </tr> <tr> <td style="text-align:left;"> grp.age25-30 </td> <td style="text-align:right;"> -12.6779784 </td> <td style="text-align:right;"> 592.3335413 </td> <td style="text-align:right;"> -0.0214034 </td> <td style="text-align:right;"> 0.9829238 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age31-40 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.0147358 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.1009074 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.8300685 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0672397 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age41-50 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.9866882 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.0392570 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.8738687 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0040548 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age50 + </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.2528703 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.0095812 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.2125095 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0000253 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> avg_glucose_level </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0054563 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0012784 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.2680899 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0000197 </td> </tr> <tr> <td style="text-align:left;"> bmi </td> <td style="text-align:right;"> -0.0187445 </td> <td style="text-align:right;"> 0.0115840 </td> <td style="text-align:right;"> -1.6181364 </td> <td style="text-align:right;"> 0.1056332 </td> </tr> </tbody> </table> --- .center[ ## Goodness of Fit Measures ] <table> <caption>Comparison of global goodness-of-fit statistics</caption> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> Deviance.residual </th> <th style="text-align:right;"> Null.Deviance.Residual </th> <th style="text-align:right;"> AIC </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> full.model </td> <td style="text-align:right;"> 1409.708 </td> <td style="text-align:right;"> 1718.347 </td> <td style="text-align:right;"> 1451.708 </td> </tr> <tr> <td style="text-align:left;"> reduced.model </td> <td style="text-align:right;"> 1610.339 </td> <td style="text-align:right;"> 1718.347 </td> <td style="text-align:right;"> 1616.339 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> final.model </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1415.833 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1718.347 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1435.833 </td> </tr> </tbody> </table> --- .center[ ## Interpretting the Odds Ratio ] <table> <caption>Summary Stats with Odds Ratios</caption> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> Estimate </th> <th style="text-align:right;"> Std. Error </th> <th style="text-align:right;"> z value </th> <th style="text-align:right;"> Pr(>|z|) </th> <th style="text-align:right;"> odds.ratio </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> (Intercept) </td> <td style="text-align:right;"> -6.8909795 </td> <td style="text-align:right;"> 1.0339416 </td> <td style="text-align:right;"> -6.6647667 </td> <td style="text-align:right;"> 0.0000000 </td> <td style="text-align:right;"> 0.0010169 </td> </tr> <tr> <td style="text-align:left;"> hypertension1 </td> <td style="text-align:right;"> 0.6515714 </td> <td style="text-align:right;"> 0.1705278 </td> <td style="text-align:right;"> 3.8209100 </td> <td style="text-align:right;"> 0.0001330 </td> <td style="text-align:right;"> 1.9185533 </td> </tr> <tr> <td style="text-align:left;"> heart_disease1 </td> <td style="text-align:right;"> 0.6680755 </td> <td style="text-align:right;"> 0.1980582 </td> <td style="text-align:right;"> 3.3731278 </td> <td style="text-align:right;"> 0.0007432 </td> <td style="text-align:right;"> 1.9504800 </td> </tr> <tr> <td style="text-align:left;"> grp.age21-24 </td> <td style="text-align:right;"> -12.6870260 </td> <td style="text-align:right;"> 741.5158532 </td> <td style="text-align:right;"> -0.0171096 </td> <td style="text-align:right;"> 0.9863492 </td> <td style="text-align:right;"> 0.0000031 </td> </tr> <tr> <td style="text-align:left;"> grp.age25-30 </td> <td style="text-align:right;"> -12.6779784 </td> <td style="text-align:right;"> 592.3335413 </td> <td style="text-align:right;"> -0.0214034 </td> <td style="text-align:right;"> 0.9829238 </td> <td style="text-align:right;"> 0.0000031 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age31-40 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.0147358 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.1009074 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.8300685 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0672397 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 7.4987462 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age41-50 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.9866882 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.0392570 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 2.8738687 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0040548 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 19.8199344 </td> </tr> <tr> <td style="text-align:left;font-weight: bold;color: black !important;background-color: yellow !important;"> grp.age50 + </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.2528703 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 1.0095812 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 4.2125095 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 0.0000253 </td> <td style="text-align:right;font-weight: bold;color: black !important;background-color: yellow !important;"> 70.3069241 </td> </tr> <tr> <td style="text-align:left;"> avg_glucose_level </td> <td style="text-align:right;"> 0.0054563 </td> <td style="text-align:right;"> 0.0012784 </td> <td style="text-align:right;"> 4.2680899 </td> <td style="text-align:right;"> 0.0000197 </td> <td style="text-align:right;"> 1.0054712 </td> </tr> <tr> <td style="text-align:left;"> bmi </td> <td style="text-align:right;"> -0.0187445 </td> <td style="text-align:right;"> 0.0115840 </td> <td style="text-align:right;"> -1.6181364 </td> <td style="text-align:right;"> 0.1056332 </td> <td style="text-align:right;"> 0.9814301 </td> </tr> </tbody> </table> --- .center[ ## Summary and Conclusion ] - **hypertension** and **heart disease** are considered to be major contributors to the risk of having a stroke by experts - we obtain the final model with 5 variables, hypertension (1 dummy variable), heart disease (1 dummy variable), age ( 5 dummy variables), glucose, and BMI. - our final conclusion from our data is that health factors are what lead to strokes. --- <img src="000010.png" width="2560" />