









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Churn Rate Regression Analysis
Typology: Cheat Sheet
1 / 15
This page cannot be seen from the preview
Don't miss anything!










H. Milton Stewart School of Industrial and Systems Engineering
Variable Description Sex Male or female(Nominal) Age Age of the patient Current Smoker Whether or not the patient is a current smoker (Nominal) Cigs per day the number of cigarettes that the person smoked on average in one day BP Meds whether or not the patient was on blood pressure medication (Nominal) Prevalent Stroke whether or not the patient had previously had a stroke (Nominal) Diabetes whether or not the patient had diabetes (Nominal) Variable Description Tot Chol Total cholesterol level Sys BP Systolic blood pressure BMI Body Mass Index Heart Rate heart rate Glucose glucose level Prevalent Hyp whether or not the patient was hypertensive (Nominal) 10 - year CHD risk( Y Var ) 10 - year risk of coronary heart disease(CHD) (“1”, means “Yes”, “0” means “No”)
barplot(prop.table(age), axes=T, space=0.3, horiz=T, xlab="Proportion of No Heart Disease (blue) vs Heart Disease (Brown)", col=c("blue","brown"), main="Heart Disease by Age Group")
barplot(prop.table(edu), axes=T, space=0.3, horiz=T, xlab="Proportion of No Heart Disease (blue) vs Heart Disease (Brown)", col=c("blue","brown"), main="Heart Disease by Education Level")
barplot(prop.table(smoker), axes=T, space=0.3, horiz=T, xlab="Proportion of No Heart Disease (blue) vs Heart Disease (Brown)", col=c("blue","brown"), main="Heart Disease by Smoker")
Deviance Test for GOF: Chi-squared statistic: 2549. P-value: 1 Pearson Test for GOF: Chi-squared statistic: 3357.441 P-value: 0.
R function for computing classification accuracy measures R function for outputting accuracy measures given a training model R function for computing classification accuracy measures
Cross Validation: K=5 folds model <- caret::train(TenYearCHD ~ ., data = data2, method = "naive_bayes", trControl = myControl, metric = "Accuracy") average_metrics <- colMeans(model$resample[, c("Accuracy.Accuracy", "Precision.Pos Pred Value", "Recall.Sensitivity", "F1.Pos Pred Value", "AUC")], na.rm = TRUE) print(average_metrics) Results Measure Accuracy 0. Sensitivity 0. Precision 0. F- Measure
Cross Validation: K=5 folds model <- caret::train(TenYearCHD ~ ., data = data2, method = “ ", trControl = myControl, metric = "Accuracy") average_metrics <- colMeans(model$resample[, c("Accuracy.Accuracy", "Precision.Pos Pred Value", "Recall.Sensitivity", "F1.Pos Pred Value", "AUC")], na.rm = TRUE) print(average_metrics) Classification Method: