| Cleveland | R Documentation |
A cleaned version of the Cleveland heart disease dataset from the UCI Machine
Learning Repository. This version contains only complete cases and includes a
derived binary outcome variable hd indicating the presence ("Yes")
or absence ("No") of heart disease.
data("Cleveland")
A data frame with 297 observations and 15 variables:
Age in years (numeric).
Sex (0 = female, 1 = male).
Chest pain type (numeric code 1–4).
Resting blood pressure (mm Hg).
Serum cholesterol (mg/dl).
Fasting blood sugar > 120 mg/dl (1 = true, 0 = false).
Resting electrocardiographic results (numeric code).
Maximum heart rate achieved.
Exercise-induced angina (1 = yes, 0 = no).
ST depression induced by exercise relative to rest.
Slope of the peak exercise ST segment.
Number of major vessels colored by fluoroscopy (0–3).
Thalassemia status (numeric code).
Original UCI disease score (0–4).
Binary heart disease indicator: "No" (num = 0) or "Yes" (num > 0).
UCI Machine Learning Repository: Heart Disease Data Set. https://archive.ics.uci.edu/dataset/45/heart+disease
############################### Start of Cleveland dataset example ####################
data("Cleveland")
head(Cleveland)
summary(Cleveland)
# OpenCL-accelerated Bayesian logistic regression example
# This only runs off CRAN when OpenCL is available
if (identical(Sys.getenv("NOT_CRAN"), "true") && has_opencl()) {
ps <- Prior_Setup(
hd ~ age + sex + cp + trestbps + chol +
fbs + restecg + thalach + exang + oldpeak + slope + ca + thal,
family = binomial(logit),
data = Cleveland
)
fit <- glmb(
hd ~ age + sex + cp + trestbps + chol +
fbs + restecg + thalach + exang + oldpeak + slope + ca + thal,
family = binomial(link = "logit"),
pfamily = dNormal(mu = ps$mu, Sigma = ps$Sigma),
data = Cleveland,
n = 1000,
Gridtype = 2,
use_parallel = TRUE,
use_opencl = TRUE,
verbose = FALSE
)
summary(fit)
} else {
message("Skipping OpenCL example (CRAN check or OpenCL not built).")
}
###############################################################################
## End of Cleveland dataset example
###############################################################################
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.