The deficiency of oxygen in the brain will cause the cells to die, and the body parts controlled by the brain cells will become dysfunctional. Damage or rupture of blood vessels in the brain is better known as a stroke. Many factors affect stroke. These factors certainly need to be observed and alerted to prevent the high number of stroke sufferers. Therefore, this study aims to analyze the variables that influence stroke in medical records using statistical analysis (correlation) and stroke prediction using the XAI algorithm. Factors analyzed included gender, age, hypertension, heart disease, marital status, residence type, occupation, glucose level, BMI, and smoking. Based on the study results, we found that women have a higher risk of stroke than men, and even people who do not have hypertension and heart disease (hypertension and heart disease are not detected early) still have a high risk of stroke. Married people also have a higher risk of stroke than unmarried people. In addition, bad habits such as smoking, working with very intense thoughts and activities, and the type of living environment that is not conducive can also trigger a stroke. Increasing age, BMI, and glucose levels certainly affect a person's stroke risk. We have also succeeded in predicting stroke using the EMR data with high accuracy, sensitivity, and precision. Based on the performance matrix, PNN has the highest accuracy, sensitivity, and F-measure levels of 95%, 100%, and 97% compared to other algorithms, such as RF, NB, SVM, and KNN.