Predict heart disease from lab data

heart

Format

A data frame with 303 rows and 14 variables:

age

integer. age in years.

sex

factor with 2 levels. male, female.

cp

factor with 4 levels. chest pain type (typical angina, atypical angina, non-anginal pain, asymptomatic).

testbps

integer. resting blood pressure in mm Hg on admission to the hospital.

chol

integer. serum cholestoral in mg/dl.

fbs

integer. fasting blood sugar > 120 mg/dl (1 = true; 0 = false).

restecg

factor with 3 levels. resting electrocardiographic results (normal, having ST-T wave abnormality,left ventricular hypertrophy).

thalach

integer. maximum heart rate achieved.

exang

integer. exercise induced angina (1 = yes; 0 = no).

oldpeak

double. ST depression induced by exercise relative to rest.

slope

factor with 3 levels. the slope of the peak exercise ST segment (upslope, flat, downsloping).

ca

integer. number of major vessels (0-3) colored by flourosopy.

thal

factor with 3 levels. normal, fixed defect, reversable defect.

disease

factor with 2 levels. heart disease (yes, no). This is the outcome variable of interest.

Source

Data obtained from the UCI Machine Learning Repository.

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) (714) 856-8779

Examples

summary(heart)
#> age sex cp testbps #> Min. :29.00 female: 97 typical angina : 23 Min. : 94.0 #> 1st Qu.:48.00 male :206 atypical angina : 50 1st Qu.:120.0 #> Median :56.00 non-anginal pain: 86 Median :130.0 #> Mean :54.44 asymptomatic :144 Mean :131.7 #> 3rd Qu.:61.00 3rd Qu.:140.0 #> Max. :77.00 Max. :200.0 #> #> chol fbs restecg #> Min. :126.0 Min. :0.0000 normal :151 #> 1st Qu.:211.0 1st Qu.:0.0000 ST-T wave abnormality : 4 #> Median :241.0 Median :0.0000 left ventricular hypertrophy:148 #> Mean :246.7 Mean :0.1485 #> 3rd Qu.:275.0 3rd Qu.:0.0000 #> Max. :564.0 Max. :1.0000 #> #> thalach exang oldpeak slope #> Min. : 71.0 Min. :0.0000 Min. :0.00 upsloping :142 #> 1st Qu.:133.5 1st Qu.:0.0000 1st Qu.:0.00 flat :140 #> Median :153.0 Median :0.0000 Median :0.80 downsloping: 21 #> Mean :149.6 Mean :0.3267 Mean :1.04 #> 3rd Qu.:166.0 3rd Qu.:1.0000 3rd Qu.:1.60 #> Max. :202.0 Max. :1.0000 Max. :6.20 #> #> ca thal disease #> Min. :0.0000 normal :166 no :164 #> 1st Qu.:0.0000 fixed defect : 18 yes:139 #> Median :0.0000 reversable defect:117 #> Mean :0.6722 NA's : 2 #> 3rd Qu.:1.0000 #> Max. :3.0000 #> NA's :4