Search for question
Question

2. The data set HEARTFAILUREPREDICTION looks at several variables that play a role in heart failure prediction for 918 people in the United States. (For the curious, this set of open

data can be found at https://www.kaggle.com/datasets/fedesoriano/heart-failure-prediction.) Columns found in the dataset are as follows. 1. Age: age of the patient [years] 2. Sex: sex of the patient [M: Male, F: Female] 3. ChestPainType: chest pain type [TA: Typical Angina, ATA: Atypical Angina, NAP: Non- Anginal Pain, ASY: Asymptomatic] 4. RestingBP: resting blood pressure [mm Hg] 5. Cholesterol: serum cholesterol [mm/dl] 6. FastingBS: fasting blood sugar [1: if FastingBS > 120 mg/dl, 0: otherwise] 7. RestingECG: resting electrocardiogram results [Normal: Normal, ST: having ST-T wave abnormality (T wave inversions and/or ST elevation or depression of > 0.05 mV), LVH: showing probable or definite left ventricular hypertrophy by Estes' criteria] MaxHR: maximum heart rate achieved [Numeric value between 60 and 202] 8. 9. ExerciseAngina: exercise-induced angina [Y: Yes, N: No] 10. Oldpeak: oldpeak = ST [Numeric value measured in depression] 11. ST_Slope: the slope of the peak exercise ST segment [Up: upsloping, Flat: flat, Down: downsloping] 12. HeartDisease: output class [1: heart disease, 0: Normal] Use R Commander to obtain the most appropriate table to answer the following questions. For each question, copy or take a screenshot of the output in R commander and submit it along with your solutions to each question. To save space, you only need to copy and paste what is asked for in the questions and should adjust the size of the image when appropriate. Hint: construct a frequency distribution in part (a), and contingency tables in parts b through f. (a) If we randomly select a person, what is the probability that they are a female? (2 marks) (b) If we randomly select a person, what is the probability that they are a female and experience exercise-induced angina? (2 marks) (c) If we randomly select a female, what is the probability she has exercise-induced angina? (4 marks) (d) If we randomly select a person with exercise-induced angina, what is the probability that they are a male and are asymptomatic in chest pain? (4 marks) (e) If we randomly select a person, what is the probability they are asymptomatic in chest pain or have no exercise-induced angina, given they are male? (4 marks) 6

Fig: 1