This Shiny app will assist to classify Heart Disease Risk factor and also help to identify relationship between each risk factor.

Select the read.table parameters below

If you want to analyse new data, upload .csv file, or you can use the sample data for analysing


Customize Scatter-plot
Show/hide Visualization Help

Histogram: choose any numeric variable from x-axis and any categorical variable from fill

Bar-plot: choose any categorical or numeric variable from x-axis and categorical from fill

Box-plot: you can choose both numeric and categorical from x, y and fill

Density-plot: choose any numeric variable from x-axis and any categorical variable from fill

Scatter-plot: choose numeric varaible from x, y and categorical from fill

Note: while the data view will show only the specified number of observations, the summary will still be based on the full dataset.

If this is not selected then the linear regression is directly applied on the top predictor

For Numerical Variables
For Categorical Variables

Correlation, Linear Regression and Chi-Square Test

Observations

Summary


            

Correlation

Correlation Summary


            

Linear Regression Model Summary


            

            

Chi-Square Test of Independence

Following relationship are between outcome(Disease, No Disease) with other categorical variables

            

Decision Tree



Random Forest



Logistic Regression



Dataset Details

Categorical Variable Description Numeric Variable Description
sex 1= male, 0= female age age in years
cp chest pain type trestbps resting blood pressure (mmHg)
fbs fasting blood sugar > 120 mg/dl chol serum cholesterol in mg/dl
restecg resting electrocardiographic results thalach maximum heart rate
exang exercise induced angina oldpeak ST depression induced by exercise relative to rest
slope slope of peak exercise ST
ca no. of major vessels colored
thal thallium stress test
num diagnosis of heart disease
  • cp- chest pain type

    • Value 1: typical angina
    • Value 2: atypical angina
    • Value 3: non-anginal pain
    • Value 4: asymptomatic
  • fbs- fasting blood sugar

    • 1 = true; 0 = false
  • restecg- resting electrocardiographic results

    • Value 0: normal
    • Value 1: having ST-T wave abnormality (T wave inversions and/or ST elevation or depression of > 0.05 mV)
    • Value 2: showing probable or definite left ventricular hypertrophy by Estes' criteria
  • exang- exercise induced angina

    • 1 = yes; 0 = no
  • slope- the slope of the peak exercise ST segment

    • Value 1: upsloping; Value 2: flat; Value 3: downsloping
  • number of major vessels (0-3) colored by fluoroscopy

  • thal- thallium stress test

    • 3 = normal; 6 = fixed defect; 7 = reversable defect
  • num (outcome)- diagnosis of heart disease (angiographic disease status)

    • Value 0: < 50% diameter narrowing
    • Value 1: > 50% diameter narrowing (in any major vessel: attributes 59 through 68 are vessels)

This R Shiny web app allows the user to classify heart disease risk factor and data analysis using plots, statistical method and machine learning algorithm.

The app has sidebar for uploading heart disease dataset. You can either use the app with sample data or you can upload the data with certain column names and without missing value. With the app you can analyse heart disease risk factors using different types of plots, statistical method like correlation, regression, chi-square test of independence and you can also use few types of predictive modeling to classify the risk factors of heart disease.

I would like to continue enhancing this app with many additional features and graphics. Stay tuned for updates.

Md Faisal Akbar
Coder | Researcher | useR
Github.io | Shiny Server | Facebook | Twitter | Linkedin


Dataset Information

A sample from the raw file found here, with some of minor edits, for instance I removed missing values and inserted column names. Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.

Source Information
  • Creators: 1. Hungarian Institute of Cardiology. Budapest: Andras Janosi, M.D. 2. University Hospital, Zurich, Switzerland: William Steinbrunn, M.D. 3. University Hospital, Basel, Switzerland: Matthias Pfisterer, M.D. 4. V.A. Medical Center, Long Beach and Cleveland Clinic Foundation: Robert Detrano, M.D., Ph.D.
  • Donor: David W. Aha (aha @ ics.uci.edu)
Attributes
  • Number of attributes: 14 (overall).
  • 9 attributes are categorical variable. The remainder are numeric-valued.
    1. age: in years
    2. sex (1 = male; 0 = female)
    3. cp- chest pain type: 1= typical angina; 2= atypical angina; 3= non-anginal pain; 4= asymptomatic
    4. trestbps: resting blood pressure (in mm Hg on admission to the hospital)
    5. chol- serum cholestoral in mg/dl
    6. fbs- fasting blood sugar > 120 mg/dl, 1 = true; 0 = false
    7. restecg- resting electrocardiographic results, 0= normal, 1= having ST-T wave abnormality (T wave inversions and/or ST elevation or depression of > 0.05 mV), 2= showing probable or definite left ventricular hypertrophy by Estes criteria
    8. thalach- maximum heart rate achieved
    9. exang- exercise induced angina, 1 = yes; 0 = no)
    10. oldpeak- ST depression induced by exercise relative to rest
    11. slope- the slope of the peak exercise ST segment, 1= upsloping; 2= flat; 3= downsloping
    12. ca- number of major vessels (0-3) colored by fluoroscopy
    13. thal- 3 = normal; 6 = fixed defect; 7 = reversable defect (thalium test)
    14. num (outcome)- diagnosis of heart disease (angiographic disease status), Value 0: < 50% diameter narrowing; Value 1: > 50% diameter narrowing (in any major vessel: attributes 59 through 68 are vessels)