Box Plots
Description
The following R command calculates side-by-side box plots comparing the career home runs for Ruth, DiMaggio, and Bonds for each season that they played in major league baseball.
To use R in a Sage cell, the language must be set to R. See https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst for details.
Sage Cell
Code
ruth <- c(22, 25, 34, 35, 41, 41, 46, 46, 46, 47, 49, 54, 54, 59, 60)
bonds <- c(16, 25, 24, 19, 33, 25, 34, 46, 37, 33, 42, 40, 37, 34, 49, 73, 46, 45, 45, 5, 26, 28)
dimaggio <- c(12, 14, 20, 21, 25, 29, 30, 30, 31, 32, 32, 39, 46)
boxplot(ruth, bonds, dimaggio, names=c("Ruth", "Bonds", "DiMaggio"), main="Comparing Homerun Seasons")
Options
None
Tags
Primary Tags: Statistics: Exploratory data analysis/descriptive statistics
Secondary Tags: Exploratory data analysis/descriptive statistics: Graphical representations
Related Cells
- A stem-and-leaf plot with R
- Constructing Histograms with R
- Constructing Pie Charts with R
- Constructing Time Series Plots with R
Attribute
Permalink:
Author: T. Judson
Date: 19 Jul 2017 12:05
Submitted by: Tom Judson