StatlogHeart: Statlog Heart

Description Usage Format Details Source Examples

Description

Models of this data predict the absence or presence of heart disease.

Usage

1
data("StatlogHeart")

Format

A data frame containing 270 observations on 14 variables.

age

age in years.

sex

binary variable indicating sex.

chest_pain_type

factor variable indicating the chest pain type, with levels typical angina, atypical angina, non-anginal pain and asymptomatic.

resting_blood_pressure

resting blood pressure.

serum_colestoral

serum cholesterol in mg/dl.

fasting_blood_sugar

binary variable indicating if fasting blood sugar > 120 mg/dl.

resting_electrocardiographic_results

factor variable indicating resting electrocardiographic results, with levels 0: normal, 1: having ST-T wave abnormality (T wave inversions and/or ST elevation or depression of > 0.05 mV) and 2: showing probable or definite left ventricular hypertrophy by Estes' criteria.

maximum_heart_rate

the maximum heart rate achieved.

exercise_induced_angina

binary variable indicating the presence of exercise induced angina.

oldpeak

oldpeak = ST depression induced by exercise relative to rest.

slope_of_the_peak

ordered factor variable describing the slope of the peak exercise ST segment, with levels upsloping, flat and downsloping.

major_vessels

number of major vessels colored by flouroscopy.

thal

factor variable thal, with levels normal, fixed defect and reversible defect.

heart_disease

binary variable indicating the presence or absence of heart disease.

Details

The use of a cost matrix is suggested for this dataset. It is worse to class patients with heart disease as patients without heart disease (cost = 5), than it is to class patients without heart disease as having heart disease (cost = 1).

Source

The dataset has been taken from the UCI Repository Of Machine Learning Databases at

http://archive.ics.uci.edu/ml/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("StatlogHeart")
summary(StatlogHeart)
shw <- array(1, nrow(StatlogHeart))
shw[StatlogHeart$heart_disease == "presence"] <- 5
suppressWarnings(RNGversion("3.5.0"))
set.seed(1090)
sht <- evtree(heart_disease ~ . , data = StatlogHeart, weights = shw) 
sht
table(predict(sht), StatlogHeart$heart_disease)
plot(sht)

Example output

Loading required package: partykit
Loading required package: grid
Loading required package: libcoin
Loading required package: mvtnorm
      age            sex              chest_pain_type resting_blood_pressure
 Min.   :29.00   female: 87   typical angina  : 20    Min.   : 94.0         
 1st Qu.:48.00   male  :183   atypical angina : 42    1st Qu.:120.0         
 Median :55.00                non-anginal pain: 79    Median :130.0         
 Mean   :54.43                asymptomatic    :129    Mean   :131.3         
 3rd Qu.:61.00                                        3rd Qu.:140.0         
 Max.   :77.00                                        Max.   :200.0         
 serum_colestoral fasting_blood_sugar resting_electrocardiographic_results
 Min.   :126.0    no :230             0:131                               
 1st Qu.:213.0    yes: 40             1:  2                               
 Median :245.0                        2:137                               
 Mean   :249.7                                                            
 3rd Qu.:280.0                                                            
 Max.   :564.0                                                            
 maximum_heart_rate exercise_induced_angina    oldpeak       slope_of_the_peak
 Min.   : 71.0      no :181                 Min.   :0.00   upsloping  :130    
 1st Qu.:133.0      yes: 89                 1st Qu.:0.00   flat       :122    
 Median :153.5                              Median :0.80   downsloping: 18    
 Mean   :149.7                              Mean   :1.05                      
 3rd Qu.:166.0                              3rd Qu.:1.60                      
 Max.   :202.0                              Max.   :6.20                      
 major_vessels                   thal      heart_disease
 Min.   :0.0000   normal           :152   absence :150  
 1st Qu.:0.0000   fixed defect     : 14   presence:120  
 Median :0.0000   reversible defect:104                 
 Mean   :0.6704                                         
 3rd Qu.:1.0000                                         
 Max.   :3.0000                                         

Model formula:
heart_disease ~ age + sex + chest_pain_type + resting_blood_pressure + 
    serum_colestoral + fasting_blood_sugar + resting_electrocardiographic_results + 
    maximum_heart_rate + exercise_induced_angina + oldpeak + 
    slope_of_the_peak + major_vessels + thal

Fitted party:
[1] root
|   [2] oldpeak < 2.8
|   |   [3] major_vessels < 1
|   |   |   [4] thal in normal, fixed defect
|   |   |   |   [5] age < 59
|   |   |   |   |   [6] oldpeak < 1.8: absence (n = 80, err = 6.2%)
|   |   |   |   |   [7] oldpeak >= 1.8: presence (n = 12, err = 16.7%)
|   |   |   |   [8] age >= 59
|   |   |   |   |   [9] serum_colestoral < 234: absence (n = 12, err = 0.0%)
|   |   |   |   |   [10] serum_colestoral >= 234: presence (n = 45, err = 22.2%)
|   |   |   [11] thal in reversible defect: presence (n = 128, err = 14.1%)
|   |   [12] major_vessels >= 1: presence (n = 355, err = 8.5%)
|   [13] oldpeak >= 2.8: presence (n = 118, err = 2.5%)

Number of inner nodes:    6
Number of terminal nodes: 7
          
           absence presence
  absence       87        1
  presence      63      119

evtree documentation built on May 26, 2019, 3:01 p.m.