Learn R Programming

evtree (version 1.0-8)

StatlogHeart: Statlog Heart

Description

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

Usage

data("StatlogHeart")

Arguments

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).

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab