Learn R Programming

BSDA (version 1.2.0)

Framingh: Cholesterol values of 62 subjects in the Framingham Heart Study

Description

Data for Exercises 1.56, 1.75, 3.69, and 5.60

Usage

Framingh

Arguments

Format

A data frame/tibble with 62 observations on one variable

cholest

a numeric vector with cholesterol values

References

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.

Examples

Run this code
# NOT RUN {
stem(Framingh$cholest)
boxplot(Framingh$cholest, horizontal = TRUE)
hist(Framingh$cholest, freq = FALSE)
lines(density(Framingh$cholest))
mean(Framingh$cholest > 200 & Framingh$cholest < 240)

# }
# NOT RUN {
library(ggplot2)
ggplot2::ggplot(data = Framingh, aes(x = factor(1), y = cholest)) + 
  geom_boxplot() +                 # boxplot
  labs(x = "") +                   # no x label  
  theme_bw() +                     # black and white theme  
  geom_jitter(width = 0.2) +       # jitter points
  coord_flip()                     # Create horizontal plot
ggplot2::ggplot(data = Framingh, aes(x = cholest, y = ..density..)) +
  geom_histogram(fill = "pink", binwidth = 15, color = "black") + 
  geom_density() + 
  theme_bw()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab