Life expectancy data was downloaded from data.gov. This dataset contains death rates and life-expectancy statistics from 1900 to 2015. Exploratory analysis was conducted on this dataset.
source("process_data.R")
## Parsed with column specification:
## cols(
## Year = col_integer(),
## Race = col_character(),
## Sex = col_character(),
## `Average Life Expectancy (Years)` = col_double(),
## `Age-adjusted Death Rate` = col_double()
## )
summary(expectancy)
## year race sex life_expectancy
## Min. :1900 Length:1044 Length:1044 Min. :29.10
## 1st Qu.:1929 Class :character Class :character 1st Qu.:56.60
## Median :1958 Mode :character Mode :character Median :66.60
## Mean :1958 Mean :64.12
## 3rd Qu.:1986 3rd Qu.:73.60
## Max. :2015 Max. :81.40
## NA's :9
## death_rate
## Min. : 616.7
## 1st Qu.:1040.2
## Median :1541.4
## Mean :1614.1
## 3rd Qu.:2073.0
## Max. :3845.7
##
Below you will find a widget that you may use to few the contents of the data expectancy dataset. This is the dataset that will be explored later on in this analysis.
library(DT)
datatable(expectancy,
options = list(pageLength = 5))
The plot below shows life expectancy by year for all sexes.
As you can see, life expectancy rises for everyone from 1900 to 2015. Women have a higher life expectancy than men and both groups follow the same upward trend while maintaining a difference between the two groups.