Time Series
Description
Plotting the time series for the 1918–1919 influenze epidemic. The plot for the number of cases is in red, and the plot for 10 times the number of deaths is in blue.
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
cases <- c(36, 531, 4233, 8682, 7164, 2229, 600, 164, 57, 722, 1517, 1828, 1539, 2416, 3148, 3465, 1440)
deaths <- c(0, 0, 130, 552, 738, 414, 198, 90, 56, 50, 71, 137, 178, 194, 290, 310, 149)
plot(ts(cases), col="red", main="Influenza Epidemic")
lines(ts(10*deaths),col="blue")
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
- Box plots with R
- Constructing Histograms with R
- Constructing Pie Charts with R
Attribute
Permalink:
Author: T. Judson
Date: 19 Jul 2017 10:49
Submitted by: Tom Judson