Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need the correct R code for the Logistic Regression Model. Thank you! Scenario You are a data analyst researching risk factors for heart disease
I need the correct R code for the Logistic Regression Model. Thank you!
Scenario
You are a data analyst researching risk factors for heart disease at a university hospital. You have access to a large set of historical data that you can use to analyze patterns between different health indicators egfasting blood sugar, maximum heart rate, etc.and the presence of heart disease. You have been asked to create different logistic regression models that predict whether or not a person is at risk for heart disease. A model like this could eventually be used to evaluate medical records and look for risks that might not be obvious to human doctors. You have also been asked to create a classification random forest model to predict the risk of heart disease and a regression random forest model to predict the maximum heart rate achieved.
There are several variables in this data set, but you will be working with the following important variables:
Variable What does it represent?
age: The persons age in years
sex: The persons sex male, female
cp: The type of chest pain experienced no pain, typical angina, atypical angina, nonanginal pain
trestbps: The person's resting blood pressure
chol: The person's cholesterol measurement in mgdl
fbs: The person's fasting blood sugar is greater than mgdl truefalse
restecg: Resting electrocardiographic measurement normal, having STT wave abnormality, showing probable or definite left ventricular hypertrophy by Estes' criteria
thalach: The person's maximum heart rate achieved
exang: Exerciseinduced angina yes, no
oldpeak: ST depression induced by exercise relative to rest STrelates to positions on the ECG plot
slope: The slope of the peak exercise ST segment upsloping, flat, downsloping
ca: The number of major vessels
target: Heart disease noyes
Model #First Logistic Regression Model
Report the results of the regression model. Address the following questions in your analysis. Round all numbers to four decimal places.
Write the general form and the prediction equation of the logistic multiple regression model for heart disease targetusing variables age ageresting blood pressure trestbpsexercised induced angina exangand maximum heart rate achieved thalachNote: Use the equation editor to write the regression equation.
Now write the prediction model equation in terms of the natural log of odds to express the beta terms in linear form.
Note: Use the equation editor to write the regression equation.
What do the following terms, from the general form of the model above, mean in terms of an individual having a heart disease?:
pi pi pi
Create this logistic regression model. Write the prediction model equation in terms of the natural log of oddsusing outputs obtained from your R script. Round all figures to four decimal places.
Interpret the estimated coefficient of the maximum heart rate achieved variable.
Model #First Logistic Regression Model
You have been asked to create a logistic regression model for heart disease targetusing the variables age ageresting blood pressure trestbpsexercised induced angina exangand maximum heart rate achieved thalach
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started